3

I have been trying to make my two Nrf24L01 wireless model work for few days now, to do so I follow the tutorial in the following link.

http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

I followed the link exactly, i changed nothing, expect i didn't add the bypass capacitor , as they said it will improve the performance and reduce heat, however mine is not working at all.

here is a pictures of my hardware setup ,

arduino setup
anther picture for the setup my whole setup nrf24L01 model

for the code i didnt change any this from the tutorial but i will past it to make it easy to follow Transmitting code

 /* YourDuinoStarter Example: nRF24L01 Transmit Joystick values
 - WHAT IT DOES: Reads Analog values on A0, A1 and transmits
 them over a nRF24L01 Radio Link to another transceiver.
 - SEE the comments after "//" on each line below
 - 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
 - 
 Analog Joystick or two 10K potentiometers:
 GND to Arduino GND
 VCC to Arduino +5V
 X Pot to Arduino A0
 Y Pot to Arduino A1

 - V1.00 11/26/13
 Based on examples at http://www.bajdi.com/
 Questions: terry@yourduino.com */

 /*-----( Import needed libraries )-----*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
/*-----( Declare Constants and Pin Numbers )-----*/
#define CE_PIN   9
#define CSN_PIN 10
#define JOYSTICK_X A0
#define JOYSTICK_Y A1

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


/*-----( Declare objects )-----*/
RF24 radio(CE_PIN, CSN_PIN); // Create a Radio
/*-----( Declare Variables )-----*/
int joystick[2];  // 2 element array holding Joystick readings

void setup()   /****** SETUP: RUNS ONCE ******/
{
  Serial.begin(9600);
  radio.begin();
  radio.openWritingPipe(pipe);
 }//--(end setup )---


 void loop()   /****** LOOP: RUNS CONSTANTLY ******/
 {
  joystick[0] = analogRead(JOYSTICK_X);
  joystick[1] = analogRead(JOYSTICK_Y);

   radio.write( joystick, sizeof(joystick) );

   }//--(end main loop )---

  /*-----( Declare User-written Functions )-----*/

  //NONE
  //*********( THE END )***********

Receiving code :

/* YourDuinoStarter Example: nRF24L01 Receive Joystick values

 - WHAT IT DOES: Receives data from another transceiver with
   2 Analog values from a Joystick or 2 Potentiometers
   Displays received values on Serial Monitor
 - SEE the comments after "//" on each line below
 - 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

 - V1.00 11/26/13
   Based on examples at http://www.bajdi.com/
   Questions: terry@yourduino.com */

/*-----( Import needed libraries )-----*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
/*-----( Declare Constants and Pin Numbers )-----*/
#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


/*-----( Declare objects )-----*/
RF24 radio(CE_PIN, CSN_PIN); // Create a Radio
/*-----( Declare Variables )-----*/
int joystick[2];  // 2 element array holding Joystick readings

void setup()   /****** SETUP: RUNS ONCE ******/
{
  Serial.begin(9600);
  delay(1000);
  Serial.println("Nrf24L01 Receiver Starting");
  radio.begin();
  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( joystick, sizeof(joystick) );
      Serial.print("X = ");
      Serial.print(joystick[0]);
      Serial.print(" Y = ");      
      Serial.println(joystick[1]);
    }
  }
  else
  {    
      Serial.println("No radio available");
  }

}//--(end main loop )---

/*-----( Declare User-written Functions )-----*/

//NONE
//*********( THE END )***********

The output result on the serial is No radio available

dose anyone know where i can go from here ? or how i can debuge such a problem ? i dont even know if the problem is with the sender or receiver or both of them

  • If you can get rid of that lump of ribbon cable it might help - ribbon cable is really not conducive to SPI. You could also try reducing the SPI clock speed to compensate for the ribbon cable. – Majenko May 21 '15 at 10:34
  • "No radio available" means there is a wiring issue. – Gerben May 21 '15 at 12:08
  • @Majenko : I tried to slow down SPI as you see in the code below void setup() /****** SETUP: RUNS ONCE ******/ { Serial.begin(9600); Serial.println("Nrf24L01 Transmiting Starting"); radio.begin(); SPI.setClockDivider(SPI_CLOCK_DIV8) ; radio.openWritingPipe(pipe); }//--(end setup )--- however taking out ribbon cable i will need few days to do that as i need need to go and buy some cable :( – Akkilah May 21 '15 at 20:53
  • @Gerben : then what if there is no transmitter , what should the receiver output look like in the serial monitor ? – Akkilah May 21 '15 at 20:56
  • My bad. That's the wrong function for checking connection. Try this if( !radio.isPVariant() ) Serial.println("No SPI connection"); – Gerben May 22 '15 at 13:16
4

Just added a 47uf capacitor to the pin 1 and 2 in NF24L01 ,then every thing worked fine

this is the new setup .

enter image description here

  • Ideally the capacitor should be soldered on pins 1 and 2 or as close to them as possible. Long jumper wires, in a sense, defeats the purpose of it. You might wan to try that and eliminate the breadboards. – csg Nov 8 '18 at 16:01
1

If adding a 47uF capacitor between the 3.3V and GND is not enough to solve your problem, try to:

  • power the NRF24 through a 3.3V voltage regulator (like a LM1117T-3.3) and power the voltage regulator (NOT the NRF24) through the Arduino's 5V pin. Indeed, the Arduino 3.3V pin is limited to 150mA output, while the the 5V pin can provide you about 400mA.
  • don't use a breadboard: the NRF24 chip is very sensitive, so try to connect it directly to the board through jumpers or PCB / perf-board.
  • Add to your code the line:

    radio.setPALevel(RF24_PA_MIN);
    

and check if it works in that way; if it does, the issue is probably about the chip's current consumption.

Hope this helped

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.