NRF24L01 driving me nuts

So I'm just trying to get two of these NRF24L01+ modules to communicate with each other, nothing fancy yet, and I'm repeatedly running into a wall. Here's the setup:

  • Two UNOs and two NRF24L01+ modules
  • Using RF24 library as installed from the library manager (this is the tmrh20 version)
  • Arduino 1.6.8
  • Both of the UNOs are plugged into the same computer

Each module is on its own breadboard (plugged into bent extended headers) connected to its own UNO. I have soldered 0.1uF capacitors directly to the Vcc and GND pins of each module. The 3v3 is coming from the UNO, and there is a 47uF electrolytic capacitor across each breadboard power rail. I have verified the rail voltage, measured directly on the NRF module, to be 3.328v when running on the UNOs' internal regulators. I have tried all of the following with the UNOs running off USB, and connected to an external power supply (PC PSU) putting out a stable 3.447v. The power supply doesn't change any of the behavior.

Pins are as follows:

NRF UNO
1 -> GND
2 -> 3v3
3 -> 9
4 -> 10
5 -> 13
6 -> 11
7 -> 12
8 -> n/c

I can install and run this particular scanner program to either board

https://arduino-info.wikispaces.com/Nrf24L01-Poor+Man's+2.4+GHz+Scanner

and it correctly locates the strong channels in my environment (verified with my phone's WiFi scanner). This works with any of the NRF modules on either Arduino, so I'm fairly sure that there's nothing wrong with the modules themselves.

Starting Poor Man's Wireless 2.4GHz Scanner ...

Channel Layout

1 2 3 4 5 6 7 8 9 10 11 12 13 14 <
| ::::: RRWWRWWW | 19
| .-====... WWWRRRRR | 18
| ::::: RRWWRWWW | 19
| :::.: WWWWWRRa | 19
| :::-- WRWWRRWW | 17

So, I tried installing the pingpair_ack sketch from the RF24 examples. Here's the output from one

RF24/examples/pingpair_ack/

ROLE: Pong back
*** PRESS 'T' to begin transmitting to the other node
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x544d52687c 0xabcdabcd71
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x544d52687c
RX_PW_P0-6 = 0x01 0x01 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x64
RF_SETUP = 0x07
CONFIG = 0x0f
DYNPD/FEATURE = 0x03 0x06
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX
*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK
Now sending 1 as payload. failed.
Now sending 1 as payload. failed.
Now sending 1 as payload. failed.
Now sending 1 as payload. failed.
Now sending 1 as payload. failed.

and from the other

RF24/examples/pingpair_ack/

ROLE: Pong back
*** PRESS 'T' to begin transmitting to the other node
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x544d52687c 0xabcdabcd71
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x544d52687c
RX_PW_P0-6 = 0x01 0x01 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x64
RF_SETUP = 0x07
CONFIG = 0x0f
DYNPD/FEATURE = 0x03 0x06
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX
*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK
Now sending 1 as payload. failed.
Now sending 1 as payload. failed.

Doesn't matter what I do -- I get no connectivity. The UNOs appear to be communicating with the radios, but the radios just aren't sending anything for some reason.

I have also tried the other examples in the RF24 folder, and a few from RadioHead, and none work.

I've been tearing out my hair at this for three days. Anyone got any ideas of what I should try next?

Haha, well, this is how it always works. You finally give up and post for help, go take a shower, and suddenly realize something else and try it out and solve the problem.

I realized that the radio was defaulting to transmit with maximum power, which is probably a lot, whatever it is. The recommended 10uF, 20uF, etc capacitors might have been suitable for a more intermediate power level, but might be still browning out at maximum. So I set the radio.setPALevel(RF24_PA_MIN) and ta-da, it's sending and receiving now! Still a few dropped packets but it's working.

So, the more important question now is: how do I select the appropriate size of capacitor and voltage regulator for this circuit to ensure that it always has the right amount of power? How would I go about measuring the power consumption and how would I spec the parts?

This Simple nRF24L01+ Tutorial may be of interest.

...R

I dug into it a bit more, and now the issue is: I cannot transmit data when the power amplifier is set to RF24_PA_HIGH or RF24_PA_MAX. _MIN and _LOW work fine. I don't see any voltage droop on the bus, and I have the capacitors installed and a large external 3v3 supply connected.

Is there something else that might be going on, preventing data from being transmitted at high power?

AFAIK the default setting for the nRF24 is full power and I have never consciously changed it. I have had no problems powering an nRF24 from the 3.3v pin on an Uno or Mega and I have not needed 10µF capacitors. Though I do put the capacitors on all my veroboard projects.

However I have only used the nRF24 with the PCB antenna. I have not tried the versions with the external antenna.

...R

So, I was able to solve the problem. I had noticed that I could get better reliability by touching the radio module's pins -- most importantly the ground pin. I mentioned this to a radio guy on another forum, and he suggested that the module didn't have enough load capacitance and to solder a 30mm wire onto the PCB trace antenna. I did that and it works pretty much perfectly, transmitting at maximum power with almost no dropped packets. :slight_smile:

So, not sure why this particular modification was necessary -- maybe the seller I bought them from cheaped out on something they shouldn't have? -- but it's working well now. Anyone else having trouble with unreliable NRF24L01+s might try the same thing!