nRf24L01+ transceivers are really great wireless solutions owing to their ease of use and cost(I bought a pair for 380 rupees from e-bay). In this and the following posts i tell you how i proceeded with them ,the problems that i faced and the important things that you need to know before transmitting your first wireless message.
- First of all you need to get the datasheet which you can get HERE.
- Read the datasheet properly. I read it 4 times to know exactly how the transceivers function.Its really important that you understand the concepts properly even if you are not creating your own library because it will let you “correctly” explore the features and aid you in writing your own codes.
- Then you need the libraries to drive them.There are 2 libraries that i know of , one is by Maniacbug and the other by Greg Copeland which is the forked version of the former. I used the one by Maniacbug.
- Read the documentation of the functions properly, what do they do and how to use them cause this will be the most useful thing while writing your own code.
- Now you need to visit THIS great wiki on the transceivers to get the correct pin maps.Right now just use this page for connecting your pins ,do not worry about the power problems listed there.
- Time to check whether your transceivers are responsive.For this open the “Getting started” sketch from the RF24master library (having problems putting up the library? you ought to go HERE) and upload the sketch.Please note that the baud rate in the sketch is 57600 so you need to change the baud rate in serial monitor to 57600 to get something sensible (i myself spent a lot of time troubleshooting this as i had not seen the baud rate in the sketch to be 57600 !!!). The results should be somewhat like whats there on THIS page or put simply if you see this….
it means every thing is perfect and you are ready to proceed further. But if you see this…
then there is something wrong and you cannot proceed further. For that i would suggest you recheck your connections or reset your board a few times, upload the sketch again. It ought to work by then.In my case i had a new arduino and an old one, the new one was working properly but the old one had some issues. What i did was that i connected all the other pins except CE and CSN to their corresponding ICSP pins on the uno and lo !! it started working like a charm(after that i did the same for the new board too :p ).
After that just type “t” in any of the serial monitors and see the results.
The possibilities are as follows…..
it means that your transmitter is not able to transmit messages or more precisely it is not able to execute that radio.write(); function properly.
But if you see this…
then it means that somehow both of them are transmitting . In my case this error dosen’t last longer and quickly changes to the one below….
then it means that both the nodes are transmitting. So you need to change one of them to RX mode.
When everything is working perfectly then you are supposed to see something like this….