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

QtyPartWhat it does
1ESP32-C6 DevKitC-1the 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.

Wiring

#FromTo
1ESP32-C6 DevKitC-1 3V3Radio nRF24L01 VCC
2ESP32-C6 DevKitC-1 GNDRadio nRF24L01 GND
3ESP32-C6 DevKitC-1 IO6Radio nRF24L01 SCK
4ESP32-C6 DevKitC-1 IO7Radio nRF24L01 MOSI
5ESP32-C6 DevKitC-1 IO2Radio nRF24L01 MISO
6ESP32-C6 DevKitC-1 IO10Radio nRF24L01 CSN
7ESP32-C6 DevKitC-1 IO11Radio nRF24L01 CE

Step by step

  1. 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.
  2. Add the parts. Add a radio nRF24L01 from the parts palette.
  3. Wire 1. Connect ESP32-C6 DevKitC-1 3V3 to Radio nRF24L01 VCC.
  4. Wire 2. Connect ESP32-C6 DevKitC-1 GND to Radio nRF24L01 GND.
  5. Wire 3. Connect ESP32-C6 DevKitC-1 IO6 to Radio nRF24L01 SCK.
  6. Wire 4. Connect ESP32-C6 DevKitC-1 IO7 to Radio nRF24L01 MOSI.
  7. Wire 5. Connect ESP32-C6 DevKitC-1 IO2 to Radio nRF24L01 MISO.
  8. Wire 6. Connect ESP32-C6 DevKitC-1 IO10 to Radio nRF24L01 CSN.
  9. Wire 7. Connect ESP32-C6 DevKitC-1 IO11 to Radio nRF24L01 CE.
  10. Paste the MicroPython code. Paste the MicroPython code below into the code editor.
  11. 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