Why is this happening to the nRF24 module?

The sender's serial monitor keeps saying transmission failure, but the receiver's serial monitor is receiving the value normally. As the distance between the sender and the receiver increases, it happens more often, so why is that? What is the solution?
Below is the code I used.

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

#define CE_PIN 9
#define CSN_PIN 53

RF24 radio(CE_PIN, CSN_PIN);
const byte address[6] = "00001";

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MAX);
  radio.setDataRate(RF24_250KBPS);
  radio.stopListening();
}

void loop() {
  static int counter = 0; 
  
  bool success = radio.write(&counter, sizeof(counter));
  if (success) {
    Serial.print("Send Success: ");
    Serial.println(counter);
  } else {
    Serial.println("Send Fail");
    if (!radio.isChipConnected()) {
      Serial.println("Radio Chip not connected!");
    }
  }

  counter++;
  delay(1000); 
}
//RX
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

#define CE_PIN 9
#define CSN_PIN 10

RF24 radio(CE_PIN, CSN_PIN);
const byte address[6] = "00001";

int receivedData = 0;

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(0, address);
  radio.setPALevel(RF24_PA_MAX);
  radio.setDataRate(RF24_250KBPS);
  radio.startListening();

}

void loop() {
  if (radio.available()) {
    radio.read(&receivedData, sizeof(receivedData));
    Serial.println(receivedData);
  }


}

Are you sure you posted the correct code? Don't see that message anywhere on the code.

The nRF24l01 modules are a bit tricky to work with. I have built a lot of projects with it and here is my quick trouble shooting tips

  1. Most of the nRF24L01+ modules in the market are fake. The cheap ones that we can find on Ebay and Amazon are the worst (Don’t worry, with few tweaks we can make them work)

  2. The main problem is the power supply, not your code. Most of the codes online will work properly, I myself have a working code which I personally tested, Let me know if you need them.

  3. Pay attention because the modules which are printed as NRF24L01+ are actually Si24Ri (Yes a Chinese product).

  4. The clone and fake modules will consume more power, hence do not develop your power circuit based on nRF24L01+ datasheet, because Si24Ri will have high current consumption about 250mA.

  5. Beware of Voltage ripples and current surges, these modules are very sensitive and might easily burn up. (;-( fried up 2 modules so far)

  6. Adding a couple capacitors (10uF and 0.1uF) across Vcc and Gnd of the module helps in making your supply pure and this works for most of the modules.

I have documented my complete experience here if you wish to read Interfacing nRF24L01 with Arduino: Controlling Servo Motor

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