NRF24L01+ has <50ft of range

I've been using NRF24L01+ modules for nearly 2 years without any issues, and have consistently achieved a range >100ft in the past. Recently, when I uploaded some new code to the modules, I found they had a range of <50ft (with no obstructions), which is insufficient for my needs. I figured my code was bad, so I tried two getting started/hello world codes from tutorials which I have attached and linked below. Each program gave similarly poor ranges, even though I have achieved >50ft (probably >100ft) range with them in the past. I am using v1.1.7 of the TMRh20 version of the RF24 library, as instructed in the Robin2 tutorial linked below. Because the "known good" software that had worked in the past didn't fix the issue, I assumed I must have had a hardware issue.

For these tests, I was using Elegoo Unos (info below) as the transmitter and receiver. I wired everything according to the directions on the tutorials. 10uf capacitors were used for the 3.3v input to the module. I tried two different radio modules (links below) and still had the same issue. I substituted in an Elegoo Nano (again wired according to the tutorials) and saw no change.

At this point, I figured I had tried all the obvious issues, so I got creative and tested the following:

different versions of the ide: (1.8.13 and 1.8.15)
different computers, usb ports, and usb cables
a different testing location (miles away) in case there was some weird interference
different channels
different PA levels
different driver versions
different module orientation
powering the transmitter from a power brick instead of a computer
different wires between Arduinos and radios

Unfortunately, none of these fixed my low range issue, and I have no idea what to try next. If anyone has any suggestions for how to fix/troubleshoot this issue, I would be greatly appreciative. This is my first time using the forum, so sorry in advance for any formatting errors.

Robin2 code
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;
    }
}

How To Mechatronics code
Transmitter code:

/*
* Arduino Wireless Communication Tutorial
*     Example 1 - Transmitter Code
*                
* by Dejan Nedelkovski, www.HowToMechatronics.com
* 
* Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/

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

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

const byte address[6] = "00001";

void setup() {
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();
}

void loop() {
  const char text[] = "Hello World";
  radio.write(&text, sizeof(text));
  delay(1000);
}

Receiver Code:

/*
* Arduino Wireless Communication Tutorial
*       Example 1 - Receiver Code
*                
* by Dejan Nedelkovski, www.HowToMechatronics.com
* 
* Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/

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

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

const byte address[6] = "00001";

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(0, address);
  radio.setPALevel(RF24_PA_MIN);
  radio.startListening();
}

void loop() {
  if (radio.available()) {
    char text[32] = "";
    radio.read(&text, sizeof(text));
    Serial.println(text);
  }
}

Robin2 tutorial

How To Mechatronics tutorial
https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/)

Elegoo Uno info:

Radio modules:

Sorry for all the different posts, but as a new user, I can only post 2 links at a time.

Do you still have the old code to verify that it still has the larger range?

There are two reasons for range to fall, changing the TX and RX parameters (baud-rate for instance), or more interference. The interference could be related to the software if the modules are picking up hash from the microcontroller board. If you can screen the microcontroller, or increase the separation between radio module and microcontroller that might provide information.

BTW the 2.4GHz band is used by microwave ovens, industry, there could be other sources of interference that have popped up recently.

I have tried using the old codes and got the same results. They are modifications of the hello world codes attached (meaning they use almost identical code to send/receive data) so it makes sense that the issues carry over. I should have stated this more clearly in my original post.

I tested the modules 16in away from the Arduinos and saw no change. Out of curiosity, I also tested with the modules right next to the Arduinos and got the same results.

I'm aware that there's a lot of interference with 2.4GHz so I will try a different module with a different frequency.

Thanks for the Help!

Up until about a year ago I had over a dozen nRF24L01 radios running in my house and out buildings. Then I discovered LoRa radio modules(915 mhz) and have replaced all my nRF24's
with these modules. Now all my nRF's are in the junk drawer unused. No more drop-outs or garbled messages now.
And the Lora 's were purchased from Tindie at about the same price as the nRF's. I even put a LoRa set-up a quarter mile away at a neighbors house and it worked great for a week long test run. Also, I live in a aluminum sided house, LoRa punches right through. I have one out building about eighty feet from the house and another about one hundred twenty feet from the receiver in the house. These radios provide door alarms, fire, smoke, and temperature in both buildings as well as in the house. It's certainly your choice but I would junk those nRfF's and switch to LoRa's.

I have had excellent luck with DORJI DRF1262DS LoRa modules.
DORJI makes many different LoRa modules also.

I looked into LoRa, but decided against it since I don't have the space to easily put a voltage divider and they were kind of expensive. Instead, I bought a HC-12 module here. As far as I can tell, it works perfectly. I guess that means this issue is "solved".

For anyone else experiencing this issue, this seems to prove that the problem (for me at least) was not with my Arduinos, computer, various methods of supplying power, drivers and ide version. Maybe there was interference in both places I tried? Maybe the new modules I bought were defective? Who knows.

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