NRF24L01 is sending incorrect data

Hey Guys,

I'm new here and I'm currently testing two NRF24L01-modules, cause I want to use them to control a drone. To try out the modules, I did copy two little scetches in which a short text or a number should be transmitted.

As transmitter I'm using an Arduino Due as shown in the following picture:
grafik

With the sketch for the transmitter:

Receiver is an Arduino MKR Wifi 1010. The cabling with the NRF24L01-module:

With the sketch for the receiver:

It's my first time trying to set up a wireless connection via Arduino. Unfortunately, the topic causes me a little more problems than I thought.
The both NRF24L01-modules appear to be connected, but the received data is incorrect. If I transmit "Hello World" as shown in the example, I get weird signs on the receiver:
grafik

If I transmit the number "1", I get the number "9" in the received data.

After many researches I installed a 100 µF capacitor between VCC & GND to equalize fluctuations in the power supply. Furthermore I did test many programm examples to get the radio transmission to work and searched in a lot of forums to get a solution. But without success. The problem always persisted.

Does anyone have a tip or an approach for me, please?
I would be grateful for every tip!

Best regards
Max

Welcome. It probably isn't the kind of tip you were looking for, but you missed the part of the introduction about posting code. Please post it in inline text, using code tags. Not screen shots.

How much current can the MKR supply on 3.3V output?

Sry! Here is my Code again.

For the transmitter:

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

//create an RF24 object
RF24 radio(7, 8);  // CE, CSN

//address through which two modules communicate.
const byte address[6] = "00001";

void setup()
{
  radio.begin();
  
  //set the address
  radio.openWritingPipe(address);
  
  //Set module as transmitter
  radio.stopListening();
}
void loop()
{
  //Send message to receiver
  const char text[] = "Hello World";
  radio.write(&text, sizeof(text));
  
  delay(1000);
}

For the receiver:

//Include Libraries
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

//create an RF24 object
RF24 radio(6, 4);  // CE, CSN

//address through which two modules communicate.
const byte address[6] = "00001";

void setup()
{
  while (!Serial);
    Serial.begin(9600);
  
  radio.begin();
  
  //set the address
  radio.openReadingPipe(0, address);
  
  //Set module as receiver
  radio.startListening();
}

void loop()
{
  //Read the data if available in buffer
  if (radio.available())
  {
    char text[32] = {0};
    radio.read(&text, sizeof(text));
    Serial.println(text);
  }
}

I measured 7 mA. Thanks for this notice! Maybe the current is to low. According to the datasheet the NRF24L01-modules need until 45 mA for receiving and until 115 mA for transmitting.
But there are many examples where the radio modules should work with an Arduino UNO R3, where the current according to the datasheet only is 20 mA and it seems to work, although the current is to low. Then how is this even possible?

It is pointless to work with your own code until you have succeeded with the simplest code form a good tutorial.

Which tutorial or guide should also cover the complete setup - wiring, power, antennae, filtering, distance between units and so forth.

There are many tutorials, if none work it might start to make a person think you have one or two defective modules.

Skip over no details mentioned in any tutorial.

That radio set works great, but it can be a bit of a challenge to get the first "Hello World!" style messages flying.

google for guides, skip any that are instructables just to save time. :wink:

a7

How did you measure that? The maximum current that a source can produce, can only be determined by short circuiting the output (since otherwise, the current is determined by the load device). Did you do a short circuit measurement? I doubt it. Also you can't really measure it directly, if there is output circuit protection in the form of current limiting. Instead, I was hoping you would check the specs.

The MKR must be able to supply more than that at 3.3V, and you really, really need to check.

Hello Guys,

thanks for your answers!
I checked a new datasheet of the NRF24L01+ and noticed, that the current of the modules has to be about 12 mA. Now I did take two of the Arduino Uno R3 with >20 mA and the radio connection works!

I will try the radio transmission of some sensor data.

Thank you for your help guys!

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