NRF24L01 Not working with arduino nano

So, I just purchased 3 arduino NANO and wanted to use them as a way to communicate by rf, however when I uploaded the code litteraly nothing happens. I dont know if its a problem with my code or with the library but it does not work. (I dont think its the code as, even using the "GettingStarted" code it rejects to work properly). My code:

library: https://github.com/nRF24/RF24

what are you using to power the nRF24? I just learned first hand that these nRF modules are very picky about how you power them. You want to make sure that the 3.3v supply can supply enough current (ive seen mentioned >250ma). Power supply also has to be very clean. A lot of recommendations to use a 10uf capacitor as close to the nRF as possible.

I was trying to power my setup with a adjustable output voltage buck converter (12vdc to 3.3vdc) that was capable of supplying up to 3 amps and the nRF did not like it. Then I was trying to use a 3.3v buck-boost converter, supplied with a 1 cell lipo (4.2vdc fully charged) and for some reason it was causing the nRF chip to get really hot and let the smoke out. 2 AA batteries and it worked like a champ.

Have a look at this Simple nRF24L01+ Tutorial.

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

As @drummin89 has said, if you have any doubts about the nRF24 power supply try a pair of AA alkaline cells, at least for testing.

...R

Robin2:
Have a look at this Simple nRF24L01+ Tutorial.

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

As @drummin89 has said, if you have any doubts about the nRF24 power supply try a pair of AA alkaline cells, at least for testing.

…R

robin I used the tutorial that you quoted above, but both the transmitter and the receiver are locked in simpleTx starting and simpleRx starting, I performed the connection tests and everything worked, would you know how to help?

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

...R

For the future, please don't post pictures of text, just copy and paste the text.

You have not said how you are powering the nRF24s and that was already mentioned in two earlier Replies.

And do you have 10µF capacitors across Vcc and GND for the nRF24s?

If none of these comments helps solve the problem then ...

  • Post the two programs that YOU have uploaded to your Arduinos.
  • Post two diagrams showing how YOU have connected everything

...R

the arduino uno is powered with the USB ports, the nrf24l01 are powered with 3.3V, when i put the capacitors the transmission circuit changed to
“Data Sent Message 0 Tx failed”, but the receiving circuit continues with “SimpleRx Starting”
follow the codes below

transmission

// SimpleTx - the master or the transmitter

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


#define CE_PIN  7
#define CSN_PIN 8

const byte slaveAddress[5] = {'R','x','A','A','A'};


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

char dataToSend[10] = "Message 0";
char txNum = '0';


unsigned long currentMillis;
unsigned long prevMillis;
unsigned long txIntervalMillis = 1000; // send once per second


void setup() {

    Serial.begin(9600);

    Serial.println("SimpleTx Starting");

    radio.begin();
    radio.setDataRate( RF24_250KBPS );
    radio.setRetries(3,5); // delay, count
    radio.openWritingPipe(slaveAddress);
}

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

void loop() {
    currentMillis = millis();
    if (currentMillis - prevMillis >= txIntervalMillis) {
        send();
        prevMillis = millis();
    }
}

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

void send() {

    bool rslt;
    rslt = radio.write( &dataToSend, sizeof(dataToSend) );
        // Always use sizeof() as it gives the size as the number of bytes.
        // For example if dataToSend was an int sizeof() would correctly return 2

    Serial.print("Data Sent ");
    Serial.print(dataToSend);
    if (rslt) {
        Serial.println("  Acknowledge received");
        updateMessage();
    }
    else {
        Serial.println("  Tx failed");
    }
}

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

void updateMessage() {
        // so you can see that new data is being sent
    txNum += 1;
    if (txNum > '9') {
        txNum = '0';
    }
    dataToSend[8] = txNum;
}

receiving

// SimpleRx - the slave or the receiver

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

#define CE_PIN  7
#define CSN_PIN 8

const byte thisSlaveAddress[5] = {'R','x','A','A','A'};

RF24 radio(CE_PIN, CSN_PIN);

char dataReceived[10]; // this must match dataToSend in the TX
bool newData = false;

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

void setup() {

    Serial.begin(9600);

    Serial.println("SimpleRx Starting");
    radio.begin();
    radio.setDataRate( RF24_250KBPS );
    radio.openReadingPipe(1, thisSlaveAddress);
    radio.startListening();
}

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

void loop() {
    getData();
    showData();
}

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

void getData() {
    if ( radio.available() ) {
        radio.read( &dataReceived, sizeof(dataReceived) );
        newData = true;
    } 
}

void showData() {
    if (newData == true) {
        Serial.print("Data received ");
        Serial.println(dataReceived);
        newData = false;
    }
}

for the test i use this code

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

#define CE_PIN  7
#define CSN_PIN 8

const byte thisSlaveAddress[5] = {'R','x','A','A','A'};

RF24 radio(CE_PIN, CSN_PIN);

char dataReceived[10]; // this must match dataToSend in the TX
bool newData = false;


void setup() {
    Serial.begin(9600);
    printf_begin();

    Serial.println("CheckConnection Starting");
    Serial.println();
    Serial.println("FIRST WITH THE DEFAULT ADDRESSES after power on");
    Serial.println("  Note that RF24 does NOT reset when Arduino resets - only when power is removed");
    Serial.println("  If the numbers are mostly 0x00 or 0xff it means that the Arduino is not");
    Serial.println("     communicating with the nRF24");
    Serial.println();
    radio.begin();
    radio.printDetails();
    Serial.println();
    Serial.println();
    Serial.println("AND NOW WITH ADDRESS AAAxR  0x41 41 41 78 52   ON P1");
    Serial.println(" and 250KBPS data rate");
    Serial.println();
    radio.openReadingPipe(1, thisSlaveAddress);
    radio.setDataRate( RF24_250KBPS );
    radio.printDetails();
    Serial.println();
    Serial.println();
}


void loop() {

}

and I got this

ChecCheckConnection 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 = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 =0xe7e7e7e7e7 0x0000000100
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_MAX

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 = 0x0f
DYNPD/FEATURE = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX

conections
v+ 3,3V
gnd gnd
csn 8
ce 7
mosi 11
sck 13
misc 12

solihull: the arduino uno is powered with the USB ports, the nrf24l01 are powered with 3.3V,

This like getting blood from a stone ...

WHERE does the 3.3v come from?

...R

Hi

Regarding the capacitor for the nRF24 I normally find it's a must when powered via any sort of linear regulator, so pretty much needed all the time, but off batteries it's not required in my experience. I think it's just something like a linear regulator just doesn't react quick enough to the power draw. Regardless of a capacitor the nRF24 will work to query it and receive transmissions, just fails to send anything out which is when the power is needed.

In terms of capacitor value I would go for a 100uF to be sure, I've used less before and had problems, of course once things are working you could try reducing the capacitor value.

The radio.printDetails() shows you have no communication with the nRF24 module. It's really a case of double checking the connections.

Also when you upload to the Nano are you choosing the correct board type? If not the digital pins could be mapped against different physical pins.

A sanity check would be to bring the CE and CS pins high with pinMode as output and then digital write them high and check you have 3.3 Volt on both those pins. I had an issue once like this and it was because the compatible board I was using had slightly different pin mappings to what I was targeting.

Have you tried a different nRF24 incase you've zapped this one with static or it's faulty?

LC200: The radio.printDetails() shows you have no communication with the nRF24 module.

Have I missed something? How did you come to that conclusion?

...R

Robin2:
Have I missed something? How did you come to that conclusion?

…R

Your right, it is communicating okay, there is data there, I just mistook the many zero’s for no coms.