Hi,
I am working on an Arduino project using the NRF24L01+PA+LNA to transmit ultrasonic sensor data from one chip (Nano) to another (Mega 2560) which would be displayed on a LCD screen. The setup worked with a 100 uF capacitor connected to the NRF24L01+PA+LNA chip on the Nano.
Subsequently procured a breakout power adapter as recommended by many to replace the capacitor. Due to the lack of sufficient 5V pins on the Nano, I tried using one of the digital pins (set to OUTPUT HIGH) as the 5V input for the HC-SR04 ultrasonic sensor. The setup worked successfully for a while. However, when I tried to adjust the sensor to various angles, the transmission became intermittent and eventually stopped.
Now, the transmission does not work even for a basic code (simply sending "Hi"). Tried multiple troubleshooting ways but none of them worked:
- Removed ultrasonic sensor
- Checked for loose connections: tried replacing wires
- Changed to a new breakout power adaptor
- Removed adaptor and tried using 100 uF capacitor again
- Replaced Nano with Uno
Now, I am unsure if the NRF24L01+PA+LNA modules are dead and I do not have any spare on hand for now. Tried troubleshooting by measuring the voltage across all the pins on the NRF24L01+PA+LNA modules to their GND pin. Was wondering if values can be compared to a working set to see if the modules are faulty. The basic test code, serial monitor output and voltage data are as below:
Transmitter:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <printf.h>
RF24 radio(7,8);
const byte address[6] = "00002";
void setup() {
Serial.begin(9600);
radio.begin();
//radio.setAutoAck(false);
radio.setChannel(124);
printf_begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.setDataRate(RF24_250KBPS);
radio.stopListening();
radio.printDetails();
bool check = radio.isChipConnected();
Serial.print("Chip Connected?:");
Serial.println(check);
}
void loop() {
const char text[] = "hi";
bool received = radio.write(&text, sizeof(text));
Serial.print(received);
delay(2000);
}
Receiver:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <printf.h>
RF24 radio(7,8);
const byte address[6] = "00002";
void setup() {
Serial.begin(9600);
radio.begin();
radio.setChannel(124);
printf_begin();
radio.openReadingPipe(0,address);
radio.setPALevel(RF24_PA_MIN);
radio.setDataRate(RF24_250KBPS);
radio.startListening();
radio.printDetails();
bool check = radio.isChipConnected();
Serial.print("Chip Connected?:");
Serial.println(check);
pinMode(53,OUTPUT);
}
void loop() {
char text[32] = "";
//float text;
if (radio.available()) {
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
printDetails output from Transmitter:
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x3230303030 0xc2c2c2c2c2
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x3230303030
RX_PW_P0-6 = 0x20 0x00 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x7c
RF_SETUP = 0x21
CONFIG = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MIN
Chip Connected?:1
00000000000000000000000000
printDetails output from Receiver:
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x3230303030 0xc2c2c2c2c2
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xe7e7e7e7e7
RX_PW_P0-6 = 0x20 0x00 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x7c
RF_SETUP = 0x21
CONFIG = 0x0f
DYNPD/FEATURE = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MIN
Chip Connected?:1
For the voltage readings, one NRF24L01+PA+LNA module was connected to a Uno running the transmitting code, another connected to a Mega running the receiving code. After measuring the voltages, the modules were then swapped and measured again. Please refer to the attached image for the measurements.
Kindly advise if there are other ways that I can troubleshoot. Also, if the NRF chips are truly dead, what are the possible reasons that might have caused this (so I won't make the same mistake again)? Thank you!!