1

I am at my wit's end with these Nrf24l01s. A bit of history: I have ordered about 25 of these, tried the adapter board, read every article, tried every sketch (including Robin's tutorial), powered the modules with a separate power supply.

Has anyone else had these issues? Is there anything anyone has discovered on getting these to work? I am 12 years old and am trying to use these for a science project. Any help is greatly appreciated!!

Tnx,
Ricky

edit: I went back to just the simplest "hello world" sketch and I can't even get this to work: nothing received in serial monitor (I did notice the Tx LED is lit in the receiver, is this correct?) Sorry if I posted this wrong.

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

//create an RF24 object
RF24 radio(9, 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);
}

Receiver:

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

//create an RF24 object
RF24 radio(9, 8);  // 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);
  }
}
8
  • 1
    Has anyone else had these issues? ... you did not describe any issues .... Is there anything anyone has discovered on getting those to work? ... many people use them, so yes
    – jsotola
    Feb 1, 2021 at 18:18
  • 3
    please describe what you are doing with the modules and describe how your attempts fail .... and, please ask specific questions that do not have a simple yes/no answer
    – jsotola
    Feb 1, 2021 at 18:20
  • I am building a remote temperature/ humidity sensor. I am using 2 Arduino unos, dht22 sensor and of course the nrf24l01. On the transmitter uno I can open up the serial monitor and see that the temp/ humidity is being displayed correctly so that part is working. I am using the dht22 sensor libarary and the Tmrh24 libarary as recommended. I seem at times to get some Random characters. It seems when I touch the uno the board led tx does flash and acts differently when I hold the uno in my hand vs not. I am using male to female etc wires for connecting. I have also tryed the nrf24l01+ w ant 2
    – Rick E
    Feb 1, 2021 at 19:48
  • 1
    Move the modules further apart, or change the power output in code (radio.setPALevel(RF24_PA_MIN)).
    – Gerben
    Feb 2, 2021 at 10:43
  • 1
    Try using one of the TMRh20's library's examples and get communication working there first.
    – Avamander
    Feb 2, 2021 at 13:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.