nRF24L01 unable to establish connection

Hi
I’ve been following this guide trying to set up a wireless connection between two nano every’s. The guide uses a mega and a nano every, but I’ve tried with an uno and a nano every and with two nano every’s. It shouldn’t be a difference as long as the SPI pins are set up correctly.

I’ve also tried following close to 10 other guides looking for any differences trying to find the problem. All guides use the same RF24 library.
I’ve hooked the SPI wires up according to this nano every pinout. and used the same pins 7 and 8 for CE and SCN.

I’m also using the power modules for the nRF24L01 modules to guarantee a stable voltage supply.

I cannot get a response with any of the sketches I’ve tried, I’ve tried staying away from buttons and LED’s to avoid more points of failure when trying to isolate the problem.
I’ve tried 4 different nano every’s so I’m fairly confident that the problem is not a broken board. I’ve tried both with and without the power modules, and I even tried switching the MISO/MOSI pins that one of the guides mentioned could be mislabeled on the power modules.

As of now my setup looks like this pic (imgur) Im using the sketches from the guide mentioned in the beginning

Transmitter code:

/*
* Arduino Wireless Communication Tutorial
*     Example 1 - Transmitter Code
*                
* by Dejan Nedelkovski, www.HowToMechatronics.com
* 
* Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/

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

RF24 radio(7, 8); // CE, CSN

const byte address[6] = "00001";

void setup() {
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();
}

void loop() {
  const char text[] = "Hello World";
  radio.write(&text, sizeof(text));
  delay(1000);
}

Receiver code:

/*
* Arduino Wireless Communication Tutorial
*       Example 1 - Receiver Code
*                
* by Dejan Nedelkovski, www.HowToMechatronics.com
* 
* Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/

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

RF24 radio(7, 8); // CE, CSN

const byte address[6] = "00001";

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(0, address);
  radio.setPALevel(RF24_PA_MIN);
  radio.startListening();
}

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

All the wires are hooked up according to the circuit diagram in the guide also. Note that the CLK wire is in the wrong place in the picture wiring diagram
When I open the serial monitor there’s nothing at all showing up. It works on other sketches and I’ve checked that the baud rate is right also.
Any ideas what could be the problem?

Welcome to the forum

Try this tutorial Simple nRF24L01+ 2.4GHz transceiver demo. This has been read >250k times, was written and is maintained by Robin2, one of the most active forum members.

Thanks for the reply!
I checked out that guide and red it from start to finish. I tried using the:
SimpleTx.ino and SimpleRx.ino from the first example. I saw this update under the code

Robin2 wrote:

When working properly the Rx program should show "Data received Message n" in which n varies from 0 to 9. This should be printed at about one second intervals.
if all you see is "Data received" repeating much more quickly then there is a problem - most likely theArduino is not communicating properly with its nRF24. See Reply #29 for more info

My serial monitor does exactly this, writing "Data received" quickly indicating there's a problem. So i continued on to message #29.
Robin2 wrote:

There have been several Threads in which people have reported problems with the SimpleRX program repeatedly printing Data Received very quickly even though it is obvious that data is not being received. When the communication is working properly messages should only be printed once per second.

As far as I can see the problem is caused by a poor connection between the Arduino and the nRF24 module. I can reproduce the symptom by disconnecting the CSN_PIN connection.

The following program may help to diagnose this sort of problem as it just tests the connection between the Arduino and its nRF24 without attempting to send or receive any data to / from another nRF24.

I hope the messages in the program are self-explanatory

I uploaded the sketch CheckConnection.ino that he made to both my arduinos one by one.

Here is what the serial monitor was showing:

CheckConnection Starting

FIRST WITH THE DEFAULT ADDRESSES after power on
Note that RF24 does NOT reset when Arduino resets - only when power is removed
If the numbers are mostly 0x00 or 0xff it means that the Arduino is not
communicating with the nRF24

AND NOW WITH ADDRESS AAAxR 0x41 41 41 78 52 ON P1
and 250KBPS data rate

I got the same result on both arduinos. I even tried swapping around the pins for the CE and CSN and restarted the modules by removing the ground in between tests. Both modules gave no info with the "radio.printDetails();" command.

In the very latest reply he mentioned the RF24 library had been updated and made the examples not work anymore and that he was using the 1.1.7 version of the RF24 library that was working for him. I tried reverting to that version of the library on now when running the connection testing code again my serial monitor was quite different:

CheckConnection Starting

FIRST WITH THE DEFAULT ADDRESSES after power on
Note that RF24 does NOT reset when Arduino resets - only when power is removed
If the numbers are mostly 0x00 or 0xff it means that the Arduino is not
communicating with the nRF24

STATUS = 0x06 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=3 TX_FULL=0
RX_ADDR_P0-1 = 0x0000000030 0x0000000030
RX_ADDR_P2-5 = 0x18 0x18 0x0c 0x42
TX_ADDR = 0xe3e3e3e363
RX_PW_P0-6 = 0x00 0x0c 0x00 0x18 0x18 0x0c
EN_AA = 0x1f
EN_RXADDR = 0x0c
RF_CH = 0x18
RF_SETUP = 0x0c
CONFIG = 0x00
DYNPD/FEATURE = 0x18 0x18
Data Rate = 2MBPS
Model = nRF24L01
CRC Length = 8 bits
PA Power = PA_HIGH

AND NOW WITH ADDRESS AAAxR 0x41 41 41 78 52 ON P1
and 250KBPS data rate

STATUS = 0x06 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=3 TX_FULL=0
RX_ADDR_P0-1 = 0x0000000030 0x0000000030
RX_ADDR_P2-5 = 0x18 0x18 0x0c 0x42
TX_ADDR = 0xe3c3e3e363
RX_PW_P0-6 = 0x00 0x0c 0x00 0x18 0x18 0x0c
EN_AA = 0x1f
EN_RXADDR = 0x0c
RF_CH = 0x18
RF_SETUP = 0x0c
CONFIG = 0x00
DYNPD/FEATURE = 0x18 0x18
Data Rate = 2MBPS
Model = nRF24L01
CRC Length = 8 bits
PA Power = PA_HIGH

And the other one:

CheckConnection Starting

FIRST WITH THE DEFAULT ADDRESSES after power on
Note that RF24 does NOT reset when Arduino resets - only when power is removed
If the numbers are mostly 0x00 or 0xff it means that the Arduino is not
communicating with the nRF24

STATUS = 0x06 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=3 TX_FULL=0
RX_ADDR_P0-1 = 0x0000000030 0x0000000030
RX_ADDR_P2-5 = 0x18 0x18 0x0c 0x42
TX_ADDR = 0xe3e3e3e363
RX_PW_P0-6 = 0x00 0x0c 0x00 0x18 0x18 0x0c
EN_AA = 0x1f
EN_RXADDR = 0x0c
RF_CH = 0x18
RF_SETUP = 0x0c
CONFIG = 0x00
DYNPD/FEATURE = 0x18 0x18
Data Rate = 2MBPS
Model = nRF24L01
CRC Length = 8 bits
PA Power = PA_HIGH

AND NOW WITH ADDRESS AAAxR 0x41 41 41 78 52 ON P1
and 250KBPS data rate

STATUS = 0x06 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=3 TX_FULL=0
RX_ADDR_P0-1 = 0x0000000030 0x0000000030
RX_ADDR_P2-5 = 0x18 0x18 0x0c 0x42
TX_ADDR = 0xe3e3e3e363
RX_PW_P0-6 = 0x00 0x0c 0x00 0x18 0x18 0x0c
EN_AA = 0x1f
EN_RXADDR = 0x0c
RF_CH = 0x18
RF_SETUP = 0x0c
CONFIG = 0x00
DYNPD/FEATURE = 0x18 0x18
Data Rate = 2MBPS
Model = nRF24L01
CRC Length = 8 bits
PA Power = PA_HIGH

After this I had my hopes up that it was simply the version of the library that had been updated and, in some way made the code stop working. I re uploaded the SimpleTx.ino and SimpleRx.ino sketches again but still no success. It does the same exact thing, spamming "Data received" quickly over and over again.

So to summarize:

  • Two arduino nano every's

  • Two nRF24L01 modules

  • Two nRF24L01 power modules for stable voltage (link in reply #1)

  • Wiring according to this diagram (imgur)

  • Robin2's SimpleTx.ino & SimpleRx.ino sketches

  • RF24 library version 1.1.7

Maybe you have a faulty module.

Did you buy them from a known and trusted source ?

It was almost half a year ago since I bought them actually. I don't remember exactly from what vendor but I believe it was a local supplier. I will give it one last try without the power modules, now with the earlier library version and Robin2's example code and if it still doesn't work I will try to order new modules. Even if they are not faulty, extra ones might come in handy down the line.

Alright so I started diagnosing the power modules in case something would be mislabeled or a faulty power output to the nRF module. I started by beeping the pins between the input to the power module through to the side where it connects to the nRF modules. All the markings seemed to match so now I was sure that the wire connected to CE actually goes to CE on the nRF module for example. Next I checked the voltage output, after all the meaning of these modules are to stabilize the voltage in order to keep the nRF modules running smoothly. I noticed a low voltage going to the modules of only 2,38V. I started checked the wiring diagram for the power modules and realized they needed 5V VCC instead of the 3,3V I was giving them. I swapped the VCC pin to the 5V pin on the arduino and sure enough the power modules now started delivering 3,28V.

By this point I thought the problem would be solved but turns out it was not quite so easy. I still didn't receive anything, I updated the RF24 library back to the latest version and noticed the "transmission failed" text had stopped flashing so quickly as it did before. I red around for a bit and found a mention about the modules being extra sensitive to unstable voltage since they carry wireless transmissions. I began wondering, could the 5V output on the nano every's be insufficient? I hooked up my external 5V power source to the modules and tried again.
I could not believe my eyes, it finally started sending back and forward. Turns out the power modules are no good with insufficient 5V VCC to start with.
Robin2's simpleTX and simpleRX sketches increments a number from 0 to 9 and then starts over whenever the transmission was successful. I get a serial monitor output something like this:

"0 tx failed"
"1 tx acknowledge received"
"1 tx failed"
"1 tx failed"
"2 tx acknowledge received"
"3 tx acknowledge received"

I basically get ~40% success rate on the transmissions although the modules are like 5 cm apart. But for now it at least works somewhat. I will try to solder on the capacitors next in order to be certain the voltage is stable enough.

The Nano Every is only able to supply 50mA on the 3.3V pin, thats unlikley to be enough to power a nRF24L01.

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