DIY Arduino Adapter for the NRF24L01

by JD_K in Circuits > Arduino

4294 Views, 3 Favorites, 0 Comments

DIY Arduino Adapter for the NRF24L01

20210415_205638.jpg
DIY Arduino Adapter for the nRF24L01

The nRF24L01 is a common radio transceiver used with Arduino microcontrollers. They can be used for wireless communication, wireless data transfer, networks of wireless devices and remote-controlled robots. For a great tutorial on how to use them, I suggest the DroneBot Workshop tutorial (click here), which also has a YouTube video. The transceiver module uses the Serial Peripheral Interface (SPI) which is a convenient method for data transfer between electrical components wired together. There are some caveats to using the nRF24L01 transceiver however:

  • They are powered with 3.3 volts, rather than the 5 volts that most Arduinos typically use.
  • They require sudden spikes in current demand which can exceed what the Arduino board can supply in such a short period of time.
  • The layout of the pins is two rows of four pins which means it cannot be connected directly to an Arduino or even be used on a solderless breadboard.
  • Furthermore, because they are radio frequency receivers, they are best connected to the Arduino as close as possible to help reduce interference in the signal.

There are already inexpensive adapters that make the use of the nRF24L01 much easier. Just do a Google image search of “nRF24L01 adapter”. Typically, these have a voltage regulator so powering the device with a 5-volt supply will not damage it. Plus, the capacitors on the adapter accommodate the spikes in the current demand, and improve the reliability of the signals. However, the male pins on the adapter are usually on the top surface which again, prevents the adapter from being connected directly to the Arduino or a breadboard. And, this is personal preference, I don’t like how the transceiver has to “hang” off the back of the adapter, like someone wearing a baseball cap upside-down and backwards.

For all these reasons, in this Instructable I will show how I soldered together a DYI nRF24L01 adapter which attempts to solve a lot of these issues. This is not a beginner project, as you will have to solder the components together, but is otherwise rather simple. I think you will see; this adapter is easier to use than the commercially available one because it can be connected directly to an Arduino, or other microcontrollers that have the same pin layout, Arduino Mega comes to mind. It is convenient to use with a breadboard. It also has a capacitor for sudden increases in current demand, and an optional voltage regulator to manage electrical requirements. The pin layout is set up to work with the default setup of the RadioHead library (click here), which is open source so it can be downloaded for free. I tried to make the adapter compact, yet as versatile as possible, so it will work with multiple library codes for Arduino, can allow changes to some of the pins, and will work other devices that use the SPI communication. You will, of course, need at least two adapters because it takes at least two nRF24L01 to be able to talk to each other. 😊

Supplies

Parts for a single adapter:

  • nRF24L01 (or nRF24L01+) wireless transcevier
  • Arduino (UNO, Mega, or Nano, etc
  • Female header pins – enough for two 4-pin segments, and one 7 pin segment
  • 90-degree male header pins – enough for one 7 pin segment, two 2 pin segments and a single pin
  • Jumper connectors x2
  • Perf board (2 x 2.5 cm)
  • Red jumper wire with a male pin end (~10cm)
  • Electrolytic capacitor 10-100 microfarad (uF)
  • Wire (I used 26 AWG)
  • Self-adhesive label - to remind you not to connect to 5V if you don’t have the voltage regulator
  • Soldering iron and solder

Optional parts for voltage regulator:

  • AMS 1117 3.3volt regulator
  • 10 uF capacitor to use with the voltage regulator
  • Switch (single pole, double throw)

The Layout for Version One

nRF24L01 Adapter_no Voltage regulator_bb.jpg
20210415_235223-0.jpg
20210415_235243-0.jpg

Here is a Fritzing diagram that shows the connections for the version without the voltage regulator, plus front and back photos of the adapter. At the heart of it are two rows of 4-pin female headers which make the socket for the nRF24L01. This Fritzing diagram shows pins for two jumper connectors at the top, but the one in the photos only has one that connects to the CE pin of the transceiver to pin D8 of the Arduino.

The Layout for Version Two

nRF24L01 Adapter AMS1117.png
nRF24L01 Adapter_no wires_bb.jpg
20210415_235111-0.jpg
20210415_235135-0.jpg
20210415_235402-0.jpg
20210415_235613-0.jpg

The second version of the adapter has the voltage regulator, and a switch if you want to bypass the regulator. I have included two Fritzing diagrams, one with all the wire connections that need to be soldered and one without the connections to make it easier to see what the components are. The photographs here are the front, back, right and left side of the adapter I made.

Features of the Adapters

Finished product.jpg

I posted a YouTube video at the beginning of this Instructable that shows the features and has a quick demonstration of two nRF24L01 working. The best feature of these adapters is that they can be directly plugged into the Arduino Uno, or any Arduino that has the same pin layout. There is no guess work, because the seven male pins on the adapter are plugged in the Arduino pins from D8 through D13 and the ground pin which are all adjacent and grouped together separate from the other digital pins. When the adapter is plugged into the Arduino, it is obvious the direction of the transceiver as you cannot attach it upside down. This feature all but eliminates any wiring mistakes.

The capacitor next to the transceiver will act like a reservoir of electricity, and if the electrical demand of the transceiver suddenly increases, the capacitor should provide the extra current. This is important, as without this capacitor, it can look like the nRF24L01 is not working. I am not sure how large this capacitor needs to be, I have seen many recommendations for 10 microfarads, but I have also seen 100 uF. So far, I have not noticed any problems with a 10uF capacitor, but since this was going to be a permanent adapter, I went with 100uF in version two (I think that logic is sound).

Admittedly, the voltage regulator of the adapter adds a level of complexity to this project. And given the fact that most of the time the 3.3-volt pin of the Arduino can supply enough current, the voltage regulator is not always needed. So, in the first version of the adapter, the voltage regulator is left out, and the red jumper wire can then be plugged into the 3.3 volts of the Arduino, or another 3.3-volt source. The second version with the AMS 1117 voltage regulator has a second capacitor which helps to smooth out the input voltage to the regulator. With the voltage regulator you can then power the transceiver with a suitable voltage source anywhere from 4.5 to 7 volts. The switch allows you to enable the voltage regulator, or if you have a 3.3 voltage source already, you can flip the switch so that the voltage regulator is not used. As a matter of habit, I try to keep the voltage regulator selected with the switch just in case I connect to a higher voltage, I don’t want to destroy the transceiver.

The two jumper connectors at the top of the adapter connect the CE pin of the transceiver to D8 of the Arduino, and the CSN pin to D10. These jumper connectors are optional, and you could just wire directly from the socket to the Arduino pins without the jumper connectors and the male header pins that go with them. Either way, the D8 and D10 are the default connections programmed into the RadioHead library. If your project requires D8 and D10 Arduino pins for something else, the jumper connectors can be removed, and you can use jumper wires to connect CE and CSN of the adapter to different Arduino pins along with changing the code to reflect this.

There is a row of seven female pins on the adapter. This has a few uses, for example allowing for other devices that use SPI communication. Devices that use SPI are meant to be able to be used together in the same project but must share Arduino pins D11, D12 and D13; the female pins allow for this. Furthermore, with D9 not normally being used with the RadioHead library, that pin can still be accessed with the associated female header pin on the adapter.

Lastly, the IRQ pin of the transceiver is an interrupt pin. It can be used to signal the Arduino that data is being sent, received or if the sent signal failed. I have not seen many people use this pin; however, it is brought out on the right side of the adapter to a single male pin so it can still be used if you need it.

Summary

In summary, this DIY adapter minimizes the most common challenges of using the nRF24L01: radiofrequency interference, voltage spikes and wiring mistakes. Plus, the adapter makes using the nRF24L01 very easy to use, just plug-and-play. Programming is easier because it is set up to work immediately with the RadioHead library which is a popular Arduino library that is well documented and has several example programs. With all these advantages, the adapter is still versatile so it can be implemented in a wide variety of Arduino projects. I hope this Instructable has given you some ideas. Happy making!