nRF24L01+ setup [SOLVED]

Hi, I've four nRF24L01+ boards, those cheap ones you can get on eBay from China and I' experiencing some weird issue.

I previously setup the ping/pong example in the RF24 library from maniacbug, but now something is not working anymore and I'm struggling to figure out what might be the problem.

I'm running two Arduino Micro and I'm quite sure the wiring is fine because the [iRF24::]printDetails()[/i] function outputs, for both of them:

STATUS       = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1      = 0xf0f0f0f0d2 0xf0f0f0f0e1
RX_ADDR_P2-5      = 0xc3 0xc4 0xc5 0xc6
TX_ADDR      = 0xf0f0f0f0d2
RX_PW_P0-6    = 0x08 0x08 0x00 0x00 0x00 0x00
EN_AA        = 0x3f
EN_RXADDR     = 0x03
RF_CH        = 0x4c
RF_SETUP      = 0x07
CONFIG       = 0x0f
DYNPD/FEATURE     = 0x00 0x00
Data Rate    = 1MBPS
Model        = nRF24L01+
CRC Length   = 16 bits
PA Power     = PA_HIGH
Carrier is: 0

I then put one in transmission mode, which causes the address change reported as

STATUS       = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1      = 0xf0f0f0f0e1 0xf0f0f0f0d2
RX_ADDR_P2-5      = 0xc3 0xc4 0xc5 0xc6
TX_ADDR      = 0xf0f0f0f0e1
RX_PW_P0-6    = 0x08 0x08 0x00 0x00 0x00 0x00
EN_AA        = 0x3f
EN_RXADDR     = 0x03
RF_CH        = 0x4c
RF_SETUP      = 0x07
CONFIG       = 0x0f
DYNPD/FEATURE     = 0x00 0x00
Data Rate    = 1MBPS
Model        = nRF24L01+
CRC Length   = 16 bits
PA Power     = PA_HIGH
Carrier is: 0

The code I'm running is a slightly modified version of the library pingback example and it's available as gist https://gist.github.com/rlogiacco/8407545#file-pingpong-ino.

I triple checked the connections and I'm quite sure if I had any bad wiring I wouldn't be able to retrieve valid data with the printDetails function, that's the reason why I'm not posting the wiring here, but if you believe there's a possibility wiring is involved I will submit that as well.

Anybody willing to help me out here, please?

Both of those responses look fine. You should have a TX_ADDR = 0xf0f0f0f0d2 at one end of the link and TX_ADDR = 0xf0f0f0f0e1 at the other. As you are getting these responses the connections between the arduino and module are correct.

I presume you are getting a "failed." from the transmitting end of link? Have you added a capacitor across the power pins of the modules? Are you using a breadboard to connect the arduino to the modules? If you are I would suggest trying direct connections as some breadboards don't seem to provide reliable connections and long lead lengths could create problems.

crofter: Both of those responses look fine. You should have a TX_ADDR = 0xf0f0f0f0d2 at one end of the link and TX_ADDR = 0xf0f0f0f0e1 at the other. As you are getting these responses the connections between the arduino and module are correct.

Yes, those values are what I get once I have one side set as transmitter (role_ping_out) and the other as receiver (role_pong_back).

crofter: I presume you are getting a "failed." from the transmitting end of link?

That's correct, the transmitter prints "failed." on the serial console while the receiver stays silent.

crofter: Have you added a capacitor across the power pins of the modules?Are you using a breadboard to connect the arduino to the modules? If you are I would suggest trying direct connections as some breadboards don't seem to provide reliable connections and long lead lengths could create problems.

I've no capacitors on my breadboard: are you suggesting to put a 22pF capacitor (just making up a value) between the Vcc and GND connections going into the nRF24 board? I would understand why doing that with an analog read pin, but what would be the purpose there? The power is getting straight from the regulated pin from the Arduino....

Just thinking at my previously running setup I have introduced a big 870 pins breadboard, but I would never thought that might have been the source of my troubles..... let's try remove it

rlogiacco: I've no capacitors on my breadboard: are you suggesting to put a 22pF capacitor (just making up a value) between the Vcc and GND connections going into the nRF24 board? I would understand why doing that with an analog read pin, but what would be the purpose there? The power is getting straight from the regulated pin from the Arduino....

If you do a search of the forums you will find that many people have had the same problem as you and it is solved by sorting out the 3.3v supply rail. The 3.3v supply from the arduino has little smoothing and it really affects the nRF24l01. I solder an electrolytic/tantalum capacitor of any value between 1uF and 100uF directly across the VCC/GND pins on all my nRF24l01 modules. You could try adding it on the breadboard as an interim measure.

crofter: If you do a search of the forums you will find that many people have had the same problem as you and it is solved by sorting out the 3.3v supply rail. The 3.3v supply from the arduino has little smoothing and it really affects the nRF24l01. I solder an electrolytic/tantalum capacitor of any value between 1uF and 100uF directly across the VCC/GND pins on all my nRF24l01 modules. You could try adding it on the breadboard as an interim measure.

Thanks a million crofter, that solved the problem.

I replaced the breadboard and reduced the wiring with no joy, but as soon as I introduced the mentioned capacitors (I used electrolytics of 1uF) everything started to work again. It's weird I didn't have to use any capacitor in my very first test, but I'm happy it works now.

I'm going to add a post on my blog on this.