Problem in communication with nrf24l01

EN_AA = 0x00
EN_RXADDR = 0x00
RF_CH = 0x00
RF_SETUP = 0x00
CONFIG = 0x00

i am having problem in communication with nrf24l01 with arduino nano i am getting value 0x00 in arduino ide software.what is the solution ? aoove value is the value that i am receving

Welcome to the forum

As your topic does not relate directly to the installation or operation of the IDE it has been moved to the Programming Questions category of the forum

What kind of Arduino do you have? What kind of NRF24 module? Can you please post a schematic and clear photos of your circuit? What code are you running that produces the output you gave?

We are using Arduino nano and we have nrf24l01 and we are running nrf24l01 testing code in arduino ide

:white_check_mark: What kind of Arduino do you have?
:x: What kind of NRF24 module?
:white_check_mark: Can you please post a schematic
:x: and clear photos of your circuit?
:x: What code are you running that produces the output you gave?

post code here

NRF24L01+PA AND NRF24L01 LNA

INSPECATION CODE
/*
If your serial output has these values same then Your nrf24l01 module is in working condition :

EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x4c
RF_SETUP = 0x03
CONFIG = 0x0f

This code is under public domain

Last updated on 21/08/28
Home - elekkrypt
*/

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

RF24 radio(7, 8);

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

void setup() {
radio.begin();
radio.setPALevel(RF24_PA_LOW);

radio.openWritingPipe(addresses[0]);
radio.openReadingPipe(1, addresses[1]);
radio.startListening();

Serial.begin(9600);
printf_begin();

radio.printDetails();

}

void loop() {
// empty

}

/*
If your serial output has these values same then Your nrf24l01 module is in working condition :

EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x4c
RF_SETUP = 0x03
CONFIG = 0x0f

This code is under public domain

Last updated on 21/08/28
Home - elekkrypt
*/

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

RF24 radio(7, 8);

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

void setup() {
radio.begin();
radio.setPALevel(RF24_PA_LOW);

radio.openWritingPipe(addresses[0]);
radio.openReadingPipe(1, addresses[1]);
radio.startListening();

Serial.begin(9600);
printf_begin();

radio.printDetails();

}

void loop() {
// empty

}

delete one post, and edit second to place the code between CODE tags

i knew it! wrong pins
your diagram shows 9,10

1 Like

check this link: RF24/COMMON_ISSUES.md at master · nRF24/RF24 · GitHub
As described above, the radio modules (notably the PA+LNA versions) are reliant on a stable power source (Arduinos 3V3 is not stable in this application). While these modules may work with a poor power supply,
they often lose packets or fail to receive as many as a module with a better power source. Moreover, this can sometimes be seen in odd ways such as the radio module working better when touched. This again is likely a power stability issue because the radio module is missing a capacitor (a commonly neglected expense on behalf of the module's manufacturer).

Add capacitor(s) close to the VCC and GND pins of the radio. Typically, 10uF is enough. Depending upon your circuit's layout, differences in capacitors' electrolytic properties can be seen, such that a low ESR (Equivalent Series Resistance) rated capacitor is desirable.

#4 suggests they're using an NRF24 module with a power supply board that uses a linear regulator to make 3V3 from 5V.

Also, at the risk of being flippant, but I've run NRF24 fine (for days on end) from the 3V3 made by Nano clones, which use the flimsy CH340 internal regulator for this purpose. It worked just fine...There's of course absolutely nothing wrong with ensuring a stable power supply and adding an extra buffer cap. But looking at the problems reported by people on this forum when working with the nRF24 modules, they boil down to 20% connection problems, 80% coding problems and a minor fraction may or may not involve a power supply issue.

This is not to discredit your suggestion, btw.

thank you for your suggestion
we have made right arrangedments now .

No problem sometimes you get lucky as have others. You are only worried about a few, my background is typically over 100K units over extreme temperature ranges.

/* Tranmsitter code for the Arduino Radio control with PWM output
 * Install the NRF24 library to your IDE
 * Upload this code to the Arduino UNO, NANO, Pro mini (5V,16MHz)
 * Connect a NRF24 module to it:
 
    Module // Arduino UNO,NANO
    
    GND    ->   GND
    Vcc    ->   3.3V
    CE     ->   D9
    CSN    ->   D10
    CLK    ->   D13
    MOSI   ->   D11
    MISO   ->   D12

This code transmits 1 channels with data from pins A0 POTENTIOMETER
Please, like share and subscribe : https://www.youtube.com/c/ELECTRONOOBS
*/

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

const uint64_t my_radio_pipe = 0xE8E8F0F0E1LL; //Remember that this code should be the same for the receiver

RF24 radio(9, 10);

// The sizeof this struct should not exceed 32 bytes
struct Data_to_be_sent {
  byte ch1; 
};

Data_to_be_sent sent_data;



void setup()
{
  radio.begin();
  radio.setAutoAck(false);
  radio.setDataRate(RF24_250KBPS);
  radio.openWritingPipe(my_radio_pipe);  
  sent_data.ch1 = 127;
  
}

/**************************************************/


void loop()
{
  /*If your channel is reversed, just swap 0 to 255 by 255 to 0 below
  EXAMPLE:
  Normal:    data.ch1 = map( analogRead(A0), 0, 1024, 0, 255);
  Reversed:  data.ch1 = map( analogRead(A0), 0, 1024, 255, 0);  */
  
  sent_data.ch1 = map( analogRead(A0), 0, 1024, 0, 255);

  radio.write(&sent_data, sizeof(Data_to_be_sent));
}

/* Receiver code for the Arduino Radio control with PWM output
 * Install the NRF24 library to your IDE
 * Upload this code to the Arduino UNO, NANO, Pro mini (5V,16MHz)
 * Connect a NRF24 module to it:
 
    Module // Arduino UNO,NANO
    
    GND    ->   GND
    Vcc    ->   3.3V
    CE     ->   D9
    CSN    ->   D10
    CLK    ->   D13
    MOSI   ->   D11
    MISO   ->   D12

This code receive 1 channels and prints the value on the serial monitor
Please, like share and subscribe : https://www.youtube.com/c/ELECTRONOOBS
*/


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

const uint64_t pipeIn = 0xE8E8F0F0E1LL;     //Remember that this code is the same as in the transmitter
RF24 radio(9, 10);  //CSN and CE pins

// The sizeof this struct should not exceed 32 bytes
struct Received_data {
  byte ch1;
};

int ch1_value = 0;
Received_data received_data;


/**************************************************/

void setup()
{
  Serial.begin(9600);
  //We reset the received values
  received_data.ch1 = 127;
 
  //Once again, begin and radio configuration
  radio.begin();
  radio.setAutoAck(false);
  radio.setDataRate(RF24_250KBPS);  
  radio.openReadingPipe(1,pipeIn);
  
  //We start the radio comunication
  radio.startListening();

}

/**************************************************/

unsigned long last_Time = 0;

//We create the function that will read the data each certain time
void receive_the_data()
{
  while ( radio.available() ) {
  radio.read(&received_data, sizeof(Received_data));
  last_Time = millis(); //Here we receive the data
}
}

/**************************************************/

void loop()
{
  //Receive the radio data
  receive_the_data();

  
  ch1_value = map(received_data.ch1,0,255,1000,2000);
  Serial.println(ch1_value);
  
  
}//Loop end

we tried changing the value from potentiometer but it does not change the value in arduino idf software.
what is the problem in communication with nrf24l01?
what is the solution?

image
That won't do anything.

That's an odd way of defining a byte.

Ambiguous comment; rather comment it in the correct order: CE and CSN.

So what value does the receiver report?
If you verify the reading of the sender on the Serial monitor (add a Serial.print for the value you send to the receiver), do the receiver and sender match? Does the sender in fact correctly read your pot meter?

We're getting there, but despite 4 days of sweat-provoking effort we're not quite there yet. I still have hope.

sorry but i am new at this software and this our first project with nrf24lo1 and arduino . so basicalliy we are making a drone out of it and we are using nrf in it . our knowledge ends here if you have any suggestion please give it in simple way . if you have any other social media platform so please give us so we can talk more accurately and we are using nrf24l01+pa+lna for transmitter and for receiver we are using tranreceiver nrf24l01.

No worries about being new. Despite that, you can still answer the diagnostic questions designed to help you. Please see my message above.

Even with the pa + lna on the transmitter side I expect your range will be limited. Whether it'll be good enough for your drone project, only you can decide!

Let's not do that. For one thing, I think you shouldn't make yourself dependent on one particular person for input on your project. Moreover, I'd rather not be that person since I'm not really committed to your project and have no intention to be. Finally, I think you put yourself into the best position to be helped to freely share the information I asked for in this thread so that others can also provide their insights. You'll get more help, it'll be of better quality and you'll get it quicker.

/* Tranmsitter code for the Arduino Radio control with PWM output
   Install the NRF24 library to your IDE
   Upload this code to the Arduino UNO, NANO, Pro mini (5V,16MHz)
   Connect a NRF24 module to it:

    Module // Arduino UNO,NANO

    GND    ->   GND
    Vcc    ->   3.3V
    CE     ->   D9
    CSN    ->   D10
    MOSI   ->   D11
    MISO   ->   D12
    CLK    ->   D13

*/

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

const uint64_t my_radio_pipe = 0xE8E8F0F0E1LL; //Remember that this code should be the same for the receiver

RF24 radio(9, 10);

// The sizeof this struct should not exceed 32 bytes
struct Data_to_be_sent {
  byte ch1;
  byte ch2;
  byte ch3;
  byte ch4;
} sent_data;

void setup() {
  radio.begin();
  radio.setAutoAck(false);
  radio.setDataRate(RF24_250KBPS);
  radio.setPayloadSize(4);
  radio.openWritingPipe(my_radio_pipe);
  radio.stopListening();
  sent_data.ch1 = 127;
  sent_data.ch2 = 127;
  sent_data.ch3 = 127;
  sent_data.ch4 = 127;
}

void loop() {

  sent_data.ch1 = analogRead(A0) >> 2;
  radio.write(&sent_data, 4);
  delay(20);
}
/* Receiver code for the Arduino Radio control with PWM output
   Install the NRF24 library to your IDE
   Upload this code to the Arduino UNO, NANO, Pro mini (5V,16MHz)
   Connect a NRF24 module to it:

    Module // Arduino UNO,NANO

    GND    ->   GND
    Vcc    ->   3.3V
    CE     ->   D9
    CSN    ->   D10
    MOSI   ->   D11
    MISO   ->   D12
    CLK    ->   D13

  This code receive 1 channels and prints the value on the serial monitor
  Please, like share and subscribe : https://www.youtube.com/c/ELECTRONOOBS
*/


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

const uint64_t pipeIn = 0xE8E8F0F0E1LL;     //Remember that this code is the same as in the transmitter
RF24 radio(9, 10);  //CSN and CE pins

// The sizeof this struct should not exceed 32 bytes
struct Data_to_be_sent {
  byte ch1;
  byte ch2;
  byte ch3;
  byte ch4;
} received_data;

unsigned long last_Time = 0;

void setup() {
  Serial.begin(115200);
  received_data.ch1 = 0;

  radio.begin();
  radio.setAutoAck(false);
  radio.setDataRate(RF24_250KBPS);
  radio.openReadingPipe(1, pipeIn);
  radio.startListening();
}

void loop() {
  if ( radio.available() ) {
    radio.read(&received_data, 4);
    last_Time = millis();
    int ch1_value = map(received_data.ch1, 0, 255, 1000, 2000);
    Serial.println(ch1_value);
  }
}