NRF24l01 not receiving data

Hi im trying to use the NRF24l01 to receive data wireless from 1 arduino to another.
i have used Robin´s tutorial for testing the devices, but i can´t get it to work. it does not recive any data at the receiver side and also says the transmission failed at the transmitter side

i have also tried to add radio.setAutoAck(false); which does make it say that the data was sendt, but still nothing on the receiver side

the data from the IC´s both look fine

and both devices are powered from an external 3.3V power supply. Both devices also have a 100µF cap in parallel to the supply.

this is the code i have used:
TX:

// SimpleTx - the master or the transmitter

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


#define CE_PIN   9
#define CSN_PIN 10

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 );
    printf_begin();
    radio.setPALevel(RF24_PA_MIN);
    radio.setRetries(3,5); // delay, count
    radio.openWritingPipe(slaveAddress);
    radio.printPrettyDetails();
    bool result = radio.isChipConnected();
    Serial.println(result);
}

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

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;
}

RX:

// SimpleRx - the slave or the receiver

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

#define CE_PIN   9
#define CSN_PIN 10

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();
    printf_begin();
    radio.setPALevel(RF24_PA_MIN);
    radio.setDataRate( RF24_250KBPS );
    radio.openReadingPipe(1, thisSlaveAddress);
    radio.startListening();
    radio.printPrettyDetails();
    bool result = radio.isChipConnected();
    Serial.println(result);
}

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

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;
    }
}

An inadequate power supply causes many of these problems.

Robins tutorial has a rather misleading diagram:

which does not really make it clear that the grounds of any additional power source must be common also to the Arduino and the radio module.

See also here: RF24/COMMON_ISSUES.md at master · nRF24/RF24 · GitHub

Incidentally, where possible, post text instead of screen shots.

i know the PSU i am using is good enough.
Its a psu i use for almost everything im doing and is able to souce 16Watt at 3.3V.
i have connected the supply correctly with common ground between the NRF24L01 tranceiver and the arduino.

thanks, will try to look at the things from that link. Definitely thinking it can be a noice problem or a problem with a bad ic batch.

it was easier to post a picture showing that there is no data at the output than writing how it looks

Ended up trying to buy some new modules, and ended up working on the first try. Might have been bad ic or one of the devices that did not work from production

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.