ESP32-C6 nRF24L01 Receiver: Wiring, Code and Simulator
To build this ESP32-C6 nRF24L01 Receiver project you need an ESP32-C6 DevKitC-1 and a radio nRF24L01. MicroPython’s nrf24l01 driver on the C6’s hardware SPI hears the Arduino RF24 transmitter in your other tab, and flashes the RGB LED per message. Make the 7 connections in the wiring table, upload the MicroPython code, and run the Arduino transmitter in another tab. Connect the logic analyzer to IO6, IO7, IO2 and IO10 to see the SPI traffic.
Open this circuit in the free ESP32-C6 DevKitC-1 simulator
Parts list
| Qty | Part | What it does |
|---|---|---|
| 1 | ESP32-C6 DevKitC-1 | the microcontroller board |
| 1 | Radio nRF24L01 | 2.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. |
Wiring
| # | From | To |
|---|---|---|
| 1 | ESP32-C6 DevKitC-1 3V3 | Radio nRF24L01 VCC |
| 2 | ESP32-C6 DevKitC-1 GND | Radio nRF24L01 GND |
| 3 | ESP32-C6 DevKitC-1 IO6 | Radio nRF24L01 SCK |
| 4 | ESP32-C6 DevKitC-1 IO7 | Radio nRF24L01 MOSI |
| 5 | ESP32-C6 DevKitC-1 IO2 | Radio nRF24L01 MISO |
| 6 | ESP32-C6 DevKitC-1 IO10 | Radio nRF24L01 CSN |
| 7 | ESP32-C6 DevKitC-1 IO11 | Radio nRF24L01 CE |
Step by step
- Open the simulator. Open the BitForBytes Embedded Lab in your browser and start from the ESP32-C6 DevKitC-1. No install or account is needed.
- Add the parts. Add a radio nRF24L01 from the parts palette.
- Wire 1. Connect ESP32-C6 DevKitC-1 3V3 to Radio nRF24L01 VCC.
- Wire 2. Connect ESP32-C6 DevKitC-1 GND to Radio nRF24L01 GND.
- Wire 3. Connect ESP32-C6 DevKitC-1 IO6 to Radio nRF24L01 SCK.
- Wire 4. Connect ESP32-C6 DevKitC-1 IO7 to Radio nRF24L01 MOSI.
- Wire 5. Connect ESP32-C6 DevKitC-1 IO2 to Radio nRF24L01 MISO.
- Wire 6. Connect ESP32-C6 DevKitC-1 IO10 to Radio nRF24L01 CSN.
- Wire 7. Connect ESP32-C6 DevKitC-1 IO11 to Radio nRF24L01 CE.
- Paste the MicroPython code. Paste the MicroPython code below into the code editor.
- Run it. Press Run. Run the Arduino transmitter in another tab. Connect the logic analyzer to IO6, IO7, IO2 and IO10 to see the SPI traffic.
MicroPython code
# ESP32-C6: nRF24L01 receiver (MicroPython's nrf24l01 driver, hardware SPI).
# Hears the Arduino "nRF24L01 transmitter" example: open it in a second tab.
# Wiring: VCC 3V3, GND, SCK IO6, MOSI IO7, MISO IO2, CSN IO10, CE IO11.
from machine import Pin, SPI
from nrf24l01 import NRF24L01, POWER_1, SPEED_1M
import neopixel, time
spi = SPI(1, sck=Pin(6), mosi=Pin(7), miso=Pin(2))
csn = Pin(10, mode=Pin.OUT, value=1)
ce = Pin(11, mode=Pin.OUT, value=0)
rgb = neopixel.NeoPixel(Pin(8), 1)
# The RF24 library's defaults on the Arduino: channel 76, 1 Mbit/s, 32-byte payloads, address "00001".
nrf = NRF24L01(spi, csn, ce, channel=76, payload_size=32)
nrf.set_power_speed(POWER_1, SPEED_1M)
nrf.open_tx_pipe(b"00002")
nrf.open_rx_pipe(0, b"00001")
nrf.start_listening()
print("ESP32-C6 listening on channel 76...")
n = 0
while True:
if nrf.any():
text = nrf.recv().split(b"\x00")[0].decode()
print("Received:", text)
n += 1
rgb[0] = (0, 30, 0) if n % 2 else (0, 0, 30)
rgb.write()
time.sleep_ms(5)
What to try
Run the Arduino transmitter in another tab. Connect the logic analyzer to IO6, IO7, IO2 and IO10 to see the SPI traffic.
Frequently asked questions
How do I wire the nRF24L01 Receiver project on an ESP32-C6 DevKitC-1?
Make 7 connections: ESP32-C6 DevKitC-1 3V3 to Radio nRF24L01 VCC; ESP32-C6 DevKitC-1 GND to Radio nRF24L01 GND; ESP32-C6 DevKitC-1 IO6 to Radio nRF24L01 SCK; ESP32-C6 DevKitC-1 IO7 to Radio nRF24L01 MOSI; ESP32-C6 DevKitC-1 IO2 to Radio nRF24L01 MISO; ESP32-C6 DevKitC-1 IO10 to Radio nRF24L01 CSN; ESP32-C6 DevKitC-1 IO11 to Radio nRF24L01 CE.
What parts do I need for this ESP32-C6 project?
An ESP32-C6 DevKitC-1 and a radio nRF24L01.
Can I simulate this ESP32-C6 project online for free?
Yes. The BitForBytes Embedded Lab runs this exact circuit and MicroPython code in your browser for free, with no install and no hardware. The ESP32-C6 is emulated instruction by instruction on its RISC-V core, running its own ROM and the official MicroPython firmware.
What does the code do?
MicroPython’s nrf24l01 driver on the C6’s hardware SPI hears the Arduino RF24 transmitter in your other tab, and flashes the RGB LED per message.
More ESP32-C6 DevKitC-1 projects
- ESP32-C6 RGB LED, Blink and Button Interrupt: Wiring, Code and Simulator
- ESP32-C6 ADC Knob Dims an LED (PWM): Wiring, Code and Simulator
- ESP32-C6 I2C LCD: Wiring, Code and Simulator
- ESP32-C6 Wi-Fi Weather on an LCD: Wiring, Code and Simulator
- ESP32-C6 SPI MAX7219 LED Matrix: Wiring, Code and Simulator
- ESP32-C6 HC-05 Bluetooth LED Control: Wiring, Code and Simulator