nRF24L01+ induced headacke

Dear friends,

A few days ago I received two nRF24L01+ PA LNA modules (the larger ones, with a duck-antenna).

I’ve been experimenting with Robin2’s code from his guide, but unfortunately my progress virtually non existent.

My items :

UNO ------ > Adapter module ---- > nRF24L01+ PA LNA (RX)

UNO ------ > Adapter module ---- > nRF24L01+ PA LNA (TX)

RX code :

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

The RX UNO is trowing me :

SimpleRx Starting (and nothing else)

UNO TX code:

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

The TX UNO Serial Monitor is spitting :

Data Sent Message 0 TX failed (once every second)

3v3 to VCC (since I have removed the adapters)
SCLK 13
MISO 12
MOSI 11

CE 9
CSN 10

So I started troubleshooting.

I saw the code on reply #29 *(Robin2 nRF guide), and the code is checking if the nRF module is communicating with the
micro controller.

I saw a lot of 0x00 in the test, so i knew that something was wrong.

I found I that one adapter is probably faulty, while the other was working ok.

I tried to test the modules without the adapters, and you can see the results in the attachment.

I guess the SPI connection between the UNO and the module is ok, correct me if i’m wrong.

Since I ran out of ideas on how to fix the problem, I am asking your help :slight_smile: Please, help me escape from this “dead point” !

In my language, a “dead point” is a place were there is no progress, and I am stuck in one.

Wise colleagues, please help me

In the attachemnt you can find the serial monitor resaults on both UNO's , after I used the code from Robin2's reply #29

I highlighted the differences, one is RX UNO, the other one TX.

I guess the modules are not faulty . . . .

The easiest thing would be to buy new modules, but maybe the problem is in me :confused:

p.s.
All my PLC's and modules came from our favorite cheap supplier from the far East.

Dacha011:
3v3 to VCC (since I have removed the adapters)

I'm not sure what that means but I'm worried. The Arduino 3.3v pin cannot provide enough current for a high power nRF24. You must use an external 3,3v supply. For testing a pair of AA alkaline cells (3v) should work fine - make sure the battery GND is connected to the Arduino GND.

Arduino Vcc is 5v and the nRF24's power should not exceed 3.6v

Please display your image(s) in your post so we can see it(them) without downloading it(them). See this Simple Image Posting Guide

...R

I had this same problem, until I looked over more library examples to see other possibilities in programming. I am attaching what worked for me as I am sending and receiving floating point numbers only and converting them to the desired text. I couldn’t get any of the examples that I had to work, till I fiddled with the code. Also use a seperate 3.2 volt supply well filtered as this was a problem for me.
unlike

Wireless_MotionX_Mover.ino (5.64 KB)

Wireless_MotionX_CMD.ino (4.54 KB)

@Robin2 - I powered the nRF24 modules with a breakout board power supply. But still no communication :confused:
Please take a look at the 2 pics I posted in my previous message, does it look like the RF modules are communication normally with the UNO ?

(The nRF is not a big power consumer, why cant it be powered directly from the PLC board ?
It states in the documentation that the nRF chip consumes 15mA when transmitting in high_power mode ? )


(Disregard that the right UNO is not powered, and the breadboard power supply is off)

@unLike - Thanks for the advice :slight_smile: Unfortunately your code looks a bit bit intimidating for a guy that has programming knowledge as much as I do. I tried to run in on my 2 UNO's, without a deeper understaning of the code - and had no luck.I have just adjusted the SPI par to match my configuration.

Maybe it isn't that complicated, it's just that that i want to make a basic TX RX communication with the user friendly RF24 library.

off-topic :

At this point of my life - this is a great hobby to me.
I work from 9 to 5, and except on weekends, I can't afford to spend more 2 hours during the working days on my Arduino projects. That's why it is so frustrating - during the weekend I can study and explore this beautiful world for much more then 2-3-4 hours - and BOOOM, I get stuck with the simplest nRF sketch :cry: The weekend has almost passed, and my progress in the field of radio communication was almost non existent :cry:

Dacha011:
@Robin2 - I powered the nRF24 modules with a breakout board power supply. But still no communication :confused:
Please take a look at the 2 pics I posted in my previous message, does it look like the RF modules are communication normally with the UNO ?

Yes. But the connection test is not a test of the wireless part of the chip and it is what draws the larger current.

If it was my problem I would try the AA batteries.

...R

One of the problems that I had was the 3.2v supply, using the 2 batteries will give the RF module a filtered supply voltage(low impedance for noise) since the batteries are like a large capacitor. I had to use filter capacitors, 100ufd and a .01ufd for decoupling, very close to the RF module. The long leads may/will be an antenna for noise.

(Disregard that the right UNO is not powered, and the breadboard power supply is off)

Please remove all extraneous items and simplify your circuit.

It is impossible from the photo to figure out how that setup is actually wired. Please post a hand drawn wiring diagram, with pins and parts clearly labeled.

You need 100 uF capacitors across the power terminals of both radios.

I cant post the photo of the schematics since the online circuit builders doesn't have the nRF modules :frowning:
I am 100% sure that I wired the hardware correctly.

In a YT video a guy is having the same configuration as me, and he achieved 1070m range, and I cant even start the simplest program.

So I guess that there is a hardware problem. Is there a method to test if the nRF module is working correctly ? Any thoughts on how to identified the problem ?

I know the attached picture won't help, but it is still better then nothing.

I started using base modules on both UNOs.

Robin2's test code #29 gave me a good response on both modules.

Kind regards,

Dacha011:
I cant post the photo of the schematics since the online circuit builders doesn't have the nRF modules :frowning:

Just get pencil and paper and make a simple drawing. Then post a photo of the drawing.

...R

You were not asked about "schematics".

Please post a hand drawn wiring diagram, with pins and parts clearly labeled.