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
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.
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
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?
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.