NRF24l01 + PA + LNA | Not Getting Data

As instructed I followed This tutorial https://forum.arduino.cc/index.php?topic=421081.0 made by a fellow user named Robin2. The pins are correct and the sample code

Tx - Transmitter

// SimpleTx - the master or the transmitter

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.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 );
    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;
}

Receiver

// SimpleRx - the slave or the receiver

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.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();
    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;
    }
}

Its stuck at “SimpleRx Starting” So I followed Reply #29 which diagnose this sort of problem as it just tests the connection between the Arduino and its nRF24 without attempting to send or receive any data to / from another nRF24.

See Attachment Below.

Questions:

  1. ) What did you use to power Arduino
  • For the Transmitter I used 9v and for the Receiver I used the laptop’s usb port (Im thinking that the voltage in the usb port cannot power NRF24l01)

2.) There’s a lot of topics that includes “NRF24l01 is not Working”

  • Yeah I spent my time searching it and none of them works, although Im planning to buy 5V-3.3V VCC Adapter Board for NRF24L01 Wireless Module maybe that might fix it.
  1. ) What battery are you using?
  • Ultra Alkaline

DiagnosticTest.txt (2.57 KB)

How are the radios powered? By the 3.3V regulator of the Arduinos? Have you tried a 10 to 100uF cap across the rf24 power pins?

although Im planning to buy 5V-3.3V VCC Adapter Board for NRF24L01 Wireless Module maybe that might fix it.

Definitely a good move. I build my own adapter boards just like those and have very few problems with my rf24 projects.

A common problem with nRF24 modules is insufficient 3.3v current from the Arduino 3.3v pin. 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.

I believe it is also important to have a reasonable distance (perhaps a few metres) between the high-module and the receiver module.

...R

groundFungus:
How are the radios powered? By the 3.3V regulator of the Arduinos? Have you tried a 10 to 100uF cap across the rf24 power pins?
Definitely a good move. I build my own adapter boards just like those and have very few problems with my rf24 projects.

There is no regulator in the NRF24l01 it is directly connected to a 3.3v in Arduino.

Dichill:
There is no regulator in the NRF24l01 it is directly connected to a 3.3v in Arduino.

That is likely to be the problem - the Arduino 3.3v pin cannot provide enough current. See Reply #2

...R