Arduino nRF24L01 Wireless Receiver: Wiring, Code and Simulator

To build this Arduino nRF24L01 Wireless Receiver project you need an Arduino Uno and a radio nRF24L01, a green LED and a 220 Ω resistor. The RF24 library listens on channel 76 for address "00001", prints every message and blinks the LED on pin 4. Make the 10 connections in the wiring table, upload the Arduino C++ code, and run the transmitter in another tab. Change the address on one side only and see why both must match.

Open this circuit in the free Arduino Uno simulator

Parts list

QtyPartWhat it does
1Arduino Unothe microcontroller board
1Radio nRF24L012.4 GHz transceiver on SPI: VCC to 3.3 V (not 5 V), CE and CSN to any pins, SCK/MOSI/MISO to the board’s SPI pins; IRQ optional. Works with the RF24 library and MicroPython’s nrf24l01 driver. It talks to nRF24 radios in your other circuits: open the receiver in a second tab. Channel, data rate, address and payload size must match.
1green LEDLights when A (anode, the bent leg) is high and C (cathode) is low. Use a resistor.
1220 Ω resistorLimits current. 220 Ω in series with an LED; 10 kΩ as a pull-up or pull-down.

Wiring

#FromTo
1Arduino Uno 3.3VRadio nRF24L01 VCC
2Arduino Uno GNDRadio nRF24L01 GND
3Arduino Uno pin 9Radio nRF24L01 CE
4Arduino Uno pin 10Radio nRF24L01 CSN
5Arduino Uno pin 13Radio nRF24L01 SCK
6Arduino Uno pin 11Radio nRF24L01 MOSI
7Arduino Uno pin 12Radio nRF24L01 MISO
8Arduino Uno pin 4green LED anode (A, long leg)
9green LED cathode (C, short leg)220 Ω resistor leg 1
10Arduino Uno GND220 Ω resistor leg 2

Step by step

  1. Open the simulator. Open the BitForBytes Embedded Lab in your browser and start from the Arduino Uno. No install or account is needed.
  2. Add the parts. Add a radio nRF24L01, a green LED and a 220 Ω resistor from the parts palette.
  3. Wire 1. Connect Arduino Uno 3.3V to Radio nRF24L01 VCC.
  4. Wire 2. Connect Arduino Uno GND to Radio nRF24L01 GND.
  5. Wire 3. Connect Arduino Uno pin 9 to Radio nRF24L01 CE.
  6. Wire 4. Connect Arduino Uno pin 10 to Radio nRF24L01 CSN.
  7. Wire 5. Connect Arduino Uno pin 13 to Radio nRF24L01 SCK.
  8. Wire 6. Connect Arduino Uno pin 11 to Radio nRF24L01 MOSI.
  9. Wire 7. Connect Arduino Uno pin 12 to Radio nRF24L01 MISO.
  10. Wire 8. Connect Arduino Uno pin 4 to green LED anode (A, long leg).
  11. Wire 9. Connect green LED cathode (C, short leg) to 220 Ω resistor leg 1.
  12. Wire 10. Connect Arduino Uno GND to 220 Ω resistor leg 2.
  13. Paste the Arduino C++ code. Paste the Arduino C++ code below into the code editor.
  14. Run it. Press Run. Run the transmitter in another tab. Change the address on one side only and see why both must match.

Arduino C++ code

// nRF24L01 receiver: prints every message and blinks the LED on pin 4.
// Open "nRF24L01 transmitter" in a second tab to send to it.
// Wiring: VCC 3.3V, GND, CE 9, CSN 10, SCK 13, MOSI 11, MISO 12.
#include <SPI.h>
#include <RF24.h>

RF24 radio(9, 10);                 // CE, CSN
const byte address[6] = "00001";

void setup() {
  Serial.begin(9600);
  pinMode(4, OUTPUT);
  if (!radio.begin()) {
    Serial.println("nRF24 is not answering: check VCC (3.3 V) and the SPI wires.");
    while (true) {}
  }
  radio.openReadingPipe(0, address);
  radio.setPALevel(RF24_PA_LOW);
  radio.startListening();          // this radio only listens
  Serial.println("Receiver listening on channel 76.");
}

void loop() {
  if (radio.available()) {
    char text[32] = "";
    radio.read(&text, sizeof(text));
    Serial.print("Received: ");
    Serial.println(text);
    digitalWrite(4, !digitalRead(4));
  }
}

What to try

Run the transmitter in another tab. Change the address on one side only and see why both must match.

Frequently asked questions

How do I wire the nRF24L01 Wireless Receiver project on an Arduino Uno?

Make 10 connections: Arduino Uno 3.3V to Radio nRF24L01 VCC; Arduino Uno GND to Radio nRF24L01 GND; Arduino Uno pin 9 to Radio nRF24L01 CE; Arduino Uno pin 10 to Radio nRF24L01 CSN; Arduino Uno pin 13 to Radio nRF24L01 SCK; Arduino Uno pin 11 to Radio nRF24L01 MOSI; Arduino Uno pin 12 to Radio nRF24L01 MISO; Arduino Uno pin 4 to green LED anode (A, long leg); green LED cathode (C, short leg) to 220 Ω resistor leg 1; Arduino Uno GND to 220 Ω resistor leg 2.

What parts do I need for this Arduino project?

An Arduino Uno and a radio nRF24L01, a green LED and a 220 Ω resistor.

Can I simulate this Arduino project online for free?

Yes. The BitForBytes Embedded Lab runs this exact circuit and Arduino C++ code in your browser for free, with no install and no hardware. The sketch is compiled with the real Arduino toolchain and runs on an emulated ATmega328P.

What does the code do?

The RF24 library listens on channel 76 for address "00001", prints every message and blinks the LED on pin 4.

More Arduino Uno projects