nRF24L01

Hi

I just got 4x nRF24L01 Transcivers, follower this tutorial http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo and this one http://www.madebymarket.com/blog/dev/getting-started-with-nrf24L01-and-arduino.html and this one http://hack.lenotta.com/arduino-nrf24l01-modules-testing/ youtube video : https://www.youtube.com/watch?v=wlhuO82IZjQ

and other many tutorials but i can't make my nRF24 work and not sure why.

I downloaded the RF24 Lib installed it, tested the 1st tutorial codes recive/transmit and nothing. Used arduino uno to recive data and a atmega328p-pu with a 3.3v regulator to transmit data, I even changed nRF's but nothing, double, triple checked the connections and still nothing. Using arduino IDE 1.0

What could be the problem? Start boring testing and getting no results.

My crystal ball is broken so please supply the code and connection drawing.

Weedpharma

Start with just a pair of them. Post the code you are using for testing. Keep your initial test code as short ans simple as possible. Because you are dealing with invisible wireless signals you need to include appropriate debugging code What Arduinos are you using.

...R

Scroll down here is the code, connection, drawing. That's 100% what i followed

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

I'm using arduino UNO

Im using an arduino uno with nRF as receiver and an atmega328p on a breadboard with a 3.3v regulator and nRF as transmiter.

The problem is that i don't receive any kind of data from the transmiter.

Domino60: Scroll down here is the code, connection, drawing.

Please post the code here using the code button

so it looks like this

and I can select it and copy it to my text editor.

...R

I used this connection :

Without the IRQ (not sure what that’s doing but i didn’t connected it)

Transmit 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 )***********

Receive 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 )***********

Not sure why it’s so hard just to look this website (tutorial) but nvm :smiley:
http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

Arduino Uno Setup “Receiver”:

Atmega328p-pu Setup “Transmiter”:

I'm not sure but in the last picture you posted the ATMega does not seem te be getting any power? Are you sure the transmitter is sending something?

In my opinion it is much easier to prototype using 2 arduino's instead of 1. When you use 2 you can see what both of the chips are doing with the serial monitor!

The transmiter code does not have anything to saw on the serial monitor. About the atmega chip i upload the code from the arduino Uno then change the chips..etc

The atmega and the nRF24 is getting power i checked with a voltomiter. I can put a simple blink led just to check that the atmega is working.

As about 2 arduinos I just got one, i spend money for other components and why should i need 2 arduinos, I have a nano but it's burned.

My problem here is that everything is connected as in the tutorial i followed, the code is uploaded, lib's in place no errors, everything is getting power. The only problem is that i don't get any data in my receiver.

If there's any other tutorial or mini mistakes that ppl can make in this nRF test pls tell me, i need them a lot for my projects just to transmit and receive data and be monitored on the PC.

After another look at the picture of the transmitter and the code i realised there was no joystick connected. The code will be sending the values of this joystick?

I have used these sketches and they work with me. I did not have a joystick so I deleted the Y component and used a potentiometer as the X component.

Domino60:
The transmiter code does not have anything to saw on the serial monitor.
The atmega and the nRF24 is getting power i checked with a voltomiter.
I can put a simple blink led just to check that the atmega is working.

As about 2 arduinos I just got one, i spend money for other components and why should i need 2 arduinos, I have a nano but it’s burned.

The 2 arduino’s was just a suggestion. You can use the serial monitor to check if the sketch is working correctly. For example you can read the value of the joystick and print a line like “Sending code” to see if the sketch is running correct.

Domino60: About the atmega chip i upload the code from the arduino Uno then change the chips..etc

Have you tested to be sure the Atmega328 is working properly after you move it to the breadboard?

I would add some code into setup() that would flash an LED in a pattern which would make it obvious that it is working AND so you can be sure which program is on the chip. I know from experience how easy it is to upload the wrong program.

It may also be a good idea not to use the joystick while testing the wireless system. Just send a pair of integers - the same every time.

I would put a delay() at the end of loop() in the transmit program so it only sends data once per second.

...R

About the atmega I'm sure it's working, it's not my 1st time uploading code in the same chip and just testing with buttons, leds..etc

About the joystick that has the code he use Analog pins (transmiter) about the (receiver) it should get at least random values like numbers x = 389 y= 235 or what ever but you see when i try to see if the nRF reseive something it print all the time in the serial monitor

 {    
      Serial.println("No radio available");
  }

Da_Beast & Robin 2 I will put a blinking led on the atmega and i will lower the delay of the transmiting signal (the delay of the blink will be fine).

I will upload a video, I'm thinking btw that it's maybe a damaged nRF24 but i don't think so they getting voltage and i already changed them, i go 4x.

Domino60:
Serial.println(“No radio available”);

This is the first time that you have told us that you get this message.

And, (based on the rest of your program) strictly speaking the message should be “No data in radio input buffer”

Is there a function to tell you if the receiver has detected the transmitter?

Is it possble that these lines should be delayed until after the transmitter has started

 radio.begin();
  radio.openReadingPipe(1,pipe);
  radio.startListening();;

And, while copying, I noticed that you have a double ;;

…R

I deleted the double " ;; " nothinig happens, same results.

The code it's not mine, it's the tutorial that i followed just to look if it's working. I have the nRF24 1st time in my hands and I try to find a tutorial making my nRF working.

I cam here for help :D I'm not sure what to do and i don't have any code on my own to work with nRF24 i just try to find something and making them work after that understand how they work, modify the code and use them as i want.

Robin2 Do you ever had nRF24, do you worked with them? If yes : Please tell me what to do and make them work.

I have the nRF's 2 days now from the 1st time.

Please, help :) :blush:

I done a new setup on my atmega328p and connected directly to the chip a 3.7v battery a voltage regulator for the nRF24 and changed the code and put a blinking led, the led blink but strangly the led blink slower than the 50ms delay that i put, looks like it blinks at 500ms.

I changed the nRF's. tested again no results, i get always "No Radio available".

I start thinking that maybe the nRF's are damaged...

Domino60: Do you ever had nRF24, do you worked with them?

Sorry. I have different 2.4GHz transceivers (Cypress) and I had to write my own "library" to get them to work. (I had no choice of device).

Have you tried switching on the transmitter (say) 30 seconds before switching on the receiver?

Is this the library you are using? There seems to be a function testCarrier() or testRPD() - do either of them help with diagnostics.

Having said all that, the code you have looks very straightforward so I'm surprised it does not work. I do appreciate that it is very frustrating.

Can you make a pencil drawings of exactly how everything is wired - transmitter and receiver - and post photos of the drawings. Photos of the hardware are not suitable.

If it was my project I would check 12 times to be sure the breadboard Atmega was working properly - and then test a few more times.

...R

That's my problem :D I found something but wtf is going on with the nRF (nRF you are drunk go home) > :D https://www.youtube.com/watch?v=Ty7i8PXdgpQ&feature=youtu.be

That's my video..etc

Why that's happening ? Why when i touch the nRF then start transmit data? :D btw I found that it start transmit data by luck, i just start pissing off and start touching everything when then wtf i start see transmited data in my Desktop I was like WTF nRF GO HOME YOU ARE DRUNK.

:D

Btw why that's happening ?

Domino60: Btw why that's happening ?

You are not answering my questions - so how can I help?

...R

I'm going to guess that you need some capacitors. I don't see any on your breadboard. Maybe your finger IS a capacitor? Google nRF24 troubleshooting and you will get a lot of results that talk about using the right capacitors.

good luck!