<SOLVED> NRF24L01 High Power Module Inconsistencies

I think I have solved the problem. I have switched to the Getting Started sketch in the original library and I have bypassed the voltage regulators and powered my units directly from the power supplies. After reading documentation as well as other people's experiences with similar projects, was made aware that some voltage regulators and step up/ step downs can cause noise in the circuit that could disrupt RF activity. Using two high powered NRF24L01 modules connected to two cheap china arduino nano MCUs, I was able to get the sketch working at a minimum. For the transmitter, my power supply consisted of 2x4 AA batteries hooked together to provide a nominal 6.4VDC that was plugged into the VIN on the nano MCU. The RF module was powered via the 3V3 pin. After getting the sketch to work with correlating data being reported on both recieving and transmitting serial ports, I proceeded to edit the code on the transmitter allowing me to add LED lights to report a response or timeout when pinging the receiving unit.

Thank you for your guidance Robin2. Moving onto the next step of the project.

Hello,

I've recently delved into the world of Arduino micro-controlling, and after learning/ experimenting on a breadboard with a single unit, I decided to take a stab at getting a couple of NRF24L01 modules working together. I've been trying multiple different combinations of different libraries and example sketches simply trying to get something to work, and instead of going through an exhaustive list of what I've tried, I'll describe the way things are hooked up now. After seeing a wealth of example sketches, I believe this may be the simplest place to move forward from. It's worth noting that both Arduino Nano chips in use have been tested and appear to operate correctly with basic DPin OUTPUT sketches. Output voltage after the DC Voltage regulator has been verified at 3.3V and there are two capacitors at either end of the reg. I have tried running the sketches on both MCUs with the power setting RF24_PA_MIN. The hardware I'm currently using goes as follows. The left and the right setup are identical, I have an Arduino Nano clone from ATMega model ATmega328/P, my power supply is coming from USB via computer. Attached to the 5V power supply of the Nano is a DC to DC Voltage Stepdown, 5V->3.3V +/- .1V. The NRF24 Module is Connected to the Voltage Regulator. The pin setup for the NRF24 goes as follows.

VCC - DC regulator @ 3.3V +/- .1V
GND - Nano GND
CSN - DPin 7
CE - DPin 8
MOSI - DPin 11
MISO - DPin 12
SCK - DPin 13
IRQ - Not connected

The error I'm receiving:
The unit is reporting this through the serial port after I change to transmit mode.

*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK
Now sending
Sent 63264628, Got response 0, Round-trip delay 1064612 microseconds
Now sending
Sent 65330804, Got response 0, Round-trip delay 1117288 microseconds
Now sending
Sent 67449656, Got response 0, Round-trip delay 1149324 microseconds

When I unplug and power down the active receiver, the transmitter continues with the above serial communication report indefinitely, while I feel it should lose it's connection.

Here is the code (Example from the NRF24L01 Library) I'm trying to run:

/*
* Getting Started example sketch for nRF24L01+ radios
* This is a very basic example of how to send data from one node to another
* Updated: Dec 2014 by TMRh20
*/

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

/****************** User Config ***************************/
/***      Set this radio as radio number 0 or 1         ***/
bool radioNumber = 0;

/* Hardware configuration: Set up nRF24L01 radio on SPI bus plus pins 7 & 8 */
RF24 radio(7,8);
/**********************************************************/

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

// Used to control whether this node is sending or receiving
bool role = 0;

void setup() {
  Serial.begin(115200);
  Serial.println(F("RF24/examples/GettingStarted"));
  Serial.println(F("*** PRESS 'T' to begin transmitting to the other node"));
  
  radio.begin();

  // Set the PA Level low to prevent power supply related issues since this is a
 // getting_started sketch, and the likelihood of close proximity of the devices. RF24_PA_MAX is default.
  radio.setPALevel(RF24_PA_MAX);
  
  // Open a writing and reading pipe on each radio, with opposite addresses
  if(radioNumber){
    radio.openWritingPipe(addresses[1]);
    radio.openReadingPipe(1,addresses[0]);
  }else{
    radio.openWritingPipe(addresses[0]);
    radio.openReadingPipe(1,addresses[1]);
  }
  
  // Start the radio listening for data
  radio.startListening();
}

void loop() {
  
  
/****************** Ping Out Role ***************************/  
if (role == 1)  {
    
    radio.stopListening();                                    // First, stop listening so we can talk.
    
    
    Serial.println(F("Now sending"));

    unsigned long start_time = micros();                             // Take the time, and send it.  This will block until complete
     if (!radio.write( &start_time, sizeof(unsigned long) )){
       Serial.println(F("failed"));
     }
        
    radio.startListening();                                    // Now, continue listening
    
    unsigned long started_waiting_at = micros();               // Set up a timeout period, get the current microseconds
    boolean timeout = false;                                   // Set up a variable to indicate if a response was received or not
    
    while ( ! radio.available() ){                             // While nothing is received
      if (micros() - started_waiting_at > 200000 ){            // If waited longer than 200ms, indicate timeout and exit while loop
          timeout = true;
          break;
      }      
    }
        
    if ( timeout ){                                             // Describe the results
        Serial.println(F("Failed, response timed out."));
    }else{
        unsigned long got_time;                                 // Grab the response, compare, and send to debugging spew
        radio.read( &got_time, sizeof(unsigned long) );
        unsigned long end_time = micros();
        
        // Spew it
        Serial.print(F("Sent "));
        Serial.print(start_time);
        Serial.print(F(", Got response "));
        Serial.print(got_time);
        Serial.print(F(", Round-trip delay "));
        Serial.print(end_time-start_time);
        Serial.println(F(" microseconds"));
    }

    // Try again 1s later
    delay(1000);
  }



/****************** Pong Back Role ***************************/

  if ( role == 0 )
  {
    unsigned long got_time;
    
    if( radio.available()){
                                                                    // Variable for the received timestamp
      while (radio.available()) {                                   // While there is data ready
        radio.read( &got_time, sizeof(unsigned long) );             // Get the payload
      }
     
      radio.stopListening();                                        // First, stop listening so we can talk   
      radio.write( &got_time, sizeof(unsigned long) );              // Send the final one back.      
      radio.startListening();                                       // Now, resume listening so we catch the next packets.     
      Serial.print(F("Sent response "));
      Serial.println(got_time);  
   }
 }




/****************** Change Roles via Serial Commands ***************************/

  if ( Serial.available() )
  {
    char c = toupper(Serial.read());
    if ( c == 'T' && role == 0 ){      
      Serial.println(F("*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK"));
      role = 1;                  // Become the primary transmitter (ping out)
    
   }else
    if ( c == 'R' && role == 1 ){
      Serial.println(F("*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK"));      
       role = 0;                // Become the primary receiver (pong back)
       radio.startListening();
       
    }
  }


} // Loop
bool radioNumber = 0;

Here, each radio has its own identity.

Data Sheets for components: Datasheets for components

I suspect the code/ library may be outdated or incompatible.
Any direction that could be provided on this project would be very gladly received.
Thank you for your consideration.

-Ty

(Edited - Spelling)

Have a look at this Simple nRF24L01+ Tutorial. I have deliberately made the examples as simple as possible to avoid confusion. They do work.

If you are using a High power nRF24 (with external antenna) then it may help to separate the two nRF24s by a reasonable distance (maybe 2 or 3 metres) so that the high power signal does not overpower the receiver.

...R

Hey Robin, thanks for the reply. So I've followed your advice and separated both of the modules. I've also gone through the tutorial in the link you posted and double checked all of my connections. Everything appears to be in order while running the first set of example code you have on that thread that sets up one RF module as RX, and the other as TX, but I'm still running into problems. The TX is outputting on the serial "Transmission was not recieved" or something to that effect. (I apologise, I don't have my computer in front of me.) And the RX module is spamming "Data sent" about 30-40 times every second. Once more, the receiver is reporting Data even after the TX module is powered down. I can provide more details once I make it back to my computer. Is this a common issue?

Thanks in advance for your help,

-Ty

Post the code that YOU uploaded to YOUR two Arduinos.
Post a sample of the output from both programs.

How are you powering the nRF24 modules? AFAIK the high-power versions need a separate 3.3v supply as the Arduino's 3.3v pin cannot provide enough current.

...R

Okay, this is my current setup.

The Rx - slave

This is the code I'm running on the Rx:

// SimpleRx - the slave or the receiver

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

#define CE_PIN   9
#define CSN_PIN 10

const byte thisSlaveAddress[5] = {'R','x','A','A','A'};

RF24 radio(CE_PIN, CSN_PIN);

char dataReceived[10]; // this must match dataToSend in the TX
bool newData = false;

//===========

void setup() {

    Serial.begin(9600);

    Serial.println("SimpleRx Starting");
    radio.begin();
    radio.setDataRate( RF24_250KBPS );
    radio.openReadingPipe(1, thisSlaveAddress);
    radio.startListening();
}

//=============

void loop() {
    getData();
    showData();
}

//==============

void getData() {
    if ( radio.available() ) {
        radio.read( &dataReceived, sizeof(dataReceived) );
        newData = true;
    }
}

void showData() {
    if (newData == true) {
        Serial.print("Data received ");
        Serial.println(dataReceived);
        newData = false;
    }
}

This is the data pouring out of the serial port and repeats endlessly at a ridiculously fast rate:

|SimpleRx Starting
Data received 
Data received 
Data received 
Data received 
Data received 
Data received 
Data received 
Data received 
Data received 
Data received 
Data received 
Data received

On to the Tx - master

This is the code that's being run on the transmitter:

// SimpleTx - the master or the transmitter

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


#define CE_PIN   9
#define CSN_PIN 10

const byte slaveAddress[5] = {'R','x','A','A','A'};


RF24 radio(CE_PIN, CSN_PIN); // Create a Radio

char dataToSend[10] = "Message 0";
char txNum = '0';


unsigned long currentMillis;
unsigned long prevMillis;
unsigned long txIntervalMillis = 1000; // send once per second


void setup() {

    Serial.begin(9600);

    Serial.println("SimpleTx Starting");

    radio.begin();
    radio.setDataRate( RF24_250KBPS );
    radio.setRetries(3,5); // delay, count
    radio.openWritingPipe(slaveAddress);
}

//====================

void loop() {
    currentMillis = millis();
    if (currentMillis - prevMillis >= txIntervalMillis) {
        send();
        prevMillis = millis();
    }
}

//====================

void send() {

    bool rslt;
    rslt = radio.write( &dataToSend, sizeof(dataToSend) );
        // Always use sizeof() as it gives the size as the number of bytes.
        // For example if dataToSend was an int sizeof() would correctly return 2

    Serial.print("Data Sent ");
    Serial.print(dataToSend);
    if (rslt) {
        Serial.println("  Acknowledge received");
        updateMessage();
    }
    else {
        Serial.println("  Tx failed");
    }
}

//================

void updateMessage() {
        // so you can see that new data is being sent
    txNum += 1;
    if (txNum > '9') {
        txNum = '0';
    }
    dataToSend[8] = txNum;
}

As well as the data being reported every second through the serial port:

SimpleTx Starting
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed

power is being supplied to the radio module from a DC to DC Voltage regulator. The regulator has capacitors on both the input and output power sides and has 5V input power from the arduino, and 3.3V output power supplying power to the radio modules. each arduino is set up the exact same for all but the code that's running in the IDE. I have a couple of 3.7V, 1200mA/h LiPo batteries that I may end up using to try and supply power to the radio modules instead of just using the USB. I have tried using 2 sets of 4 AA batteries hooked together in series to provide >6vdc to the arduino instead of using USB power, still having the DC to DC V regulator pulling power from the adrduino's 5V supply, but that hasn't worked. I'm going to try using the LiPo battery on both to see if this changes the outcome. If not, I plan on uninstalling all libraries related to the NRF24L01 and reinstalling the correct ones based off of the tutorial here.

Thank you again for your guidance.

-Ty

Edit - This is a link to the data sheets for the componets I'm using (including the DC to DC Voltage stepdown/ regulator).

Tyler_Jwll:
This is the data pouring out of the serial port and repeats endlessly at a ridiculously fast rate:

I have seen that happen. I think it means that the nRF24 is not properly connected to the Arduino and appears to be giving a constant positive response. Check all your connections very carefully - especially looking for loose wires. I would disconnect everything and reconnect again from scratch.

Does it give that stream of output even when the other Arduino is not powered up?

Try loading the programs onto the other Arduinos and see if the problem moves to the other one.

Do you have a spare nRF24 so you can check if one of them is faulty?

...R

Yes, the Rx gives the reported output even though the Tx is powered down. I do have 1 more NRF module that I could test out. I'll give that a shot tonight. Ive already tried swapping out the nano for another and moved everything to an entirely now breadboard in the process. I bought the NRF modules in a pack of three, and the third is soldered into a protoboard. I'll swap a few digital pins around and try to get that one working as a Rx with a better resault. Thank you again, I'll let you know what happens in about 6 hours.

-Ty

Hello there,

So here are some things I've tried. I ditched the arduino that I had used as the Rx unit that was spamming "Data Received" at me and used an entirely now circuit in its place. Running the same code as before, I was able to get rid of the earlier "Data received" problem. My problem now is that the Rx will not pick anything up at all.

SimpleRx Starting

and my Tx fails to send a message and receive data back.

SimpleTx Starting
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed
Data Sent Message 0  Tx failed

I interchange the code between arduinos and get the same result. I has some old aluminum capacitors I'v soldered on between the VCC and ground pins of both radio modules. When I started them both up, I got one "Acknowledge received" and it went back to spamming Tx failed. I'm not sure what else to do here... I may end up buying some low power NRF modules and a couple of new arduinos, just to try and eliminate potential problems. Any more ideas I could try to get this working in the meantime? I'll include pictures of my setup.

Tx, Rx pictures

It makes life much easier if we can see the images here. See this Simple Image Guide

However photos of the hardware are not much use. Photos of simple pencil drawings of your connections to the two Ardunos would be much easier to interpret - as requested in Reply #3

Wireless problems can be very difficult to debug, My examples have worked for several other Forum readers.

...R

Hello
im a arduino hobbyist since a half year.
i had exactly the same configuration, exactly the same modules and exactly the same problems.
BUT:
sometimes its working a whole day, so i can continue to develope my own sketch.
othertimes nothing, helps.

like Robin says in post 5 and my experience of the last weeks maybe its a electric contact Problem!

i get to dismount it and to try again

Hello,
i dismount some projects to get two UNOs.
Same layout like with the NANOs and it works!!!

Andonoc:
i dismount some projects to get two UNOs.
Same layout like with the NANOs and it works!!!

Are you using high power nRF24s with the external antenna? or the low power versions with the PCB antenna?

In either case, how are you powering the nRF24s? Can you post circuit diagrams?

...R

iam using high power nRF24s with the external antenna
i follow exactly your tutorial and the simple one way trasmission sketch,
solderd 10uf capacitor, no external power only usb
this time i use only cables and no breadboard, tried with nano and uno but only uno works
later i will try the other exemples
i know it was useful to add a power source(LDO are coming these days) , but sometimes the nanos where working great so i thought the error where somewere else.
then i read this post...

Andonoc:
solderd 10uf capacitor, no external power only usb
this time i use only cables and no breadboard, tried with nano and uno but only uno works

My guess is that the Nano does not produce enough current at 3.3v to operate the nRF24. I have a Mega clone that cannot power a low-power nRF24.

Try giving the nRF24 a separate power supply while using your Nano. It should work fine from a pair of AA alkaline cells (3v). Make sure to connect the nRF24 GND to the Arduino GND.

...R

Thank you robin, :slight_smile:

So i will put them away and wait for the regulators

@Robin2,

My high power radio modules are running off of usb power from my arduino nanos as well. Voltage is supplied from the 5v out on the board to a regulator/ stepdown to 3.3V. The regulator has 2 capacitors on it. Could lack of current still be an issue on my end?

-Ty

Tyler_Jwll:
My high power radio modules are running off of usb power from my arduino nanos as well. Voltage is supplied from the 5v out on the board to a regulator/ stepdown to 3.3V.

I think that should work but I don't have any high-power nRF24s. What are you using for a 3.3v regulator?

Try powering the nRF24 from a pair of new AA alkaline cells and see if that makes a difference.

...R

This is the Data Sheet. I'll try the battery set up in the morning.

Tyler_Jwll:
This is the Data Sheet.

it looks like that should be suitable. Have you bought the chip and built your own adapter or did you buy it already on a breakout board?

I have only used LD1117 voltage regulators.

...R

Robin2:
Have you bought the chip and built your own adapter or did you buy it already on a breakout board?

I just soldered wires onto the input +/- and output +/- and have the regulator/ Voltage stepdown chip sitting on my breadboard next to my MCU. All direct connections.