nRF24L01 problems with range

Hello

I’m trying to get two nRF24L01+ modules to communicate. Very simple, one transmitting one receiving.

The transmitter is on a Nano, the receiver on a Uno. I can get them to communicate but only if they are a few mm apart.

I am powering them from the USB hubs and have a 10uF capacitor across the power supply in each case.

In case it’s a current issue, I measured the current being drawn by the module from the Nano and it’s only about .03mA when transmitting, which seems much too low.

I tried giving the nRF24L01 transmitter a separate 3.3V power supply (via AA batteries and a voltage regulator). This didn’t work at all.

I tried some different channels in case there was noise from something else in the vicinity. No luck.

Here is the code for the transmitter

/* 

RadioSend

- CONNECTIONS: nRF24L01 Modules See:

http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
  1 - GND
  2 - VCC 3.3V !!! NOT 5V
  3 - CE to Arduino pin 9
  4 - CSN to Arduino pin 10
  5 - SCK to Arduino pin 13
  6 - MOSI to Arduino pin 11
  7 - MISO to Arduino pin 12
  8 - UNUSED

Send a series of zeros and ones to the receiver radio.

*/

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

#define CE_PIN   9
#define CSN_PIN 10

// NOTE: the "LL" at the end of the constant is "LongLong" type
const uint64_t pipe = 0xE8E8F0F0E1LL; // Define the transmit pipe

RF24 radio(CE_PIN, CSN_PIN); // Create a Radio

int high[1];
int low[1];

void setup()
{
 radio.begin();
 radio.openWritingPipe(pipe); 
 radio.setDataRate(RF24_250KBPS);
 radio.setChannel(90);

 high[0] = 1;
 low[0] = 0;
}

void loop()
{
 radio.write(high, sizeof(high));

 delay(1000);  
 
 radio.write(low, sizeof(low));

 delay(1000);  
}

And for the receiver:

/* 

RadioReceive

- CONNECTIONS: nRF24L01 Modules See:

http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
  1 - GND
  2 - VCC 3.3V !!! NOT 5V
  3 - CE to Arduino pin 9
  4 - CSN to Arduino pin 10
  5 - SCK to Arduino pin 13
  6 - MOSI to Arduino pin 11
  7 - MISO to Arduino pin 12
  8 - UNUSED

Receive a series of zeros and ones to the sender radio.

*/

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

#define CE_PIN   9
#define CSN_PIN 10

// NOTE: the "LL" at the end of the constant is "LongLong" type
const uint64_t pipe = 0xE8E8F0F0E1LL; // Define the transmit pipe

RF24 radio(CE_PIN, CSN_PIN); // Create a Radio

int received[1];

void setup()   /****** SETUP: RUNS ONCE ******/
{
  Serial.begin(9600);
 pinMode(8, OUTPUT); 
// pinMode(13, OUTPUT);
 delay(1000);

 radio.begin();
 radio.setDataRate(RF24_250KBPS);
 radio.setChannel(90);
 radio.openReadingPipe(1,pipe);
 radio.startListening();
}//--(end setup )---


void loop()   /****** LOOP: RUNS CONSTANTLY ******/   

{
                                          
  if ( radio.available() )
 {
   
   // Read the data payload until we've received everything
   bool done = false;
   while (!done)
   {
     // Fetch the data payload
     done = radio.read( received, sizeof(received) );

     Serial.println(received[0]);
     if (received[0]==0)
       digitalWrite(8, LOW);
     else   
       digitalWrite(8, HIGH);

   }
 }
}

Help, please

When you say you have a 10uF capacitor across the power supply, that is for the NRF module and not the Arduino isn't it?

When we tested these, prior to selling them we could get 10M and more, just not through walls.

How many mm are you actually getting?

ChilliTronix is correct, you must have your 10uF accross the 3.3V supply to the nrf module. Its no good having it accross the 5V supply.

The low current you measure with a multimeter is no surprise. The high currents needed for transmiting are very short pulses. You would need a scope to see them.

I got around 15~20M even through a thick wall with them, although one of the pair was a high power version with a detacheable antenna.

Paul

Yes the caps are across the nRF supply not the arduino supply. To communicate reliably they almost have to touch. If they are a metre apart then maybe one in 10 signals gets through.

Wow that is not good. Are you sure they have got 3.3 V?

yes they've both got 3.3v. When you did it did you use two Unos? I'm getting another uno so will have another go when it arrives

Yes I did, one was a Sparkfun, and the other an Uno R3 clone we sell. Are you sure both capacitors are good?

If both have power, I can't see that the sort of Arduino would make the difference.

Don't blame the Nano. When I had them communicating over 15M, one was a Nano, the other a Pro Micro. The Pro Micro was a problem because it has no 3.3V output. I had to use a couple of diodes to drop 5V down to around 3.5V for that circuit.

It is difficult to know what to suggest. How have you got them wired up?

I've tried various different capacitors, from big electrolytic ones down to little ceramic ones and it makes no difference.

They're wired up like this

rRF pin 1 - Arduino GND rRF pin 2 - Arduino 3.3V rRF pin 3 (CE) - Arduino 9 rRF pin 4 (CSN) - Arduino 10 rRF pin 5 (SCK) - Arduino 13 rRF pin 6 (MOSI) - Arduino 11 rRF pin 6 (MISO) - Arduino 12

This must surely be right or it wouldn't work at all

And capacitors across nrF pins 1 and 2

It is pretty baffling. Can only think I might have dud units.

Whether or not you have a capacitor should make a difference, it did in our tests. And the only one we tried was 10uF. Can you post a picture?

A poor ground or a poor +3.3 can lead to this behavior while still having the DVM providing good readings... Essentially RF module is being powered by phantom currents. If using pin-jumpers, replace them. Make certain Gnd is established. Breadboards should always be suspect.

Hmm thanks that sounds quite plausible. Will investigate ...

I agree with Mr Burnette, something odd is going on. Someone in China makes these things and I do suspect that there is a power issue.

Try a different part of the breadboard?