Issue with nRF24L01 module and arduino uno

Hello people,
Im very much new with arduino. I have tested arduino with nrf module for my project. I tested all the programs which available in internet but it is not working. Is it the problem with nRF module or do I need to do anything to activate the communication between the modules ?
.....
The programms I tested which is not working,
rx:

//Include Libraries

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

//create an RF24 object
RF24 radio(9, 8);  // CE, CSN

//address through which two modules communicate.
const byte address[6] = "00001";

void setup()
{
  while (!Serial);
    Serial.begin(9600);
  
  radio.begin();
  
  //set the address
  radio.openReadingPipe(0, address);
  
  //Set module as receiver
  radio.startListening();
}

void loop()
{
  //Read the data if available in buffer
  if (radio.available())
  {
    char text[32] = {0};
    radio.read(&text, sizeof(text));
    Serial.println(text);
    delay(1000);
  }
}

tx :

//Include Libraries

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

//create an RF24 object
RF24 radio(9, 8);  // CE, CSN

//address through which two modules communicate.
const byte address[6] = "00001";

void setup()
{
  radio.begin();
  
  //set the address
  radio.openWritingPipe(address);
  
  //Set module as transmitter
  radio.stopListening();
}
void loop()
{
  //Send message to receiver
  const char text[] = "Hello World";
  radio.write(&text, sizeof(text));
  
  delay(1000);
}.

But when I tested the nRF testing program , it was working, The working program was :
leader programm:

/*********************************************************************
**   SPI-compatible                                                 **
**   CE - to digital pin 9                                          **
**   CSN - to digital pin 10  (SS pin)                               **
**   SCK - to digital pin 13 (SCK pin)                              **
**   MOSI - to digital pin 11 (MOSI pin)                            **
**   MISO - to digital pin 12 (MISO pin)                            **
**   IRQ - to digital pin 8 (MISO pin)                             **
*********************************************************************/
#include "NRF24L01.h"

#define TX_ADR_WIDTH    5   // 5 unsigned chars TX(RX) address width
#define TX_PLOAD_WIDTH  1  // 32 unsigned chars TX payload
unsigned char RX_ADDRESS[TX_ADR_WIDTH]  = 
{
  0x34,0x43,0x10,0x10,0x01
};
int rx_buf = 0;
unsigned char tx_buf[TX_PLOAD_WIDTH] = {0};

void setup()
{
    Serial.begin(9600);
    NRF_Init();                        // Initialize IO     
    NRF_SetRxMode();
    Serial.println("RX_Mode start...");
}

void loop()
{
    NRF_SetRxMode();
    if(NRF_Receive)
    {
        Serial.print("RX = ");
        
        
            Serial.print(rx_buf);
            Serial.print(",");
        
       
        
    }
    delay(500);
}

follower:

#include "NRF24L01.h"

#define TX_ADR_WIDTH    5   // 5 unsigned chars TX(RX) address width
#define TX_PLOAD_WIDTH  1   // 3 unsigned chars TX payload
unsigned char TX_ADDRESS[TX_ADR_WIDTH]  = 
{
    0x34,0x43,0x10,0x10,0x01
}; 
unsigned char rx_buf = {0}; // initialize value
int tx_buf = 10;

void setup()
{
    Serial.begin(9600);
    tx_buf= tx_buf+1;
    

    NRF_Init();                        // Initialize IO port
    Serial.println("TX_Mode Start");    
}

void loop()
{
    NRF_SeTxMode();
    do
    { 
        NRF_Send(tx_buf);
    }
 while(!NRF_CheckAck());
}

Can someone help me with this issue ? Any help would be appreciable.

Your topic was MOVED to its current forum category as it is more suitable than the original

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

Read the forum guidelines to see how to properly post code and some good information on making a good post.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

Please go back and fix your original post by highlighting the code and clicking the </> in the menu bar.
code tags new

Here are some tips that I gathered while getting my radios to work and helping others to get theirs to work.

If you read and, closely, follow Robin2's simple rf24 tutorial you should be able to get them working. That tutorial sure helped me. The code in the examples has been proven to work many many times. If it does not work for you, there is likely a hardware problem.

Run the CheckConnection.ino (look in reply #30 in the tutorial) to verify the physical wiring between the radio module and its processor (Arduino).

It is very important that you get the 3.3V supply to the radio modules to supply enough current. This is especially true for the high power (external antenna) modules. I use homemade adapters like these. They are powered by 5V and have a 3.3V regulator on the board. Robin2 also has suggested trying with a 2 AA cell battery pack.

If using the high powered radios make sure to separate them by a few meters. They may not work too close together. Try the lower power settings.

Reset the radios by cycling power to them after uploading new code. I have found that to help. They do not reset with the Arduino.

Switch to 1MB data rate to catch the not so cloned clones.
radio.setDataRate( RF24_1MBPS );

Also for some clones, change TMRh20's RF24.cpp line 44
_SPI.setClockDivider(SPI_CLOCK_DIV2);
Into
_SPI.setClockDivider(SPI_CLOCK_DIV4);

Have a look at the common problems page.

HI I tried everything available and its not working,
but those nRF testing progarms, working properly

Thanks for the infromation. I will follow those instructions.

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