nRF24L01 and UNO R3 Tutorial

Schematic? Code?

Hi guys,,
I have a problem.
I have a uno R3, when I want to connect NRF24l01 module to the uno , the module is hot and I don't know where problem is. :frowning:
If can somebody, please help...
Thanks. :slight_smile:

i am using nRF24l01+ and arduino uno. i use the libraries downloaded from GitHub - maniacbug/RF24: Arduino driver for nRF24L01.

i have connected arduino and nRF24l01+ as foolows
GND to GND
3V3 to 3V3
CE to 9
CSN to 10
SCK to 13
MOSI to 11
MISO to 12

Whenever i am working with the examples given with the libraries i am only getting a lot of ZEROES on the serial monitor(output of radio.printDetails()).

If I run the script I get this in the serial monitor

RF24/examples/GettingStarted/

ROLE: Pong back

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

STATUS = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1 = 0x0000000000 0x0000000000
RX_ADDR_P2-5 = 0x00 0x00 0x00 0x00
TX_ADDR = 0x0000000000
RX_PW_P0-6 = 0x00 0x00 0x00 0x00 0x00 0x00
EN_AA = 0x00
EN_RXADDR = 0x00
RF_CH = 0x00
RF_SETUP = 0x00
CONFIG = 0x00
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1MBPS
Model = nrf24l01
CRC Length = Disabled
PA Power = PA_Min

I worked with a lot of programs but with no success.

i am not at all able to make my nRF24l01+ modules communicate with each other.

Could anyone please help me

I got mine to work recently with this Tutorial.

...R

i tried a lot of different programs.but always getting the above shown output only.

i read somewhere that this output is due to the power problems.So i soldered a 10uF electrolytic capacitor between 1 and 2 pins of nRF24l01+.Initially i was using 3.3V available on my arduino uno to power my nRF24.But i changed that to the 3.3V available on my pi2 but with no success

when i checked the above mentioned tutorial they are advising to use 3.3V,2A adapter which i am not able to find anywhere. It seems only 3.3V 1 A is available. Will that suffice?

I should think 1 amp would be plenty. My NRF24s are powered off the Arduino 3.3v. I don't have a capacitor on the 3.3v power line but perhaps I should.

I have an ESP8266 WiFi module which needs a lot more current than the 3.3v pin can provide so I have made a simple 5v to 3v step down circuit with an LM317 which allows me to power the ESP8266 from the Arduino 5v pin. You should be able to do the same for your NRF24s if necessary.

...R

Thanks a million for all your efforts...helped me a lot!

How to change the data rate?
To Kbps?

D.60

Following the site instructions at : https://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

And using the RF24 library, I was able to get two Arduino Mega 2560's to do the ping reply thing. But, when I attempted to do the same thing for an Arduino 2560 and an UNO R3, the UNO R3 would send, but it would not receive. The UNO R3 appeared to be not working properly.

I had remembered in the back of my mind reading about the need to put a relatively large electrolytic capacitor (eg. 10 microfarad or more) across the Vcc (3.3V) supply and GND. The purpose of the added capacitor was meant to eliminate 'intermittent' problems or 'intermittent' issues.

However, prior to adding such a capacitor on the UNO R3, I wasn't actually experiencing 'intermittent' issues. It was more like a case of getting no-where. I learned that that the capacitor would be essential for getting things to actually work.

So, after adding a 150uF capacitor across the 3.3 V pin and ground (using 'spring action' of the capacitor legs as shown in the photo), the UNO R3 was then able to receive. So, while the 2560 boards were communicating properly without the supply capacitor, the UNO R3 could only function properly when the capacitor was added.

Even so, I think I will also add capacitors (eg. 10 uF) to the 2560 boards - just in case. I was thinking that these kinds of capacitors were usually needed to get chips working properly, not to get a board system to work properly. But anyway, it looks like my UNO R3 absolutely needs a capacitor across supply and ground to get it to do wireless communications with the NRF24L01+ module.

My working setup:

NRF24L01+ pins

1 - Brown - GND
2 - Red - Vcc 3.3 Volt
3 - Orange - CE
4 - Yellow - CSN
5 - Green - SCK
6 - Blue - MOSI
7 - Purple - MISO
8 - no wire connected - IRQ

====

2560 Mega pins

Brown - Gnd
Red - Vcc 3.3V
Orange - 9
Yellow - 53
Green - 52
Blue - 51
Purple - 50

=====

UNO R3 pins

Brown - Gnd
Red - Vcc 3.3V
Orange - 9
Yellow - 10
Green - 13
Blue - 11
Purple - 12

=====

When it came time to using the RF24 library at GitHub - nRF24/RF24: OSI Layer 2 driver for nRF24L01 on Arduino & Raspberry Pi/Linux Devices and applying the example called "GettingStarted.ino", I needed to edit the code for the two boards (ie 2560 board and the UNO R3 board). So I used that template .ino file and created one file for the 2560 board, and one file for the UNO R3 board.

For the 2560 board, I chose it to be 'radio number 0', and edited one of the lines so that it became this : RF24 radio(9,53);

For the UNO R3, I chose it to be 'radio number 1', and edited one of the lines so that it became this: RF24 radio(9,10);

The wireless communications worked just fine. It is highly recommended that the large capacitor between supply and ground be added to avoid getting hung up on unnecessary fault-finding time.

Here are the images attached to reply #28 (so others don't have to download them to view them).

Here's a link to instructions about how to insert an image which has been uploaded (for next time).

You want the capacitors to be as close as possible to the IC which is causing a current spike. In this case, I think you'd be much better off adding a cap to the nRF2401+ boards. I think a 0.1uF would work great soldered between Vdd and Vss. I often add 0603 ceramic caps between the header pins.

In general you want the wires between devices to be as short as possible. I keep lots of Adafruits 3" F/F jumper wires on hand for connecting these sorts of parts together.

I have had no problem with my nRF24s working on an Uno, Mega and Leonardo without a capacitor across the nRF24 power supply.

I built a breadboard Atmega328 version powered by 2 AA batteries and I put a 10µF cap on that - I don't think I ever tried it without the cap.

Subsequently I made a couple of veroboard versions of the breadboard setup and forgot to include the capacitor. One of them worked pretty much OK but the other did not. After a lot of coffee and hair-pulling I realized I had forgotten the capacitors and when I added them the problem went away.

@Southpark, I would be interested to see you program code. I found I had to modify the RF24 library to get it to work the way I wanted - commenting out the powerDown() in the write() function.

I also created a small .h file that contains the channel number, the speed and the basic ID number (pipe) so that if I changed any of these the change would automatically go into both the Tx and Rx programs.

...R

Robin2:
@southpark1, I would be interested to see you program code. I found I had to modify the RF24 library to get it to work the way I wanted - commenting out the powerDown() in the write() function.
...R

First, thanks to Duane for the nice recommendation about how to make photos visible in a post.

Robin, thanks for your reply. The code I used is attached in this post. The only modifications I made were to set the radio number and the pin assignments for CE and CSN pins. This is in relation to the Mega 2560 and UNO R3 wireless communications with NRF24L01+ wireless modules from: Link

Kind regards,

Kenny

mega2560_NRF24_radio.ino (4.68 KB)

uno_NRF24.ino (4.76 KB)

Thanks @Southpark. I have bookmarked your post so I can study the code later today or tomorrow. I broke an Arduino ProMicro last night so I have to get that going again first (just as well I bought 2 of them).

...R

Guys I am trying to establish communication with 2 UNO using NRF24L01, with code mentioned be thread creator!
But I am failing in it with "No radio available" at receiver end!
I read to use of 10u cap on NRF board I did that but still a fail!
I am powering my UNO using a USB which is connected to my comp. so is that the issue?
Do i need to power it up separately or power my UNO with 1A adapter?
Or i can do this with increasing my capacitor and if I use adapter can I steel check my serial monitor?
Sorry if my any question is foolish!
Thanks

yatin:
Guys I am trying to establish communication with 2 UNO using NRF24L01, with code mentioned be thread creator!

You need to be more specific. Post the code YOU are actually using.
And please use the code button </>

so your code looks like this

and is easy to copy to a text editor

I am powering my UNO using a USB which is connected to my comp. so is that the issue?
Do i need to power it up separately or power my UNO with 1A adapter?
Or i can do this with increasing my capacitor and if I use adapter can I steel check my serial monitor?

I have had my nRF24's working fine with an Uno and Mega powered from USB and (as I said in Reply #30) without any capacitors. However capacitors won't hurt.

Have you tried the tutorlial linked in Reply #23 ?

If you post a question at the end of a long Thread I assume you have read ALL of the Thread first.

...R

Now I have discovered that @yatin has his own Thread on this here.

...R

Hello,

I am having the same issue with my Arduinos. I have it hooked up to an Arduino Mega and an Uno. Every time I get a failed response. I tried the tutorial with tutorial that seemed to help others but so far nothing has worked. I got 2 10uF capacitors and hooked them up to VCC+ 3.3V and Ground and I still have the same issue. I used the stock "getting started" code. When I try some of my own code or the code at the top of this thread I get radio not available.

I have attached a picture of how the power and ground are hooked up from my board to the wireless chip. Note red is going to the 3.3V and green is going to the ground on the Mega, the other red is going to VCC on the chip and the purple is going to the GND on the chip.

Any thoughts?

--Stephen

soyfestivo:
I tried the tutorial with tutorial

I used the stock "getting started" code.

You need to post a link so we know exactly what tutorial you used

You need to post the actual programs that YOU compiled and uploaded to your Arduinos.

I got my nRF24s working with this Tutorial

I suggest you use the TMRh20 version of the RF24 library - it solves some problems from the ManiacBug version

The pair of programs in this link may be useful.

...R

Robin2:
You need to post a link so we know exactly what tutorial you used

You need to post the actual programs that YOU compiled and uploaded to your Arduinos.

I got my nRF24s working with this Tutorial

I suggest you use the TMRh20 version of the RF24 library - it solves some problems from the ManiacBug version

The pair of programs in this link may be useful.

...R

Okay, I tried what you did and still no dice. Here is the exact code that I used and the output that I got:

for the transmitter:

#include <SPI.h>
//~ #include <TMRh20nRF24L01.h>
//~ #include <TMRh20RF24.h>
#include <nRF24L01.h> // NOTICE: I had to change to "nRF24L01" rather than just "RF24L01"
#include <RF24.h>


#define CE_PIN   9
#define CSN_PIN 10

// NOTE: the "LL" at the end of the constant is "LongLong" type
// These are the IDs of each of the slaves
const uint64_t slaveID[2] = {0xE8E8F0F0E1LL, 0xE8E8F0F0E2LL} ;

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

int dataToSend[2];

unsigned long currentMillis;
unsigned long prevMillis;
unsigned long txIntervalMillis = 1000;
int txVal = 0;
int ackMessg[6];
byte ackMessgLen = 4; // NB this 4 is the number of bytes in the 2 ints that will be recieved


void setup() {

    Serial.begin(9600);
    Serial.println("Track Control Starting");
    radio.begin();
    radio.setDataRate( RF24_250KBPS );
    radio.enableAckPayload();
    radio.setRetries(3,5); // delay, count
}

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

void loop() {

    currentMillis = millis();
    if (currentMillis - prevMillis >= txIntervalMillis) {

    radio.openWritingPipe(slaveID[0]); // calls the first slave
                                        // there could be a FOR loop to call several slaves in turn
    dataToSend[0] = txVal; // this gets incremented so you can see that new data is being sent
    txVal += 1;
    dataToSend[1] = txVal;
    txVal += 1;
    bool rslt;
    rslt = radio.write( dataToSend, sizeof(dataToSend) );
    Serial.print("\nRSLT (1 = success) ");
    Serial.println(rslt);
    Serial.print("Data Sent ");
    Serial.print(dataToSend[0]);
    Serial.print("  ");
    Serial.println(dataToSend[1]);
    if ( radio.isAckPayloadAvailable() ) {
        radio.read(ackMessg,ackMessgLen);
        Serial.print("Acknowledge received: ");
        Serial.print(ackMessg[0]);
        Serial.print("  ");
        Serial.println(ackMessg[1]);
    }
    prevMillis = millis();
 }
}

for the receiver:

#include <SPI.h>
//~ #include <TMRh20nRF24L01.h>
//~ #include <TMRh20RF24.h>
#include <nRF24L01.h>
#include <RF24.h>

#define CE_PIN   9
#define CSN_PIN 10

// NOTE: the "LL" at the end of the constant is "LongLong" type

const uint64_t   deviceID = 0xE8E8F0F0E1LL; // Define the ID for this slave

int valChange = 1;

RF24 radio(CE_PIN, CSN_PIN);

int dataReceived[2];
int ackData[2] = {12,23};

void setup() {

    Serial.begin(9600);
    delay(1000);
    Serial.println("Hand Controller Starting");
    radio.begin();
    radio.setDataRate( RF24_250KBPS );
    radio.openReadingPipe(1,deviceID);
    radio.enableAckPayload();
    radio.writeAckPayload(1, ackData, sizeof(ackData));
    radio.startListening();
}

void loop() {

    if ( radio.available() ) {
        radio.read( dataReceived, sizeof(dataReceived) );
        Serial.print("Data received Number0 ");
        Serial.print(dataReceived[0]);
        Serial.print(" Number1 ");
        Serial.println(dataReceived[1]);
        radio.writeAckPayload(1, ackData, sizeof(ackData));
        ackData[0] += valChange; // this just increments so you can see that new data is being sent
    }
}

The print outs were:

Track Control Starting

RSLT (1 = success) 0
Data Sent 0  1

RSLT (1 = success) 0
Data Sent 2  3

RSLT (1 = success) 0
Data Sent 4  5

RSLT (1 = success) 0
Data Sent 6  7

RSLT (1 = success) 0
Data Sent 8  9

RSLT (1 = success) 0
Data Sent 10  11

and

Hand Controller Starting
Data received Number0 0 Number1 0
Data received Number0 0 Number1 0
Data received Number0 0 Number1 0
Data received Number0 0 Number1 0
Data received Number0 0 Number1 0
Data received Number0 0 Number1 0
Data received Number0 0 Number1 0
Data received Number0 0 Number1 0
Data received Number0 0 Number1 0
Data received Number0 0 Number1 0
Data received Number0 0 Number1 0
Data received Number0 0 Number1 0

So, as you can see it isn't working.
I have tried fixing it up with what was suggested in this link with the capacitor plan but it hasn't helped. I used this version of the RF24 library.

Any ideas? I doesn't seem that anyone else has had as much of an issue with these as I have. This is day three of my attempts and I'm running out of ideas.

Thanks

You have a comment to say that you needed to change the name from "nRF24L01" to "RF24L01"

I reckon that is the problem - you are (perhaps inadvertantly) using the wrong library.

The simple solution may be to delete whatever RF24 libraries you have installed and then download and install the TMRh20 version again.

You seem to have removed the text with the connection details - I presume you do have the nRF24s connected as the programs expect?

...R