NRF24L01 Network issues

Hello,
I am working on a project which requires multiple NRF24 modules to communicate and send information.
one NRF24 is connected to a UNO and the other NRF24 is connected to a nano.

I am using NRF24Network library

Here is the code I am running on my UNO:

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

RF24 radio(10, 9);
RF24Network network(radio);

const uint16_t mainUNO = 00;
const uint16_t entryPh1 = 01;

void setup() {
  Serial.begin(9600);
  SPI.begin();
  radio.begin();
  network.begin(90, mainUNO);
  radio.setDataRate(RF24_2MBPS);
}

void loop() {
  
  network.update();
  while(network.available()){
    char Data[32];
    RF24NetworkHeader header;
    network.read(header, &Data, sizeof(Data));
    Serial.println(Data);
  }
  if(Serial.available()){
    char Data[32];
    Serial.readString().toCharArray(Data, 32);
    Serial.println(Data);
    RF24NetworkHeader headerEntryPh1(entryPh1);
    if(network.write(headerEntryPh1, &Data, sizeof(Data))){
      Serial.println(" - Sent");
    }
    else{
      Serial.println(" - not sent");
    }
  }
}

And this is the code that i am running on my nano:

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

RF24 radio(10, 9);
RF24Network network(radio);

const uint16_t mainUNO = 00;
const uint16_t entryPh1 = 01;

void setup() {
  Serial.begin(9600);
  SPI.begin();
  radio.begin();
  network.begin(90, entryPh1);
  radio.setDataRate(RF24_2MBPS);
}

void loop() {
  network.update();
  while (network.available()) {
    char Data[32];
    RF24NetworkHeader header;
    network.read(header, &Data, sizeof(Data));
    Serial.println(Data);
  }
  if (Serial.available()) {
    char Data[32];
    Serial.readString().toCharArray(Data, 32);
    Serial.println(Data);
    RF24NetworkHeader headerMain(mainUNO);
    if (network.write(headerMain, &Data, sizeof(Data))) {
      Serial.println(" - Sent");
    }
    else {
      Serial.println(" - not sent");
    }
    Serial.read();
  }
}

I have checked the wiring multiple times even reconnected it multiple times. but I am able to send message from UNO to nano but it does not go from nano to UNO.

I tried also switching the hardware around exchanging the code on both the devices but no use.

Circuit diagram for nano and the UNO is directly connected to the nrf24 so I have just given the pinouts

How are you powering the nRF24s? It seems to be the situation that the 3.3v pin on a nano cannot provide enough current for an nRF24 when transmitting. For testing try powering the nRF24 with a pair of AA alkaline cells (3v) with the battery GND connected to the Arduino GND.

If all the nRF24s are within range of the Master then there is probably no need to use the Network library. Have a look at this Simple nRF24L01+ Tutorial. It includes an example for a master and 2 slaves that can easily be extended to a larger number of slaves.

...R

Robin2:
How are you powering the nRF24s? It seems to be the situation that the 3.3v pin on a nano cannot provide enough current for an nRF24 when transmitting. For testing try powering the nRF24 with a pair of AA alkaline cells (3v) with the battery GND connected to the Arduino GND.

If all the nRF24s are within range of the Master then there is probably no need to use the Network library. Have a look at this Simple nRF24L01+ Tutorial. It includes an example for a master and 2 slaves that can easily be extended to a larger number of slaves.

...R

Yes, currently they are being powered directly from the boards 3v3 pin.
I have got 2 AA batteries to use as external power.
One question. These batteries should be in series right? Since battries are 1.5V

And I am using the network library since I thought it will be easier for me to code since I don't have to do startListening() or stopListening(). The library takes care of that. This was kind of a lazy choice and i thought i might not make much difference in my case. And yes the NRF modules are close to each other (2-3 meters).

akshatg1994:
One question. These batteries should be in series right? Since battries are 1.5V

Yes, that's why I said 3v in Reply #1

And I am using the network library since I thought it will be easier for me to code since I don't have to do startListening() or stopListening(). The library takes care of that. This was kind of a lazy choice and i thought i might not make much difference in my case. And yes the NRF modules are close to each other (2-3 meters).

The master-slave example in my Tutorial uses the ackPayload feature which avoids the need for stop- and start-listening

...R

Robin2:
Yes, that's why I said 3v in Reply #1

...R

I tried 3v batteries and none of the messages are passing now.
I switched it back to using 3v3 on board and not working.

And I used the battery setup only on my nano.
The UNO is still giving power to the other NRF 3.3V pin

akshatg1994:
I tried 3v batteries and none of the messages are passing now.

They work fine for me in several projects so you must be doing something wrong.

Are they new batteries? Are they actually producing 3v?

Have you connected the battery GND to the Arduino GND?

...R

Robin2:
They work fine for me in several projects so you must be doing something wrong.

Are they new batteries? Are they actually producing 3v?

Have you connected the battery GND to the Arduino GND?

...R

Yes they are new batteries and they should be producing 3v but I will have to go to college tomorrow to verify that and yes the battery ground is connected to the ground in the nano

akshatg1994:
Yes they are new batteries and they should be producing 3v but I will have to go to college tomorrow to verify that and yes the battery ground is connected to the ground in the nano

I checked the batteries are providing with 3V

Make pencil drawing (one for the Tx and one for the Rx) showing exactly how you have everything connected and post photos of the drawings. (And I do mean "make drawings"- don't use Fritzing and don't post someone else's diagram)

Also post the actual programs that you have uploaded to your two Arduinos.

...R

Robin2:
Make pencil drawing (one for the Tx and one for the Rx) showing exactly how you have everything connected and post photos of the drawings. (And I do mean "make drawings"- don't use Fritzing and don't post someone else's diagram)

Also post the actual programs that you have uploaded to your two Arduinos.

...R

I have uploaded the images for the circuit diagram and the pinout of the nrf.
I am using the same programs as already given in the topic

akshatg1994:
I have uploaded the images for the circuit diagram and the pinout of the nrf.

Where?

They are not in Reply #9 which is the expected place.

...R

Robin2:
Where?

They are not in Reply #9 which is the expected place.

...R

I could not upload in the reply section so i have edited the main thread and added it there

Images from Original Post so we don't have to download them. See this Simple Image Posting Guide

It is very confusing when you make significant changes to older Posts - for the future please post new material in your latest Reply so it is in the correct chronological sequence.

...R

Your diagram does not show any AA alkaline batteries - I thought that was the problem we were trying to solve?

...R

Robin2:
Images from Original Post so we don't have to download them. See this Simple Image Posting Guide

It is very confusing when you make significant changes to older Posts - for the future please post new material in your latest Reply so it is in the correct chronological sequence.

...R

Sorry i am new to the forums still trying to figure out the whole thing.

Robin2:
Your diagram does not show any AA alkaline batteries - I thought that was the problem we were trying to solve?

...R


Sorry, I forgot to add it to the diagram before.
But I thought maybe if I use a 5V2A adapter as a friend suggested to me as it might be useful as I was missing the AA battery holder so taping wires together did not seem a good idea.

You should connect the 5V of the adaptor to 5V not VIN.

Whandall:
You should connect the 5V of the adaptor to 5V not VIN.

I thought the 5V pin was the output, not the direct input for voltage. I was referring to circuito.io for the circuit. and the diagram shown is exactly what the website showed. I am confused now

akshatg1994:
I thought the 5V pin was the output, not the direct input for voltage. I was referring to circuito.io for the circuit. and the diagram shown is exactly what the website showed. I am confused now

Don't assume, read the documentation.

The board can operate on an external supply from 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may become unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.

The power pins are as follows:

Vin. The input voltage to the Arduino/Genuino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.

5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.

3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
GND. Ground pins.