NRF24L01 problem

Hello to everyone. I'm sorry for my bad english. I'm using google translate. I have been using nrf24l01 before, without any problem between two arduino uno. I removed it to make a new remote for myself. The codes I used have also been deleted. While doing research, I found Robin2's demo about Nrf24l01. I applied the ones mentioned there carefully, but nrf24l01s are not connecting. I use voltage regulator.
pin array 9 = Ce 10 = CSN 11 = Mo 12 = Mi 13 = SCK GND 5V
When I use the code that Robin2's shares for one-way communication, I get a result like the picture.
When I change the codes in the arduinos (Tx and Rx), the screen is like the picture named nrf242.

Waiting for your help and thank you in advance.


jackal_949:
When I use the code that Robin2's shares for one-way communication, I get a result like the picture.
When I change the codes in the arduinos (Tx and Rx), the screen is like the picture named nrf242.

You need to post the programs (both Tx and Rx) that are causing the problem.

I suspect the images in your Original Post are pictures of text. If so please just copy and paste the text. If I am wrong then please make your images visible in your Post. See this Simple Image Posting Guide

...R

is it ok?

SimpleTx.ino

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

SimpleRx.ino

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

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

CheckConnection.ino

// 18 Mar 2018 - simple program to verify connection between Arduino
//      and nRF24L01+
//  This program does NOT attempt any communication with another nRF24

#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);
    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() {

}

when i write this code the result from the first nrf;

this is from the second nrf;

Please just copy and paste the text from the Serial Monitor. I mentioned this in Reply #1. Those images are impossible to read.

...R

The images are visible in the browser I use. Right click and select "view image".

The data returned by "first nrf" looks very sparse and completely unresponsive to the attempts to change the data rate/address, and mainly showing 0x08 instead of data.

Try swapping just the NRF24L01 transceivers between the circuits and see if the problem moves to the other side.

6v6gt:
The images are visible in the browser I use. Right click and select "view image".

I can see the images, but I can't read the tiny print.

...R

Robin2:
I can see the images, but I can't read the tiny print.

...R

NRF24 1 ;
CheckConnection 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

SPI Speed = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x0808080808 0x0808080808
RX_ADDR_P2-5 = 0x08 0x08 0x08 0x08
TX_ADDR = 0x0808080808
RX_PW_P0-6 = 0x08 0x08 0x08 0x08 0x08 0x08
EN_AA = 0x08
EN_RXADDR = 0x08
RF_CH = 0x08
RF_SETUP = 0x08
CONFIG = 0x08
DYNPD/FEATURE = 0x08 0x08
Data Rate = 2MBPS
Model = nRF24L01
CRC Length = 8 bits
PA Power = PA_MIN

AND NOW WITH ADDRESS AAAxR 0x41 41 41 78 52 ON P1
and 250KBPS data rate

SPI Speed = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x0808080808 0x0808080808
RX_ADDR_P2-5 = 0x08 0x08 0x08 0x08
TX_ADDR = 0x0808080808
RX_PW_P0-6 = 0x08 0x08 0x08 0x08 0x08 0x08
EN_AA = 0x08
EN_RXADDR = 0x08
RF_CH = 0x08
RF_SETUP = 0x08
CONFIG = 0x08
DYNPD/FEATURE = 0x08 0x08
Data Rate = 2MBPS
Model = nRF24L01
CRC Length = 8 bits
PA Power = PA_MIN

NRF242;

CheckConnection 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

SPI Speed = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0x4141417852
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 = 0x0e
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

SPI Speed = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0x4141417852
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 = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX

In Reply #7 the second pair of outputs suggest that communication between the Arduino and the nRF24 is working properly.

The first pair suggests that it is not working. It would be a good idea to disconnect and reconnect power after uploading the test program to make sure the nRF24 resets.

...R

PS ... For the future, when posting text that is the output from a program it makes things neater if you use the code button - like you would for posting program code.

6v6gt:
The images are visible in the browser I use. Right click and select "view image".

The data returned by "first nrf" looks very sparse and completely unresponsive to the attempts to change the data rate/address, and mainly showing 0x08 instead of data.

Try swapping just the NRF24L01 transceivers between the circuits and see if the problem moves to the other side.

yes, when I just replace nrf24, there are the same results in Nrf24 (1) again. 0x08

Robin2:
In Reply #7 the second pair of outputs suggest that communication between the Arduino and the nRF24 is working properly.

The first pair suggests that it is not working. It would be a good idea to disconnect and reconnect power after uploading the test program to make sure the nRF24 resets.

...R

PS ... For the future, when posting text that is the output from a program it makes things neater if you use the code button - like you would for posting program code.

Yes. I turned off the power but there are still the same results.

jackal_949:
Yes. I turned off the power but there are still the same results.

The most likely reason for a failure to communicate between an Arduino and its nRF24 is a wrong or loose connection.

If the wiring is definitely good then it is worth suspecting that the nRF24 is faulty - do you have a spare that you can substitute?

...R

Robin2:
The most likely reason for a failure to communicate between an Arduino and its nRF24 is a wrong or loose connection.

If the wiring is definitely good then it is worth suspecting that the nRF24 is faulty - do you have a spare that you can substitute?

...R

I checked the cables. I replaced it with other nrf and the result is still unchanged. I don't have any other NRF, I'll buy a new one. I'm ordering now. The circuit where I installed Robin2 has L298N motor driver. I connect 12V 3-5 A power to motor drive. L298N motor driver can output 5v. Can I power the voltage regulators of nrf24s with this 5v power? Any problems? You remember talking about connecting a different power supply in one of your posts.

jackal_949:
I checked the cables. I replaced it with other nrf and the result is still unchanged.

I interpret that to mean that you are having trouble with the system that has nRF24 B attached to it and when you tried nRF24 A in the same system the result was unchanged. Now what happens if you try nRF24 B in the system where nRF24 A normally works - that will allow you to confirm that nRF24 B works.

By the way, are both of the nRF24s the low power version with the PCB antennas?

Given that the Arduino cannot communicate with either nRF24 I suspect that the problem is a wiring fault.

The circuit where I installed Robin2 has L298N motor driver. I connect 12V 3-5 A power to motor drive. L298N motor driver can output 5v. Can I power the voltage regulators of nrf24s with this 5v power? Any problems? You remember talking about connecting a different power supply in one of your posts.

IIRC that 5v output from an L298 module is useless - it produces very little current.

...R

Robin2:
I interpret that to mean that you are having trouble with the system that has nRF24 B attached to it and when you tried nRF24 A in the same system the result was unchanged. Now what happens if you try nRF24 B in the system where nRF24 A normally works - that will allow you to confirm that nRF24 B works.

By the way, are both of the nRF24s the low power version with the PCB antennas?

Given that the Arduino cannot communicate with either nRF24 I suspect that the problem is a wiring fault.

IIRC that 5v output from an L298 module is useless - it produces very little current.

...R

You misunderstood me. I'm sorry for my bad english. The Nrf I think is broken is the same. No wiring errors. Other Nrf is running in the same circuit. I don't know much about Nrf, I am newer in this area. I have no idea. What should be the max current to the voltage regulator in the picture?

jackal_949:
You misunderstood me. I'm sorry for my bad english. The Nrf I think is broken is the same. No wiring errors. Other Nrf is running in the same circuit.

It's impossible to know which item you mean by "the same" or "the nRF I think is broken". That's why I gave them identification letters in my Reply #13. Can you please describe your parts like that. (Think of it like giving names to the children in a family).

You are using the high power nRF24s with the external antenna. They introduce extra complications because they need more power and they need to be a good distance from each other (perhaps 3 metres) which can be inconvenient for initial testing. I suggest you get a few of the low power modules (with the PCB antenna) for your initial tests. When you have the low-power modules working you can then try the high-power modules - the software will be identical.

...R

Robin2:
It's impossible to know which item you mean by "the same" or "the nRF I think is broken". That's why I gave them identification letters in my Reply #13. Can you please describe your parts like that. (Think of it like giving names to the children in a family).

You are using the high power nRF24s with the external antenna. They introduce extra complications because they need more power and they need to be a good distance from each other (perhaps 3 metres) which can be inconvenient for initial testing. I suggest you get a few of the low power modules (with the PCB antenna) for your initial tests. When you have the low-power modules working you can then try the high-power modules - the software will be identical.

...R

OK. I ordered a new one. I had two Nrf. This is not my first time.
On the broken Nrf24 Serial monitor screen, which I called Nrf1, the following appeared;

NRF24(1) Broken

CheckConnection 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

SPI Speed = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x0808080808 0x0808080808
RX_ADDR_P2-5 = 0x08 0x08 0x08 0x08
TX_ADDR = 0x0808080808
RX_PW_P0-6 = 0x08 0x08 0x08 0x08 0x08 0x08
EN_AA = 0x08
EN_RXADDR = 0x08
RF_CH = 0x08
RF_SETUP = 0x08
CONFIG = 0x08
DYNPD/FEATURE = 0x08 0x08
Data Rate = 2MBPS
Model = nRF24L01
CRC Length = 8 bits
PA Power = PA_MIN

AND NOW WITH ADDRESS AAAxR 0x41 41 41 78 52 ON P1
and 250KBPS data rate

SPI Speed = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x0808080808 0x0808080808
RX_ADDR_P2-5 = 0x08 0x08 0x08 0x08
TX_ADDR = 0x0808080808
RX_PW_P0-6 = 0x08 0x08 0x08 0x08 0x08 0x08
EN_AA = 0x08
EN_RXADDR = 0x08
RF_CH = 0x08
RF_SETUP = 0x08
CONFIG = 0x08
DYNPD/FEATURE = 0x08 0x08
Data Rate = 2MBPS
Model = nRF24L01
CRC Length = 8 bits
PA Power = PA_MIN

I followed your suggestions, but the result has not changed (cable and circuit change). Nrf2 You said it was working. The result on the serial monitor screen is as follows;

NRF24(2) Working;

CheckConnection 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

SPI Speed = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0x4141417852
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 = 0x0e
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

SPI Speed = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0x4141417852
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 = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX

Also, is there a current limit on the model in the pictures (NRf24l01 and the voltage regulator I use)? I want to feed it with 18650 battery and a separate 5v voltage regulator. What is the minimum and maximum current I should give? I am grateful to you for trying to help.

jackal_949:
I followed your suggestions, but the result has not changed (cable and circuit change). Nrf2 You said it was working. The result on the serial monitor screen is as follows;

Sorry to be a pest, but that is still not clear enough. As far as I know you also have Arduino(1) and Arduino(2).

Does nRF(1) work with either Arduino(1) or Arduino(2)?

Does nRF(2) work with both Arduino(1) and Arduino(2)?

If you are feeding the 18650 battery through a 5v regulator and then using the 5v for the 3.3v regulator I don't think you should have a problem. If you suspect an nRF24 power problem then temporarily power it with a pair of AA alkaline cells and see if that solves the problem.

...R

Yes, I changed Robin 2. Arduino (1) and Arduino (2) and both voltage regulators. I fed it with two AA batteries, but it's the same as Results # 16. NRF (1) (broken?) = 0x08 ...

NRF (1) (broken?)=

SPI Speed = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x0808080808 0x0808080808
RX_ADDR_P2-5 = 0x08 0x08 0x08 0x08
TX_ADDR = 0x0808080808
RX_PW_P0-6 = 0x08 0x08 0x08 0x08 0x08 0x08
EN_AA = 0x08
EN_RXADDR = 0x08
RF_CH = 0x08
RF_SETUP = 0x08
CONFIG = 0x08
DYNPD/FEATURE = 0x08 0x08
Data Rate = 2MBPS
Model = nRF24L01
CRC Length = 8 bits
PA Power = PA_MIN

AND NOW WITH ADDRESS AAAxR 0x41 41 41 78 52 ON P1
and 250KBPS data rate

SPI Speed = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x0808080808 0x0808080808
RX_ADDR_P2-5 = 0x08 0x08 0x08 0x08
TX_ADDR = 0x0808080808
RX_PW_P0-6 = 0x08 0x08 0x08 0x08 0x08 0x08
EN_AA = 0x08
EN_RXADDR = 0x08
RF_CH = 0x08
RF_SETUP = 0x08
CONFIG = 0x08
DYNPD/FEATURE = 0x08 0x08
Data Rate = 2MBPS
Model = nRF24L01
CRC Length = 8 bits
PA Power = PA_MIN

///////

NRF(2) Worked=

CheckConnection 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

SPI Speed = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0x4141417852
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 = 0x0e
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

SPI Speed = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0x4141417852
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 = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX

jackal_949:
Yes, I changed Robin 2. Arduino (1) and Arduino (2) and both voltage regulators. I fed it with two AA batteries, but it's the same as Results # 16. NRF (1) (broken?) = 0x08 ...

First thing is ... You did not change me :slight_smile:

Again this is too confusing. You don't explain what changes you made and you don't explain what Arduino was tested with what nRF24.

I can't think of any reason to change the code in my Tutorial. Please confirm that you are using the code without any changes.

Then you need to describe your tests unambiguously. For example "I tried Arduino(1) with nRF24(1) and I got this result. I tried Arduino(1) with nRF24(2) and I got this result ... etc etc

I know this all sounds very tedious but I know of no other way for the two of us to communicate effectively when we are not together in the same room.

...R