Check out the nRF24L01+ on Arduino

After searching for a reliable RF transceiver that will work with Arduino and is not the XBee I think that I have finally found something that works well. The nRF24L01+ is a popular RF transceiver produced by Nordic. There is a breakout board available at SparkFun which gives access to the pins and provides all of the ancillary support circuitry to get the chip working. I won’t go into the details of the chip here, because they are pretty available elsewhere, but I will give an outline of how you can get one of these chips working with your Arduino. This will allow you to send digitized data from one micro controller to another wirelessly, and provides significant opportunity for tailoring the hardware and software to your particular application. The XBees are also great transcievers, but they are pricy and have too much horsepower for sending simple data wirelessly from one point to another. Plus, the nRF24L01+’s allow for some code reduction and streamlining, hacking and a better understanding of what is going on under the hood of the RF chip. However, if you are a fan of the XBee, that is great too.

Getting the chips working

Connect the pins

nRF24L01+ Arduino
SCK 13
CSN 10
VCC 5V rail (may depend on breakout board model

Get the code

You can get the nRF24L01 library files from my github account. The examples included implement an Arduino controlled master/slave radio pair in which when the master radio sends a “1” to the slave, the slave replies with a number starting with 1 and incrementing with each reply. It is very basic and does not use much of the more advanced features of the nRF24L01, but it is enough to get started and is compact and simple enough to easily expand upon. My goal was to make something which is most easily accessable and to document it well enough for anyone needing more advanced feature implementation to expand it. This code should be easy enough to get a simple reading from an analog signal, which is mostly what I think people are interested in for these radios. Load the nRF24L01 library into your Arduino library folder as per usual. The examples should then show up in your sketchbook after you restart the Arduino IDE.

Get Serial working

For the examples to work you will need to get a serial com working on your computer. I’m going to use putty here because I’m working in windows for this project ( I find embedded hardware easier to develop in windows). Putty is a free communications platform for windows, it is officially termed an open-source terminal emulator, serial console and network file transfer application. But that seems like a bit of a mess of an explination. More to the point, it will allow you to use your USB to connect to the Arduino and send and receive text data much the same way as the terminal window in the Arduino IDE works. But this way you won’t need the Arduino IDE and Putty does a whole lot more and you should get it anyway if you are in the Windows world. At any rate, once you get Putty working, you’ll need to set it up to talk to your Arduino.
Putty setup for Arduino
Putty setup for Arduino
This is pretty simple, just take a look at the window screenshot. Here the Serial line is set to COM3, this will probably be different on your system. You’ll need to figure out which COM port your Arduino is connected to. The Arduino IDE will tell you in Tools -> Serial Port, and there are other ways. You will need to already have both Arduino’s, the master and slave, already programmed and powered on. Also, the master Arduino will need to be connected to the computer that is running Putty. The Slave Arduino can be powered any way you see fit.

Communicate data

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha cuz spammers are everywhere! * Time limit is exhausted. Please reload CAPTCHA.