DEV Community

Cover image for How nRF24L01+ Works and How to Interface It with Arduino
Play with Circuit
Play with Circuit

Posted on

How nRF24L01+ Works and How to Interface It with Arduino

Wireless communication between microcontrollers is useful in many projects where running physical wires between devices is inconvenient. For example, the same approach can be used for remote sensing, wireless control, home automation, and distributed sensor systems.

For Arduino-based projects, the nRF24L01+ transceiver module is a practical option for adding wireless communication. It operates in the 2.4 GHz ISM band and supports both transmitting and receiving data, which makes it possible to build simple two-way communication systems as well as networks with multiple transmitters.

In this project, I am using two Arduino boards with nRF24L01+ modules to demonstrate a basic communication between an initiator and a responder. The initiator sends a message, the responder receives it and sends a reply, and the communication status is displayed on an I2C LCD connected to the initiator.

I will also cover how the nRF24L01+ Multiceiver feature can be used to communicate with multiple transmitters through a single receiver.

What is the nRF24L01+?

The nRF24L01+ is a low-cost, single-chip wireless transceiver module capable of both transmitting and receiving data. The module operates between 1.9 V and 3.6 V and works best with a 3.3 V supply.

It is a relatively low-power device. During transmission it consumes around 11.3 mA, while receive current is around 13.5 mA. It can also enter standby and power-down modes, where its current consumption drops considerably. This makes it useful for battery-powered wireless applications.

The standard nRF24L01+ module uses a PCB trace antenna and can provide a communication range of around 50–100 meters in open space. If a longer range is required, versions with a PA (Power Amplifier), LNA (Low-Noise Amplifier), and external antenna are available. Depending on the environment and configuration, these versions can provide communication distances of up to 1000 meters in open space.

The nRF24L01+ supports data rates of 250 Kbps, 1 Mbps, and 2 Mbps. Using a lower data rate such as 250 Kbps can improve the effective communication range because the lower rate is less sensitive to noise.

Technical Specifications

Parameter Specification
Frequency range 2.4 – 2.5 GHz ISM band
Data rates 250 Kbps / 1 Mbps / 2 Mbps
Maximum output power 0 dBm
Operating voltage 1.9 – 3.6 V
Maximum operating current 13.5 mA
Standby current 26 µA
Logic inputs 5 V tolerant
Communication range 100 m (open space)
SPI interface speed 0–8 Mbps

For the complete electrical specifications, refer to the nRF24L01+ product datasheet.

How Does the nRF24L01+ Communicate?

The nRF24L01+ operates in the 2.4 GHz ISM band, from 2.400 GHz to 2.525 GHz. This frequency range is divided into channels. At a data rate of 1 Mbps, the channel spacing is 1 MHz, giving 126 available channels from channel 0 to channel 125.

For two nRF24L01+ modules to communicate, both modules need to be configured to use the same RF channel. For example, if the transmitter is configured for 2500 MHz, corresponding to channel 100, the receiver must use the same frequency.

This channel-based arrangement also makes it possible to operate multiple groups of nRF24L01+ devices in the same area while reducing interference by assigning different groups to different channels.

Multiceiver

One of the useful features of the nRF24L01+ is its Multiceiver capability. A single receiver can communicate with up to six different transmitters on the same RF channel.

The receiver uses six individual data pipes, each with its own address. Although six pipes can be configured, only one data pipe can receive a packet at any particular moment.

This feature is particularly useful when several Arduino-based nodes need to send information to one central Arduino.

Enhanced ShockBurst

The nRF24L01+ also has hardware support for the Enhanced ShockBurst communication protocol. A number of tasks that would otherwise have to be handled by the microcontroller are managed internally by the RF module.

When transmitting, the module handles packet formation, including the preamble, address, and CRC. When a packet reaches the receiver, the module checks whether the packet is valid before placing the received data into its Rx FIFO.

The module can also automatically send an acknowledgment to the transmitter after successfully receiving a valid packet. If the transmitter does not receive the expected acknowledgment, it can automatically retransmit the packet.

These features make communication more reliable and reduce the amount of communication-handling code required on the Arduino.

nRF24L01+ Module Variants

The nRF24L01+ is available in several physical configurations. The core nRF24L01+ chip is essentially the same, but the antenna arrangement and additional RF circuitry can differ.

nRF24L01+ with PCB Antenna

This is the commonly available compact version of the module. It uses a PCB trace antenna and is suitable for short- to medium-range wireless communication.

Its typical range can reach around 100 meters in open space, although the actual range indoors can be considerably lower because walls, furniture, and other objects affect the RF signal.

nRF24L01+ with SMA Connector

Another version provides an SMA connector for connecting an external antenna. The external antenna can provide better signal performance and can improve communication range and stability, particularly when there are obstacles between the two devices.

nRF24L01+ PA + LNA Version

For applications requiring greater range, the PA + LNA version combines an external antenna with additional RF amplification.

This version includes an RFX2401C range extender that provides Power Amplifier and Low-Noise Amplifier functionality along with transmit/receive switching. With the additional amplification and external antenna, communication distances of up to 1000 meters in open space are possible under suitable conditions.

The PA + LNA module remains compatible with other nRF24L01+ variants, so it can generally be substituted for the standard module in the same type of Arduino project.

What Do PA and LNA Do?

The Power Amplifier (PA) increases the strength of the signal being transmitted. This allows the RF signal to travel a greater distance.

The Low-Noise Amplifier (LNA) works on the receiving side. Signals arriving from a distant transmitter can be very weak, so the LNA amplifies these incoming signals while keeping additional noise low.

Using both PA and LNA therefore helps the module transmit over longer distances and receive weaker signals more effectively.

nRF24L01+ Pinout

The nRF24L01+ has eight pins: GND, VCC, CE, CSN, SCK, MOSI, MISO, and IRQ.

GND is the ground connection. On the module, this pin is marked with a square pad, which can help identify the pin orientation.

VCC is the power supply pin. The module operates from 1.9 V to 3.6 V and works best at 3.3 V.

CE (Chip Enable) is an active-high control pin used to switch the module between active and standby states. When CE is HIGH, the module can operate in transmit or receive mode according to its configuration. When CE is LOW, the module remains in standby mode.

CSN (Chip Select Not) is the active-low SPI chip-select pin. It is normally HIGH and is pulled LOW when the Arduino needs to communicate with the nRF24L01+ over SPI.

SCK (Serial Clock) receives the SPI clock signal generated by the Arduino.

MOSI (Master Out Slave In) carries data from the Arduino to the nRF24L01+.

MISO (Master In Slave Out) carries data from the nRF24L01+ back to the Arduino.

IRQ (Interrupt Request) is an optional active-low interrupt pin. It can be used by the module to notify the microcontroller about events such as received data.

Two-Way Communication Between Two nRF24L01+ Modules

To test the wireless link, I used two Arduino boards, each connected to an nRF24L01+ module. One Arduino acts as the initiator, while the other works as the responder.

The initiator sends a message through its nRF24L01+ module. When the responder receives the message, it sends a response back to the initiator. An I2C LCD connected to the initiator displays the communication status.

This provides a simple way to verify that the two RF modules are correctly configured and that data is being exchanged in both directions.

Hardware Requirements

Component Quantity Remarks
Arduino UNO R3 1 Revision R3
LCD 16x2 1 I2C support
Jumper Wires 1 For Arduino and LCD connections
USB Cable Type A to B 1 For programming Arduino UNO
12V Supply Adapter 1 For providing power to Arduino
nRF24L01+ Modules 1 For interfacing with Arduino

Software Requirements

The project uses the Arduino IDE for programming. The required software setup is:

  • Arduino IDE version 2.3.4 or above
  • LiquidCrystal_I2C library by Frank de Brabander, version 1.1.2
  • RF24 library by TMRh20, version 1.5.0

Wiring Connections

There are two wiring setups in this project: one for the initiator and another for the responder.

The nRF24L01+ connections are the same on both Arduino boards. The main difference is that the initiator also has an I2C LCD connected to it, while the responder sends its received data through the serial port.

Initiator Wiring


The nRF24L01+ communicates with the Arduino through the SPI bus using the MISO, MOSI, SCK, and CSN pins. In addition to these connections, CE, VCC, and GND are also connected. The IRQ pin is left unused.

The connections between Arduino Uno and nRF Module are as follows:

nRF Module Arduino Side Pin
GND (Pin 1) GND pin of Arduino
VCC (pin 2) 3.3V pin of Arduino
CE (Pin 3) 9
CSN (Pin 4) 10
SCK (Pin 5) 13
MOSI (Pin 6) 11
MISO (Pin 7) 12
IRQ (Pin 8) Not connected

When using a base for the nRF module that internally converts 5 V to 3.3 V, the power connection of the base can be connected to the 5 V pin of the Arduino.

If the nRF24L01+ module is being used without such a base, its VCC should instead be connected directly to the Arduino's 3.3 V pin, as shown in the wiring setup.

The Arduino uses 5 V logic while the nRF24L01+ operates at 3.3 V. Although the 5 V SPI signals do not necessarily cause immediate failure of the module, exposing the module to these voltage levels can affect its long-term reliability. A voltage level shifter is therefore recommended for industrial or long-term applications. For simplicity, a level shifter is not included in this project.

I2C LCD Connections

The I2C LCD requires only four connections to the Arduino: VCC, GND, SCL, and SDA.

Connect the VCC and GND pins of the I2C LCD to the corresponding VCC and GND pins of the Arduino. The SCL and SDA pins connect to the Arduino's SCL and SDA pins.

On the Arduino Uno, these correspond to the A5 and A4 analog pins respectively. The SCL and SDA header pins are also connected internally to A5 and A4.

One important detail is the I2C address of the LCD. Make sure the A0, A1, and A2 address jumpers are not shorted. In this project, the code uses the I2C address 0x27, which is obtained when these address jumpers are left open.

Responder Wiring

The responder uses the same nRF24L01+ to Arduino connections as the initiator. Since there is no I2C LCD on this Arduino, the responder has fewer connections.

The nRF24L01+ is connected through the same SPI pins, with CE connected to Arduino pin 9, CSN to pin 10, SCK to pin 13, MOSI to pin 11, and MISO to pin 12. VCC is connected to 3.3 V and GND to Arduino GND, while IRQ remains unconnected.

The responder can then receive the wireless message from the initiator and send its response through the serial interface.

Moving from Two Devices to Multiple Transmitters

Once the basic two-way communication is working, the same nRF24L01+ platform can be extended to a setup where several transmitter nodes communicate with a single receiver.

This is where the Multiceiver feature becomes useful. Instead of having one dedicated transmitter and one receiver, multiple nRF24L01+ transmitters can send information to a central receiver using separate data-pipe addresses on the same RF channel.

If you want to build this configuration, the complete wiring, transmitter and receiver code, and the implementation details are covered in the Play with Circuit project:

Communication between Multiple nRF24L01+ Transmitters to a Single Receiver

The multiple-transmitter setup is a useful next step when moving from a simple point-to-point wireless link toward a small distributed Arduino network.

Top comments (0)