Reference
NRF24L01
2.4GHz wireless transceiver.
- Connects over
- SPI
- Made by
- Nordic Semiconductor
- Datasheet
- infocenter.nordicsemi.com
Use it
hardware {
device nrf24l01: NRF24L01(cs: 16, ce: 17)
}
every 1s {
let value: int = nrf24l01.available()
log("nrf24l01", "available={value}")
}
The NRF24L01 goes on the SPI bus; give it its cs and ce pins as arguments.
Methods
-
nrf24l01.send(data: string) -> int
Send data, returns 1 on success
-
nrf24l01.available() -> int
1 if data waiting
Wiring
| Pin | Connect to |
|---|---|
VCC | 3.3V or 5V |
GND | Ground |
SCK | SPI clock |
MOSI | Master Out / Slave In |
MISO | Master In / Slave Out |
CS | Chip select (active low) |
CE | Chip enable — separate from CS |
IRQ | Optional interrupt |
Specifications
- Voltage
- 1.9V – 3.6V (NOT 5V tolerant)
- Current
- 11.3 mA TX at 0 dBm, 13.5 mA RX
- Frequency
- 2.4 GHz ISM
- Range
- Up to ~100 m line of sight (with PA/LNA variants up to 1 km)
- Data rate
- 250 kbps, 1 Mbps, or 2 Mbps
Tips
- POWER is the #1 cause of failure — add a 10 μF cap across VCC/GND at the module pins.
- Many 'nRF24L01' modules from cheap sources are clones with worse range and reliability.
- Use the same channel + address on both ends; pipe 0 is the default acknowledge pipe.
Alternatives worth knowing:
- ESP-NOW: If you're already on ESP32 — built-in Wi-Fi-radio peer protocol, no extra hardware.
- LoRa (SX127x): Sub-GHz, much longer range, lower data rate.