Professional Documents
Culture Documents
The nRF24L01+ module is designed to operate in 2.4 GHz worldwide ISM frequency band and
uses GFSK modulation for data transmission. The data transfer rate is configurable and can be one
of 250kbps, 1Mbps and 2Mbps.
The 2.4 GHz band is one of the Industrial, Scientific, and Medical (ISM) bands internationally
reserved for unlicensed low power devices. Devices such as cordless phones, Bluetooth devices,
Near Field Communication (NFC) devices, and wireless computer networks (WiFi) all use ISM
frequencies.
Power
The module’s operating voltage ranges from 1.9 to 3.6V, but the good news is that the logic pins are
5-volt tolerant, so you can use it with your favorite 3.3V or 5V microcontroller without worry.
The module supports programmable output power i.e. 0 dBm, -6 dBm, -12 dBm or -18 dBm. At 0
dBm the module consumes only 12 mA during transmission which is less than the consumption of a
single LED.
And the best part is that it consumes 26 µA in standby mode and 900 nA in power down mode.
That’s why it’s a go-to wireless device for low-power applications.
SPI Interface
The nRF24L01+ communicates over a 4-pin SPI (Serial Peripheral Interface) with a maximum data
rate of 10Mbps.
All parameters such as frequency channel (125 selectable channels), output power (0 dBm, -6 dBm,
-12 dBm or -18 dBm), and data rate (250kbps, 1Mbps, or 2Mbps) can be configured through the
SPI interface.
Technical Specifications
The low-noise amplifier (LNA) of the receive path and the power amplifier (PA) of the transmit
path connect to the antenna through a duplexer, which isolates the two signals and prevents the
relatively powerful PA output from overloading the sensitive LNA input.
RF Channel Frequency
The nRF24L01+ module transmits and receives data on a certain frequency called a channel. For
two or more modules to communicate with each other, they must be on the same channel. This
channel can be any frequency in the 2.4 GHz ISM band, or to be more precise, it can be between
2.400 to 2.525 GHz (2400 to 2525 MHz).
Each channel takes up a bandwidth of less than 1MHz. This gives us 125 possible channels with
1MHz spacing.
This means the nRF24L01+ can use 125 different channels, allowing you to create a network of 125
independently working modems in one place.
The channel takes up a bandwidth of less than 1MHz at 250kbps and 1Mbps air data rate. However
at a 2 Mbps air data rate, 2MHz of bandwidth is required (greater than the resolution of the RF
channel frequency setting). So in 2 Mbps mode you should keep a gap of 2MHz between the two
channels to ensure non-overlapping channels and reduce cross-talk.
In a multiceiver network each RF channel is logically divided into 6 parallel data channels called
data pipes. In other words, the data pipe is one of six logical channels in a single physical RF
channel. Each data pipe has its own unique address called a data pipe address. Only one data pipe
can receive a packet at a time.
A multiceiver network can be depicted as below.
nRF24L01+ Multiceiver Network – Multiple Transmitters Single Receiver
To understand multiserver network imagine that the primary receiver is acting as a hub receiver that
collects information from 6 different transmitter nodes simultaneously. The hub receiver can stop
listening at any time and act as a transmitter.
Enhanced ShockBurst Protocol
The nRF24L01+ uses a packet structure known as Enhanced ShockBurst. This simple packet
structure is divided into 5 different fields as you can see below.
Firstly, it allows variable length payloads with a payload length specifier, meaning that
payloads can vary from 1 to 32 bytes.
Secondly, it assigns a packet ID to each sent packet, which allows the receiving device to
determine whether a message is new or has been retransmitted.
Lastly, and most importantly, each message can request the receiver to send an
acknowledgment after receiving the message.
nRF24L01+ Automatic Packet Handling
Transaction with an acknowledgment:
This is an example of a positive scenario. Here the transmitter initiates the communication by
sending a data packet to the receiver. Once the packet is transmitted, it waits approximately 130 µs
to receive the acknowledgment packet (ACK packet). When the receiver receives the packet it sends
the ACK packet to the transmitter. The transaction ends when the transmitter receives the ACK
packet.
If the transmitter does not receive it within the auto-retransmit-delay (ARD) time it retransmits the
packet. When the receiver receives the retransmitted packet, it transmits the ACK packet thereby
terminating the transaction.
Transaction with a lost acknowledgment:
This is again a negative scenario where retransmission is required due to loss of ACK packets. Here
even though the receiver has received the packet in the first attempt itself, due to the loss of the
ACK packet, the transmitter thinks that the receiver has not received the packet.
So after the Auto-Retransmit-Delay timeout, the transmitter retransmits the packet. Now when the
receiver receives the packet with the same ID as before, it discards it and sends the ACK packet
again. The transaction ends when the transmitter receives the ACK packet.
This entire packet handling is done automatically by the nRF24L01+ chip without the involvement
of the microcontroller.
CE (Chip Enable) is an active-high pin. When selected, the nRF24L01 will either transmit or
receive, depending on which mode it is currently in.
CSN (Chip Select Not) is an active-low pin and is normally kept HIGH. When this pin goes low,
the nRF24L01 starts listening on its SPI port for data and processes it accordingly.
SCK (Serial Clock) accepts clock pulses provided by the SPI bus master.
MOSI (Master Out Slave In) is the SPI input to the nRF24L01.
MISO (Master In Slave Out) is the SPI output from the nRF24L01.
IRQ is an interrupt pin that can alert the master when new data is available to process.
Since the nRF24L01+ module requires a lot of data transfer, it will give the best performance when
connected to the hardware SPI pins on the microcontroller.
Note that each Arduino board has different SPI pins that must be connected accordingly.
Remember you need to make two such circuits. One will act as transmitter and the other as receiver.
Both have the same wiring.
//Include Libraries
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
void setup()
{
radio.begin();
delay(1000);
}
void setup()
{
while (!Serial);
Serial.begin(9600);
radio.begin();
void loop()
{
//Read the data if available in buffer
if (radio.available())
{
char text[32] = {0};
radio.read(&text, sizeof(text));
Serial.println(text);
}
}