NRF24L01 detection by arduino uno failed

I was doing a communication project which failed. So I thought I'll use a detection code to check if my nrf modules are being detected. i tried all possible methods i got from different forums and helpful websites.


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

RF24 radio(7, 8);  // CE = 7, CSN = 8 (Change if using different pins)

void setup() {
  Serial.begin(115200);
  Serial.println("Checking for NRF24L01 module...");

  if (!radio.begin()) {
    Serial.println("NRF24L01 NOT DETECTED!");
  } else {
    Serial.println("NRF24L01 Detected Successfully!");
  }
}

void loop() {
}



This is my code used for both arduino.
Both arduino are kept atleast 50cm away.
I can't understand the issue here.

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

Please post your full sketch, using code tags when you do

Posting your code using code tags prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination

In my experience the easiest way to tidy up the code and add the code tags is as follows

Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

It is also helpful to post error messages in code tags as it makes it easier to scroll through them and copy them for examination

HI @shiven_pilgaonkar05 ,

please post your code in code tags, that makes it easier to read and check the sketch:

image

  • The Serial message tells us that the radio module does not respond. Please check the wiring!

This Website gives sound information about the use of NRF24L01 modules and might be of assistance for you:

https://wolles-elektronikkiste.de/en/nrf24l01-2-4-ghz-radio-modules

Good luck!
ec2021

Try the code from this tutorial.
Also I suggest you to wire your sensors directly without breadboard.

I see a fuzzy picture that shows a lot of wires but I cannot follow them. Post an annotated schematic showing exactly how you have wired this. I see several potential hardware problems which you will find as you do the schematic.

Sorry for the late reply!
Here is the schematic you asked for:

Incase you are wondering how the battery is conected to one of the circuit:
(+) of T-Plug female connector is connected to Vin on the Arduino Uno.
(-) of T-Plug female connector is connected to GND pin of the Arduino Uno through the bread board.

Will try.
Also does it matter if I refer to nrf module connections since they show a picture of the module only and not nrf+pa+lna?

Hello friend, I went through the link you provided.
According to them they used an nrf24l01 adapter along with their nrf24l01 module which has an ams1117 voltage regulator in it, and I dont have such an adapter but I do have the voltage regulator needed so should I use it in the circuit or let it be?
Also in the schematic it shows a capacitor which also i have but did not use in the circuit.
What is the rught outcome in this situation?

What is the battery voltage?
3.7V battery is not sufficient to power arduino uno.

This is the battery used:

Pro-Range ISR 18650 7.4V 1300mAh 15C 2S1P Li-Ion Battery Pack

My Arduino recieved enough powerwith it to power an ledbulb-blinking sample model.

My nrf have started detecting after I connected the wires directly to the board. That was one issue but just for readers' further referencing, the antenna near the Arduino cable connecting to the laptop faced issue while the other was fine after solving the first issue then I found the antenna can face disturbances and hence kept moving the antenna to finally recieve a successful detection.

Keep it as a common approach with any uart/i2c/spi communication. Breadboard wiring is unreliable.

Thanks!

Another doubt, my nrf got detected in both the seriel monitors but now after inputing the project code for text transmission the reciever is not able to recieve the text.
Code for Tx:

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

RF24 radio(8, 10); // (CE, CSN)

const byte address[6] = "1RF24"; // address / identifier

void setup() {
  radio.begin();
  radio.openWritingPipe(address); // set the address
  radio.stopListening(); // set as transmitter
}

void loop() {
  const char text[] = "Hi Receiver"; // max. 32 bytes
  radio.write(&text, sizeof(text));
  
  delay(2000);
}

Code for Rx:


```cpp
#include <SPI.h>
#include "RF24.h"

RF24 radio(8, 10); // (CE, CSN)

const byte address[6] = "1RF24"; // address / identifier

void setup() {
  Serial.begin(115200);
  radio.begin();
  radio.openReadingPipe(0,address); // set the address for pipe 0
  radio.startListening(); // set as receiver
}

void loop() {
  if(radio.available()){
    char text[33] = {0}; 
    radio.read(&text, sizeof(text)-1);
    Serial.println(text);
  }
  else{
    Serial.println("Text not found!");
  }
}

Output recieved on seriel monitor:

Could be an issue with the code or does the detection stop for this code?

Hard to say, but it's clear that you get lots of messages "Text not found" ...

loop() is performed several hundreds or even thousands of times per second (depending on what's done n loop()) but you only get "Hi Recever" once every 2 seconds.

I'd recommend to remove the else clause because you might not see the expected message long enough on display.

Try this code on your controller

void setup() {
  Serial.begin(115200);
  Serial.println("Start");
}

unsigned long count = 0;
unsigned long last = 0;

void loop() {
  count++;
  if (millis()-last> 10000){
    last = millis();
    Serial.println(count);
    count = 0;
  }
}

and you can see how many loops() are performed in 10 seconds ...

We thought you resolved this topic...

For future reference, what you show is NOT a circuit diagram as was asked for but one of those almost useless fritzing diagrams.