๐ก NRF24L01 Wireless Data Link
Create a cable-free 2-way data bridge using 2.4 GHz radio transceivers.
Overview
The NRF24L01 is a 2.4 GHz ISM band transceiver capable of transmitting data at up to 2 Mbps over distances up to 100m (or 1km with the PA+LNA version). This project builds a symmetric 2-way link between two Arduino boards.
What you'll learn: SPI bus communication, NRF24L01 pipe addressing, half-duplex transmit/receive switching, packet structuring, and signal strength (RSSI) reporting.
Estimated time: 1.5โ2.5 hours. Difficulty: โญโญโญ Intermediate.
Components Needed
| Component | Specification | Qty | Notes |
|---|---|---|---|
| Arduino Uno R3 | 5V Logic | 2 | One TX, one RX (or both) |
| NRF24L01 Module | 2.4 GHz, SPI | 2 | Standard or PA+LNA version |
| 100ยตF Capacitor | 10V rated | 2 | Decoupling โ critical! |
| Breadboard & Wires | Male-to-Male | 2 sets | One per Arduino |
Step-by-Step Tutorial
1
Wiring (both Arduinos)
NRF24 CE โ Pin 9, CSN โ Pin 10, SCK โ Pin 13, MOSI โ Pin 11, MISO โ Pin 12, VCC โ 3.3V, GND โ GND. Place a 100ยตF cap between VCC and GND close to the module.
2
Install RF24 Library
Install the
RF24 library by TMRh20 from the Arduino Library Manager.3
Upload Transmitter Code
On Arduino 1, upload the transmitter sketch. It sends a struct containing sensor readings every 250ms.
4
Upload Receiver Code
On Arduino 2, upload the receiver sketch. It listens on the same pipe address and prints received data to Serial Monitor.
5
Test 2-Way Communication
Both units can switch between TX/RX. Press a button to send a command from the receiver back to the transmitter to demonstrate bidirectional links.
The NRF24L01 is the most power-supply-sensitive module in electronics. It requires a very clean 3.3V with a 100ยตF bulk capacitor. Without it, you will get random disconnects and missed packets. Never skip this capacitor.
Code / Configuration
nrf24_data_link.ino
INO
// NRF24L01 Wireless Link - Volt X
// Upload to BOTH Arduinos. Unit A uses pipe "00001", Unit B uses "00002"
#include <SPI.h>
#include <RF24.h>
RF24 radio(9, 10); // CE, CSN
// Pipe addresses โ change for each unit
const byte txAddress[6] = "00001"; // This unit sends on pipe 1
const byte rxAddress[6] = "00002"; // This unit receives on pipe 2
struct Packet {
float temperature;
int buttonState;
unsigned long timestamp;
};
Packet txData, rxData;
void setup() {
Serial.begin(9600);
radio.begin();
radio.setPALevel(RF24_PA_LOW); // Use RF24_PA_HIGH for longer range
radio.setDataRate(RF24_250KBPS); // Longer range, slower speed
radio.setChannel(108); // Channel above WiFi interferenceReviews & Ratings
โ0 reviews
Sign in to leave a review
Loading reviews...