My NRF24L01 doesn't works

I'm working on a personal project to build a head tracking camera with an Arduino. So far I've succeeded with the wired version, which uses an MPU6050 and two servos connected to a single uno board to track movement, but I'm struggling with sending data wirelessly to the NRF24L01 using an Arduino nano and uno. I have also soldered a 100uF capacitor to the NRF24L01 and after changing the NRF24L01 itself, I am getting the same symptoms. I have connected an MPU6050 and NRF24L01 to the nano board, and 2 servos and NRF24L01 to the uno board. I am currently testing with code that sends a simple message, but I keep getting a "SEND FAILED" message on the transmit side.

Any help or advice would be greatly appreciated.

both nano and uno NRF24L01 are connected like this:
CE-> D8
CSN-> D7
SCK-> D13
MOSI-> D11
MISO-> D12
VCC-> 5V
GND-> GND
I'm using adapter with NRF24L01

transmitter code:

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

RF24 radio(8, 7);  // CE, CSN
const byte address[6] = "00001";

void setup() {
  Serial.begin(9600);
  delay(500);

  if (!radio.begin()) {
    Serial.println("Radio hardware not responding!");
    while (1);
  }

  radio.setAutoAck(true);
  radio.setPALevel(RF24_PA_LOW);
  radio.setDataRate(RF24_1MBPS);
  radio.setChannel(100);
  radio.openWritingPipe(address);
  radio.stopListening();

  /*Serial.println("==== NANO TRANSMITTER ====");*/
  radio.printDetails();
}

void loop() {
  const char text[] = "Hello!";
  bool result = radio.write(&text, sizeof(text));

  if (result)
    Serial.println("Sent!");
  else
    Serial.println("Send failed");

  delay(1000);
}

receiver code:

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

RF24 radio(8, 7);  // CE, CSN
const byte address[6] = "00001";  

void setup() {
  Serial.begin(9600);
  delay(500);  

  if (!radio.begin()) {
    Serial.println("Radio hardware not responding!");
    while (1);
  }

  radio.setAutoAck(true);
  radio.enableAckPayload();  
  radio.setPALevel(RF24_PA_LOW);
  radio.setDataRate(RF24_1MBPS);
  radio.setChannel(100);
  radio.openReadingPipe(0, address);  
  radio.startListening();  

  /*Serial.println("==== UNO RECEIVER ====");*/
  radio.printDetails();  
}

void loop() {
  if (radio.available()) {
    char text[32] = {0};  
    radio.read(&text, sizeof(text));
    Serial.print("Received: ");
    Serial.println(text);
  }
}

both nano and uno are connected to my laptop


and 2 servos and NRF24L01 to the uno board.

Remove the servos, and all other unnecessary parts until you get communications to work. Then start adding the extra bits, testing as you go.

Servos MUST be powered separately, and don't forget to connect the grounds.

Put a good distance like 2 or 3 meters between the radios, and/or turn down or off the amplifier so you are not swamping things.

Your test code looks simple enough, is it code you wrote or at least a sketch you found and did not mess with too much?

It sounds like you've addressed the most common other issue, the supply of power. TBH I didn't look too closely at that aspect, so make double X sure.

a7

You could also control the soldering, on image it looks almost like VCC pin got desoldered from module.

Hi! jremington thank you for your advice. I hadn't thought of an external power supply for the servo though. If the wireless communication is successful, I'll take your advice for the next step. I removed all other parts, including servos, and just connected the adapter and NRF24L01. Unfortunately, it still says SEND FAILED on the nano.

Hi kmin! Good point. The soldering went well, but I fed it plenty of lead just to be sure. thank you!

Hi alto777. followed your advice to make some distance, but it doesn't seem to have made a difference.
and yes, I made a code with GPT. maybe I would rather try IDE examples in RF24....

Funny thing is, if I move the NRF24L01 on the adapter around or leave it loose in the socket, it sometimes says 'sent'. I don't think it's actually sent. Because the transmitter just says broken.

It's really killing me, I'm just following the tutorial. I bought an extra NRF24L01 just in case, I'll try to swap them out. Any other advice or help would be really helpful!

OMG, I finally did it, I changed the address and suddenly it works. I'm finally able to move on to the next step, I'll try to update when I get it working. Thanks to everyone who is helping this rookie.

const byte address[6] = "RxAAA";

Nice!!
So if you change it back to:
const byte address[6] = "00001";
it doesn't work?

Yay!

Now carefully save the working sketches and keep them as they are exact. For later when things may not work that you try to do.

Always have them ready to flash so you can check the hardware is working.

Give yourself a merit badge. Getting these little radio sets to function is hard, no one did it without aging a bit… and yes, show chatGPT the door and work from known good code, usually the code with a competent tutorial that also spells out every. Other. Pesky. Little. Detail.

a7

no, it's not work, maybe something's wrong with my address. Also, the communication code seemed to be overloaded, so changing the code itself to a shorter, more minimalist version helped.

I'll keep in mind :slight_smile: