NRF24L01 range issue

I’ve followed the tutorial by Robin2 (which as been a great help).

I’ve made some slight changes, They seem to work very well while there close to each other in another room on the same level.

But when I move the TX unit downstairs in the Kitchen I start to miss some counts.

Now I’ve searched the internet and found some stuff to try like from these places
https://blog.blackoise.de/2016/02/fixing-your-cheap-nrf24l01-palna-module/
https://blog.blackoise.de/2016/03/building-a-lc-filter-for-your-nrf24l01-palna-module/

This has made some improvements but still missing some counts may be not as many, Hs you can see

Data received Message 7
Data received Message 8
Data received Message 9
Data received Message 0
Data received Message 1
Data received Message 2
Data received Message 3
Data received Message 4
Data received Message 5
Data received Message 6
Data received Message 7
Data received Message 8
Data received Message 9
Data received Message 0
Data received Message 2
Data received Message 3
Data received Message 4
Data received Message 5
Data received Message 6
Data received Message 7
Data received Message 8
Data received Message 9
Data received Message 0
Data received Message 1
Data received Message 2
Data received Message 3
Data received Message 4
Data received Message 5
Data received Message 6
Data received Message 7
Data received Message 8
Data received Message 0

This is the TX code

// SimpleTx - the master or the transmitter

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
const uint64_t pipeOut = 0xE8E8F0F0E1LL; //IMPORTANT: The same as in the receiver
#define CE_PIN 9
#define CSN_PIN 10
RF24    radio(CE_PIN, CSN_PIN);
//#define DATARATE RF24_2MBPS
//  #define DATARATE RF24_1MBPS
#define DATARATE RF24_250KBPS

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( DATARATE ) ;
  radio.setPALevel( RF24_PA_MAX ) ;
  radio.setChannel(0x6C);
  radio.enableDynamicPayloads() ;
  radio.enableAckPayload();               // not used here
  radio.setRetries(0, 15);                // Smallest time between retries, max no. of retries
  radio.setAutoAck( false ) ;
  radio.printDetails();                   // Dump the configuration of the rf unit for debugging
  radio.powerUp();
  radio.openWritingPipe(pipeOut);
}

//====================

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

RX code

// SimpleRx - the slave or the receiver

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
//#define DATARATE RF24_2MBPS
//  #define DATARATE RF24_1MBPS
#define DATARATE RF24_250KBPS
#define CE_PIN   9
#define CSN_PIN 10
const uint64_t pipeIn =  0xE8E8F0F0E1LL;


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( DATARATE ) ;
  radio.setPALevel( RF24_PA_MAX ) ;
  radio.setChannel(0x6C);
  radio.enableDynamicPayloads() ;
  radio.enableAckPayload();               // not used here
  radio.setRetries(0, 15);                // Smallest time between retries, max no. of retries
  radio.setAutoAck( false ) ;
  radio.openReadingPipe(1, pipeIn);
  radio.printDetails();                   // Dump the configuration of the rf unit for debugging
  radio.powerUp();
  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;
  }
}

It’s still the same even if I use the original code in the tutorial I get the same results.

Now if I was to use the one with the aerial version for the TX would this improve the range to the RX unit without the an aerial ?

Or would I need to use both with aerial’s ?

If I could get away with only using it on the TX unit this would be better for me,

I have no experience of the high-power nRF24s but I believe range will improve with just one high-power unit.

As you are getting pretty good communication with the low power units it may be worth experimenting with the orientation of the antennas before investing in the high-power unit.

For example are the two PCB antennas well clear of other electronics or metal surfaces?
How are they oriented relative to each other?

Of course if you are using one or other as a mobile unit it will be difficult to guarantee ideal orientation.

It would also be a good idea to try different channels in case the problem is due to interference from other 2.4Ghz devices.

2.4Ghz wireless is easily upset by solid walls and floors, especially reinforced mass concrete. The ultimate solution may be to use lower-frequency wireless units such as the HC12 modules.

In one test I had a pair of low-power units communicating reliably at 110metres outdoors with clear line of sight.

...R

Thanks Robin2
There mounted 90Deg on PCB and facing into each other, I have tried in moving them around mounting them vertical and stuff like that.

I think this is the problem is the brick walls and floors. I could try one high power unit to see if that helps would have to buy one.

The units will be fixed and mounted and not mobile which will help.

I had good range outside in line of site which I found out when I was having some issues in thinking that it may be software/hardware issues.

I will have a look at the HC12 modules means there is wall and floors.

Steveiboy:
There mounted 90Deg on PCB and facing into each other,

Think they need to be parallel.

bluejets:
Think they need to be parallel.

Isn't that the same thing as facing each other?

...R

I got a wall and 3 metres further with this:

but since I discovered LoRa modules, my NRF's have gone into retirement.

kayel:
I got a wall and 3 metres further with this:

Thanks for that. I have bookmarked the link. I tend to be rather sceptical about tinkering with 2.4GHz antennas.

I have cut the pcb antenna off an nRF24 board to make it smaller and soldered on a short piece of flexible wire for the antenna. It works for what I want but I have never tested the range - I have assumed it would be worse, but maybe not.

...R

Robin2:
Isn't that the same thing as facing each other?

...R

I read it as antenna pointing directly at eachother which I believe is not correct.

bluejets:
I read it as antenna pointing directly at eachother which I believe is not correct.

Can you provide a simple diagram of what you mean?

...R

Robin2:
Thanks for that. I have bookmarked the link. I tend to be rather sceptical about tinkering with 2.4GHz antennas.

I have cut the pcb antenna off an nRF24 board to make it smaller and soldered on a short piece of flexible wire for the antenna. It works for what I want but I have never tested the range - I have assumed it would be worse, but maybe not.

...R

I did too, Robin. When I get that far with my testing.

By the way using insulated wire for antennas will have a large effect on antenna efficiency at 2.4 gig.

Paul

Paul_KD7HB:
By the way using insulated wire for antennas will have a large effect on antenna efficiency at 2.4 gig.

Interesting.

I have no choice but to use insulated wire.

…R

Robin2:
Interesting.

I have no choice but to use insulated wire.

…R

I understand for your project, but to get max distance, the bare wire will give a bit more distance between boards.

Paul