nRF24L01 -> Arduino Uno and Mega.

Hello Guys,

I'm trying to make 2 nRF24L01 communicate with each other. The first module is connected to a Mega2560 and the second is connected to Uno. Some problems have occurred, but the problem will be said in a while. Firstly, wherever on the internet that you may look, you may find the following connections for modules to the Arduinos.

MEGA :

GND -> GND.

VCC -> VCC 3.3V OR EXTERNAL OUTPUT AT THE SAME VOLTAGE.

CE -> 53 OR 8.

CSN -> 9 OR 7.

SCK -> 52.

MOSI -> 51.

MISO-> 50.

UNO :

GND -> GND.

VCC -> VCC 3.3V OR EXTERNAL OUTPUT AT THE SAME VOLTAGE.

CE -> 7.

CSN -> 8.

SCK -> 12.

MOSI -> 10.

MISO -> 11.

After downloading the RF24-master.zip and connecting the modules as said above, nothing happened. I had an error in the pairing. Searching on the internet again, looking at what the problem may be, I started asking myself if the SPI connections are correct. I have found at the Arduino Reference that the connections at the above Arduinos are the below:

ARDUINO MEGA:

MOSI -> 51.

MISO -> 50.

SCK -> 52

SS ->53.

ARDUINO UNO:

MOSI -> 11.

MISO -> 12.

SCK -> 13.

SS -> 10.

The CE and CSN are based on the library that i'm using??

What is correct? Is someone from you that have dealt with connection issues like me?

I'm looking forward to your responses.

This Simple nRF24L01+ Tutorial should help.

Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.

The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work

There is also a connection test program to check that the Arduino can talk to the nRF24 it is connected to.

A common problem with nRF24 modules is insufficient 3.3v current from the Arduino 3.3v pin. This seems to be a particular problem with the nano. The high-power nRF24s (with the external antenna) will definitely need an external power supply. At least for testing try powering the nRF24 with a pair of AA alkaline cells (3v) with the battery GND connected to the Arduino GND.

The code will work with a Mega if you connect the nRF24 like this (as in the SPI library reference)

ARDUINO MEGA:
MOSI -> 51.
MISO -> 50.
SCK -> 52

It does not matter what pins you use for CE and CSN but you should ensure that pin 10 (on the Uno) and pin 53 (on the Mega) are set as OUTPUT to ensure that the Arduino acts as SPI master.

...R

Hello Robin,

I have tried out each module one at a time and I have found out that one module has this problem on both Arduinos. The problem is below in the picture. I have tried the 10 uF cap solution and does nothing.

Any suggestions?

Image from Reply #2 so we don't have to download it. See this Simple Image Posting Guide

...R

Please don’t post images of text. As you can it is unreadable. Just copy and paste the text. If you treat the text as code and use the code button </> it makes things nice and tidy.

…R

Robin2:
Please don’t post images of text. As you can it is unreadable. Just copy and paste the text. If you treat the text as code and use the code button </> it makes things nice and tidy.

…R

I didn’t know it. Now that I will upload it as a code hope that we will come to an answer.

*** PRESS 'T' to begin transmitting to the other node

STATUS		 = 0xff RX_DR=1 TX_DS=1 MAX_RT=1 RX_P_NO=7 TX_FULL=1
RX_ADDR_P0-1	 = 0xffffffffff 0xffffffffff
RX_ADDR_P2-5	 = 0xff 0xff 0xff 0xff
TX_ADDR		 =0xffffffffff
RX_PW_P0-6	 = 0xff 0xff 0xff 0xff 0xff 0xff
EN_AA		 = 0xff
EN_RXADDR	 = 0xff
RF_CH               = 0xff
RF_SETUP          = 0xff
DYNPS/FEATURE = 0xff 0xff
Data Rate           = 1MBPS
Model                 = nRF24L01
CRC Length         = 16 bits
PA Power            =  PA_HIGH

Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.

etc...

This is the module that has the problem. The other at its Serial Monitor, prints these :

RF24/examples/GettingStarted/

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	= 0xe7e7e7e7e7 0xf0f0f0f0d2
RX_ADDR_P2-5	= 0xc3 0xc4 0xc5 0xc6
TX_ADDR		 = 0xe7e7e7e7e7
RX_PW_P0-6	= 0x00 0x20 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

No payloads, no responses etc.

Notice that the modules are completely the same, bought, and put on Arduino at the same time. They get external power from a modulated dc power at 3.3V and are grounded.

As I mentioned earlier, wireless problems can be very difficult to debug and it will be much easier to help if you use the code from my Tutorial that I am familiar with and which has been proven to work by several other Forum members.

If my first example does not work correctly for you then try the connection test program to verify that each of your Arduinos can communicate with the nRF24 it is attached to. Nothing will work if that won't work.

...R

OK, I will try it and I will come back with info.

I tried the Check_Connection sketch. For the module that I said earlier that has the problem(maybe) the Serial Monitor displays:

STATUS		 = 0xff RX_DR=1 TX_DS=1 MAX_RT=1 RX_P_NO=7 TX_FULL=1
RX_ADDR_P0-1	= 0xffffffffff 0xffffffffff
RX_ADDR_P2-5	= 0xff 0xff 0xff 0xff
TX_ADDR		 = 0xffffffffff
RX_PW_P0-6	= 0xff 0xff 0xff 0xff 0xff 0xff
EN_AA		 = 0xff
EN_RXADDR	= 0xff
RF_CH		 = 0xff
RF_SETUP	= 0xff
CONFIG		 = 0xff
DYNPD/FEATURE	= 0xff 0xff
Data Rate	 = 1MBPS
Model		 = nRF24L01
CRC Length	 = 16 bits
PA Power	 = PA_HIGH

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

STATUS		 = 0xff RX_DR=1 TX_DS=1 MAX_RT=1 RX_P_NO=7 TX_FULL=1
RX_ADDR_P0-1	= 0xffffffffff 0xffffffffff
RX_ADDR_P2-5	= 0xff 0xff 0xff 0xff
TX_ADDR		 = 0xffffffffff
RX_PW_P0-6	= 0xff 0xff 0xff 0xff 0xff 0xff
EN_AA		 = 0xff
EN_RXADDR	= 0xff
RF_CH		 = 0xff
RF_SETUP	= 0xff
CONFIG		 = 0xff
DYNPD/FEATURE  = 0xff 0xff
Data Rate	 = 1MBPS
Model		 = nRF24L01
CRC Length	 = 16 bits
PA Power	 = PA_HIGH

And for the second module, the Serial Monitor displays:

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

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

STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0x0000000106
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xe7e7e7e7e7
RX_PW_P0-6 = 0x00 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x4c
RF_SETUP         = 0x27 
CONFIG = 0x0c
DYNPD/FEATURE 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_HIGH

I changed Arduinos for the first module but the serial monitor continues to display the same. So, if there is no false connection, the module might be dead on arrival.

The first module is definitely not giving the correct response.

Have you tried the “working” nRF24 on the “non-working” Arduino ?

…R

Robin2:
The first module is definitely not giving the correct response.

Have you tried the "working" nRF24 on the "non-working" Arduino ?

...R

What do you mean?

Both of the Arduinos read data from the module that is "correct" and both of them doesn't read data from the "non-working" module.

electp:
Both of the Arduinos read data from the module that is "correct" and both of them doesn't read data from the "non-working" module.

That is what I wanted to know. It suggests that the wiring is correct and the module may be faulty.

...R

Robin2:
That is what I wanted to know. It suggests that the wiring is correct and the module may be faulty.

...R

Yeap.. Thank you for your help!