NRF24L01+PA+LNA project help

Beginning

Hello,
I have bought one of the NRFs without the breakout boards and those had PCB antenna.

After not finding results i got another pair or NRFs with antenna but without the breakout boards.

After using almost 2 pairs of NRFs i couldn't get any of them to work. So i decided to buy a pair of NRFs with antennas that came with breakout boards.

The Project; The Car:

I had a 4WD car project but i decded to ditch the project and make a new one.

Components on the car:
  • NRF24L01+PA+LNA w/ breakout board (couldn't test, will test later)
  • 2 HCSR04 sensors (one on back and front)
  • ESP32-CAM (powered by a L7805CV, working. It's for video feed ONLY)
  • L298N (bought a new one because the one i had broke)
  • 2 reduction gear motors
  • Castor wheel (on the back and it helps to balance)
  • 2 18650 Li-ion batteries totaling at 7.4V
  • Arduino Uno Clone (to move the car and do other stuff)

The Main Problem:

I don't know how many volts i have to suply some say 5V, others say 3.3V.
I got stuck between 5V and 3.3V. It looks like it has a voltage regulator.
And i don't know if it works or not, i couldn't test it yet but i'll test it later.
I got basically most of them done.

The steps of the car project:

  • Make the base and assemble motors and caster wheels : DONE
  • Assemble everything : DONE
  • Connect everything : HALF DONE (only connected power.)
  • Make the code: NOT DONE
  • Make it bluetooth, wifi and NRF compatible (optional): DONE, ONLY NRF AND WIFI

Conclusion:

I'd like to ask you guys for tips and reccomendations , example code for testing my NRF module and lastly for a schematic on how to connect the NRF(the breakout board pins to Arduino).

Thanks in advance for your help, schematics and tips.

@the_com3_port

in your component list I can see a ESP32-CAM bt what other host microcontrollers are you using?
I have this working on an ESP32

// esp32 > NRF24L01 transmitter test using a text string

// RP2040 connections
// RP2040 SPIO_SCK pin GP18 goes to NRF24L10_pin SCK
// RP2040 SPIO_RX pin GP16 goes to NRF24L10_pin MISO
// RP2040 SPIO_TX pin GP19 goes to NRF24L10_pin MOSI
// RP2040 pin SPIO_CSn GP17 to NRF24L10 CSN
// RP2040 pin GP20 to NRF24L10 CE
// RP2040 GND and 3.3V to NRF24L10  GND and VCC

// Leonardo connections ???
// Leonardo ICSP SCK  pin 15 to NRF24L10_pin SCK
// Leonardo ICSP MISO pin 14 to NRF24L10_pin MISO
// Leonardo ICSP MOSI pin 16 to NRF24L10_pin MOSI
// Leonardo pin 10 to NRF24L10 CSN
// Leonardo pin 9  to NRF24L10 CE
// Leonardo GND and 3.3V to NRF24L10  GND and VCC

// ESP8266 connections
// ESP8266 SCK pin GPIO14 goes to NRF24L10_pin SCK
// ESP8266 MISO pin GPIO12 goes to NRF24L10_pin MI
// ESP8266 MOSI pin GPIO13 goes to NRF24L10_pin MO
// NRF24L10 CE to ESP8266 pin GPIO4
// NRF24L10 CSN to ESP8266 pin GPIO5

// UNO/Nano connections
// arduino MOSI pin 11 goes to NRF24L10_pin MOSI
// arduino MISO pin 12 goes to NRF24L10_pin MI
// arduino SCK  pin 13 goes to NRF24L10_pin SCK
// NRF24L10 CE to arduino pin 9
// NRF24L10 CSN to arduino pin10
// NRF24L10 VCC to 3.3V and GND to GND

// for ESP32-CAM
//#define SCK  14
//#define MISO  12
//#define MOSI  13
//#define CS  15   

// ESP32 connections
// ESP32 SCK pin GPIO18 goes to NRF24L10_pin SCK
// ESP32 MISO pin GPIO19 goes to NRF24L10_pin MI
// ESP32 MOSI pin GPIO23 goes to NRF24L10_pin MO
// NRF24L10 CE to ESP32 pin GPIO4
// NRF24L10 CSN to ESP32 pin GPIO 5
// NRF24L10  VCC to 3.3V

#include <SPI.h>
#include "RF24.h"

#define CE_PIN 4
#define CSN_PIN 5

bool radioNumber = 0;
RF24 radio(CE_PIN, CSN_PIN);

byte addresses[][6] = { "1Node", "2Node" };

void setup() {
  Serial.begin(115200);
  delay(2000);
  Serial.println("\n\nESP32> NRF24L01 transmit text");
  radio.begin();
  if (radio.isChipConnected())
    Serial.println("Transmitter NF24 connected to SPI");
  else {
    Serial.println("NF24 is NOT connected to SPI");
    while (1)
      ;
  }
  radio.setChannel(125);
  radio.setPALevel(RF24_PA_MIN);
  radio.powerUp();
  radio.setDataRate(RF24_1MBPS);
  //radio.setDataRate(RF24_250KBPS);
  if (radioNumber) {
    radio.openWritingPipe(addresses[1]);
    radio.openReadingPipe(1, addresses[0]);
  } else {
    radio.openWritingPipe(addresses[0]);
    radio.openReadingPipe(1, addresses[1]);
  }
  radio.stopListening();
  //radio.setPayloadSize(sizeof(Struct1));
}

// loop transmiting data packet
void loop() {
  static char testString[10] = "text 0";
  radio.write(testString, sizeof(testString));
  Serial.print("transmit ");
  Serial.println(testString);
  delay(1000);
  testString[5]++;
}

some results

Nano > NRF24L01 transmit text
Transmitter NF24 connected to SPI
transmit text 0
transmit text 1
transmit text 2
transmit text 3
transmit text 4
transmit text 5
transmit text 6
transmit text 7
transmit text 8
transmit text 9
transmit text :
transmit text ;
transmit text <
transmit text =
transmit text >
transmit text ?
transmit text @
transmit text A

ESP32_S3 > NRF24L01 Receive text
Receiver NF24 connected to SPI
SPI Speedz	= 10 Mhz
STATUS		= 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1	= 0xe7e7e7e7e7 0xc2c2c2c2c2
RX_ADDR_P2-5	= 0xc3 0xc4 0xc5 0xc6
TX_ADDR		= 0xe7e7e7e7e7
RX_PW_P0-6	= 0x20 0x20 0x20 0x20 0x20 0x20
EN_AA		= 0x3f
EN_RXADDR	= 0x03
RF_CH		= 0x7d
RF_SETUP	= 0x07
CONFIG		= 0x0e
DYNPD/FEATURE	= 0x00 0x00
Data Rate	= 1 MBPS
Model		= nRF24L01+
CRC Length	= 16 bits
PA Power	= PA_MAX
ARC		= 0
Test string:      text =
Test string:      text >
Test string:      text ?
Test string:      text @
Test string:      text A
Test string:      text B
Test string:      text C
Test string:      text D
Test string:      text E
Test string:      text F
Test string:      text G
Test string:      text H
Test string:      text I
Test string:      text J
Test string:      text K
Test string:      text L

VCC should be 3.3V - you could require an external power supply

have a look at NRF24 COMMON_ISSUES

and nrf24l01s-not-communicating-properly

I only use ESP-CAM for video
I use Arduino UNO for the main stuff.

if you use

radio.begin();
  if (radio.isChipConnected())
    Serial.println("Transmitter NF24 connected to SPI");
  else {
    Serial.println("NF24 is NOT connected to SPI");
    while (1)
      ;
  }

does the serial monitor indicate that the NRF24 is connected to the SPI OK?

Do i use 3.3v? I'm scared to break it

yes - the NRF24 has 5V tolerant inputs so you can connect it to a UNO OK

Okay, can you give the full code?

post 2 gave an example of ESP32 code
this is for a Nano so should work on a UNO

//  Nano > NRF24L01 receiver test using a text string

// UNO/Nano connections
// arduino MOSI pin 11 goes to NRF24L10_pin MOSI
// arduino MISO pin 12 goes to NRF24L10_pin MI
// arduino SCK  pin 13 goes to NRF24L10_pin SCK
// NRF24L10 CE to arduino pin 9
// NRF24L10 CSN to arduino pin10
// NRF24L10 VCC to 3.3V and GND to GND

#include <SPI.h>
#include <RF24.h>
#include <printf.h>

#define CE_PIN 9
#define CSN_PIN 10

bool radioNumber = 1;
const uint8_t pipes[][6] = { "1Node", "2Node" };

RF24 radio(CE_PIN, CSN_PIN);

char dataReceived[10];  // this must match dataToSend in the TX
bool newData = false;

//===========

void setup() {
  Serial.begin(115200);
  delay(1000);
  Serial.println("Nano > NRF24L01 Receive text");
  radio.begin();
  if (radio.isChipConnected())
    Serial.println("Receiver NF24 connected to SPI");
  else {
    Serial.println("NF24 is NOT connected to SPI");
    while (1)
      ;
  }
  radio.setChannel(125);
  radio.setDataRate(RF24_1MBPS);
  //radio.setDataRate(RF24_250KBPS);
   printf_begin();             // needed only once for printing details
   radio.printDetails();       // (smaller) function that prints raw register values
   radio.printPrettyDetails(); // (larger) function that prints human readable data
  if (!radioNumber) {
    radio.openWritingPipe(pipes[0]);
    radio.openReadingPipe(1, pipes[1]);
  } else {
    radio.openWritingPipe(pipes[1]);
    radio.openReadingPipe(1, pipes[0]);
  }
  radio.startListening();
  // radio.setPayloadSize(sizeof(Struct1));
}

//=============

void loop() {
  if (radio.available()) {
    char testString[10] = "";
    radio.read(testString, sizeof(testString));
    Serial.print("Test string:      ");
    Serial.println(testString);
  }
}

I think this is reciever code can you also give the transmitter code?

post 2 gave example of transmitter code - you need to change the CE and CSN pins to suit your target board

Power Stability Issues with RF24 Radio Modules

As described in the RF24 Common Issues Guide, radio modules, especially the PA+LNA versions, are highly reliant on a stable power source. The 3.3V output from Arduino is not stable enough for these modules in many applications. While they may work with an inadequate power supply, you may experience lost packets or reduced reception compared to modules powered by a more stable source.

Symptoms of Power Issues:

  • Radio module performance may improve when touched, indicating power stability issues.
  • These issues are often caused by the absence of a capacitor, a common cost-saving omission by some manufacturers.

Temporary Patch :

  • Add Capacitors: Place capacitors close to the VCC and GND pins of the radio module. A 10uF capacitor is usually sufficient, but the exact value can depend on your circuit layout.
  • Use Low ESR Capacitors: Capacitors with low Equivalent Series Resistance (ESR) are recommended, as they provide better power stability and performance.

Adding the appropriate capacitors can greatly improve the reliability of your RF24 module by ensuring a stable power supply, thus minimizing packet loss and enhancing overall performance. A separate power supply for the radios is the best solution.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.