Skip to content

4.3_5.0_7.0inch_Lesson06_nRF24L01_Communication

1. Course Introduction

This lesson uses two CrowPanel Advance large-size development boards and two nRF24L01 wireless modules to implement two-device communication: one board acts as the transmitter, periodically sending fixed text, and the other acts as the receiver, displaying the received content on both the serial monitor and the screen.

2. Learning Objectives

  • Be able to correctly configure the address, channel, and data rate for both the transmitter and the receiver.
  • Be able to understand the difference between openWritingPipe() and openReadingPipe().
  • Be able to determine whether the wireless link is working properly based on the serial log and the on-screen display.

3. Preparation

  • Two CrowPanel Advance 4.3inch / 5.0inch / 7.0inch large-size development boards.
  • Two nRF24L01 wireless modules.
  • Two Type-C USB data cables that support data transfer.
  • Arduino IDE, along with the project-required libraries such as RF24, nRF24L01, and LovyanGFX.
  • Transmitter project: RF24_WRITE_4_3_5_0_7_0.ino.
  • Receiver project: RF24_READ_4_3_5_0_7_0.ino.

Note: The nRF24L01 falls under wireless module experiments. The function DIP switch on the large-size board must be set to 01, which corresponds to WM (wireless module). The three function mappings are: 00 = MIC&SPK, 01 = WM (wireless module), 11 = MIC&TF Card.

Code and Resource Download

Code download: - Transmitter Code Download - Receiver Code Download

4. Software Operation Steps

4.1 Flashing the Transmitter

  1. Open the transmitter project RF24_WRITE_4_3_5_0_7_0.ino using Arduino IDE. Use one CrowPanel Advance 7.0inch development board as the transmitter. image-20260731182055268

  2. As required by the project, insert the nRF24L01 module into the W-M wireless module slot on the CrowPanel Advance development board—one as the transmitter and one as the receiver—and connect the boards to the computer using USB cables that support data transfer. (In this lesson, one CrowPanel Advance 5.0 inch development board is used as the receiver and one CrowPanel Advance 7.0 inch development board is used as the transmitter.)

image-20260731182600172

  1. Configure Arduino IDE with the following common settings:

  2. Board: ESP32S3 Dev Module

  3. Port: Select the serial port corresponding to the current board

  4. Flash Size: 16MB (128Mb)

  5. PSRAM: OPI PSRAM

  6. Partition Scheme: Huge APP (3MB No OTA/1MB SPIFFS)

    image-20260729151754125

  7. Click Upload to flash the transmitter program onto the first board.

image-20260731182645104

image-20260731183242509

4.2 Opening the Receiver Project

  1. For the other board used as the receiver, use a CrowPanel Advance 5.0 inch development board, connect the second 5.0 inch board to the computer, and keep the same ESP32-S3 configuration as the transmitter.

  2. Click Upload to compile and upload the receiver program. Open the receiver project RF24_READ_4_3_5_0_7_0.ino using Arduino IDE.

image-20260731183254904

image-20260731183402284

image-20260731183809630

Note: If a port error or connection failure occurs during flashing, first power off the board and remove the wireless module to complete the upload; after confirming that the program has been flashed successfully, reinsert the wireless module and power the board back on.

4.3 Opening the Serial Monitor

  1. Open the two serial monitors separately and set the baud rate to 115200. Observe whether SENDING... or received content is being output.

image-20260731183927860

  1. Observe whether the transmitter periodically outputs its sending status, and whether the receiver receives the text and displays it on the LCD. 4.3_5.0_7.0_Arduino-06_10

5. Hardware Operation Steps

  1. After powering off both development boards, set the function DIP switch on each to 01, then insert the respective nRF24L01 module into the W-M wireless module slot.

4.3_5.0_7.0_Arduino-06_02

  1. The nRF24L01 must be powered at 3.3V; never connect it directly to 5V. If using external wiring, make sure the connections are consistent on both ends: CE = GPIO20, CSN = GPIO19, SCLK = GPIO5, MISO = GPIO4, MOSI = GPIO6.

  2. After confirming that both modules and antennas are properly installed, power on each of the two boards separately. For the initial verification, keep the two modules at a close distance and avoid metal obstructions and strong sources of interference.

  3. Observe the sending status on the transmitter's screen, as well as the received text appearing on the receiver's screen and serial monitor.

image-20260731183927860

Note: When the function DIP switch is not set to 01, the wireless module cannot communicate properly; even if the USB serial port and screen work normally, the wireless module may fail to initialize or receive no data.

6. Key Code Explanation

6.1 Transmitter Core Configuration

radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MAX);
radio.setDataRate(RF24_250KBPS);
radio.setChannel(50);
radio.stopListening();

This code is used to initialize the transmitter. openWritingPipe() sets the destination address; setDataRate() and setChannel() must match those of the receiver; stopListening() puts the module into transmit mode.

6.2 Receiver Core Configuration

radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MAX);
radio.setDataRate(RF24_250KBPS);
radio.setChannel(50);
radio.startListening();

This code is used to initialize the receiver. If even one of the address, channel, or data rate differs, the transmitter may work normally while the receiver fails to receive any data.

6.3 Data Transmission and Reception

radio.write(&text, sizeof(text));
if (radio.available()) {
  radio.read(&text, sizeof(text));
}

The transmitter sends a string via radio.write(); the receiver checks for incoming data using radio.available() and then retrieves the content with radio.read(). The large-size project also draws the current status in the central area of the 800 x 480 LCD.

7. Experimental Results

After flashing is complete and the wireless modules are properly inserted, the transmitter's serial port will continuously output SENDING..., and the receiver's serial port and screen will display the received string content.

4.3_5.0_7.0_Arduino-06_10

8. Code Download