Go Down

Topic: NRF24L01 Stopped Working (Read 2761 times) previous topic - next topic

TWeiss33

Hey guys i have been using the nrf24l01 modules for a good month or so and all of a sudden none of my modules work and my project is due in 5 days. The only thing that has changed is i have multiple mirf libraries and spi soft libraries that could be mixing up the original mirf library. I then tried making my own code and had no luck, the transceiver would not even send the byte string "tyler". Does anyone know what could be the problem? Is there any way i could program the spi by hand for with the arduino software? I have tried using the ping client and ping server examples and have had no luck. The server prints beginning... and then it will recieve one packet and send a reply then nothing else will be printed. On the client end it will pause for a long period of time and then print some ridiculous number that should not be possible (with the 1 second timeout) like 36,000. Any help would be greatly appreciated.


here is my code and all that is being stated on the serial monitor is beginning...
Code: [Select]
/**
* A Mirf example to test the latency between two Ardunio.
*
*/// Pins:
// Hardware SPI:
// MISO -> 12
// MOSI -> 11
// SCK -> 13


#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>

byte data;

void setup(){
  Serial.begin(9600);
  Mirf.csnPin = 9;
  Mirf.cePin = 7;

  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
 
  Mirf.setRADDR((byte *)"clie1");
  Mirf.channel = 1;
  Mirf.config();
 
  Serial.println("Beginning ... ");
}

void loop(){
  data = 'tyler';
  Mirf.setTADDR((byte *)"clie1");
  void powerUpTx(void);
  Mirf.send((byte*)&data);
  Serial.println((char*)data);
  delay(3000);
}


terryking228

Hi,
Often power problems are at fault.

See the ArduinoInfo.Info WIKI HERE:

Quote
NOTE! Power Problems:
Many users have had trouble getting the nRF24L01 modules to work. Many times the problem is that the 3.3V Power to the module does not have enough current capability, or current surges cause problems. Here are suggestions:

  • Connect a .1uF to 10 uF (MicroFarad) capacitor from +3.3V to Gnd (Watch + and - !)
    Use a higher-current power source

  • Use a higher-current power source

.


Please let us know what you find out!
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

TWeiss33

Oh wow thank you very much! I have not tested the connectivity yet but it see,s to be working now! does this problem occur with 433 mhz rf modules as well?

TWeiss33

Spoke to soon....one it fixed one but not the other oddly. i am using the same program for both and the one that is fixed now sends out data every 1 second but the other sends out nothing unless i nudge the wires around and then printing some ridiculous number like 45004670.

TWeiss33

i lied... both are working, thanks again

terryking228

Quote
both are working, thanks again


Did you add capacitors?? When things are flakey:work, quit, work ... that may be what's happening..
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Frédéric_Plante

Are you using a Arduino MEGA 2560?
As we fight our way northward into the great unknown, only that one thing remains certain...

terryking228

Quote
Are you using a Arduino MEGA 2560?

A MEGA needs different pins connected. See the table on the ArduinoInfo.Info WIKI HERE:
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Frédéric_Plante

Yeah. Plus it is a recurent problem between the Mega and NRF24 module. The Mega just don't supply enogth juice for the NRF24 module on the 3,3volt output pin.

The usual symptom is that your Mega receive the packet, but is unable to reply back.
As we fight our way northward into the great unknown, only that one thing remains certain...

terryking228

Quote
The Mega just don't supply enough juice for the NRF24 module on the 3,3volt output pin.


The arduino.cc info for the MEGA2650 says:
Quote
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.


I think the problem is the nRF24L01 transceivers take a short current draw during transmit. IF you add a 10uf to 100uf capacitor in parallel with a .1uf capacitor across the radio module's GND and 3.3V pins it will probably work.

The data sheet for the nRF24L01 HERE: shows the supply current being less than 15 ma. But that's an AVERAGE.

I'll do some MEGA tests soon. 

I added 1.0 uf tantalum capacitors on two radios that had sometimes been flakey and they are 100% solid tonight.
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Frédéric_Plante

Well give news about it. It would be great to simply have to add a cap to settle the problem.
As we fight our way northward into the great unknown, only that one thing remains certain...

TWeiss33

Quote
Did you add capacitors?? When things are flakey:work, quit, work ... that may be what's happening..


Yes terryking228, I added capacitors as you suggested and it worked perfectly.

Quote
IF you add a 10uf to 100uf capacitor in parallel with a .1uf capacitor across the radio module's GND and 3.3V pins it will probably work.


So I need 2 capacitors for the nrf to work on 3.3V? I mentioned in another topic that with my 1uf capacitor i can only use the nrf on the 5V pin and not the 3.3V pin.

ddmdavid01

Hey, I am having the same problem right now. I have a mega and a uno and I have been able to communicate to each other for a few month, but now they don't work at all. I tried the 10 uF capacitor and it still does not work. Can someone tell me what happened?

Robin2

#13
Jun 07, 2017, 08:44 pm Last Edit: Jun 07, 2017, 08:47 pm by Robin2
Hey, I am having the same problem right now. I have a mega and a uno and I have been able to communicate to each other for a few month, but now they don't work at all. I tried the 10 uF capacitor and it still does not work. Can someone tell me what happened?
You need to post the programs you are using. Also post a sample of the output from both programs?

When you say you have "been able to communicate to each other for a few month, but now they don't work at all" does that meant that the programs have been on both Arduinos throughout that period without EVER being changed, And throughout that period NONE of the connections was disturbed. Then for no reason at all one day they could not communicate?

...R
Simple nRF24L01+ Tutorial


Two or three hours spent thinking and reading documentation solves most programming problems.

ddmdavid01

I have been using the same code from this post:

https://forum.arduino.cc/index.php?topic=481094.30

I created a code (testecomando and testecarro) to test and the output given is this:
Code: [Select]

0
0
0
0
0
0
0
0


The code that I used is the one from the beginning of the post on the top, but then when I changed to the solution you gave (which I do not remember why I do not have the code anymore) and I noticed it did not work at all I changed back to what it was and it did not work as well (the codes that I am talking about are the others). It has always worked, but now they do not work anymore.

Go Up