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...
/**
* 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);
}
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
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?
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.
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.
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:
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.
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.
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.
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?
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?
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?
I created a code (testecomando and testecarro) to test and the output given is this:
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.
After I checked if something happened with the cables, if everything was plugged in the right doors, etc. I think that it has to be something the nrf24l01. The output of the software that I used to test is still the same. I have no idea of what happened. Did the chip burn for some reason? Could it be something with the arduinos (I am feeding the modules directly from 3.3 volts of the arduino)? Is it going to solve the problem if I replace the nrf24l01? I am completely lost and have no idea what is happening.
ddmdavid01:
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).
In other words the answer to my question in Reply #13 is "NO"
As you seem to have got everything mucked up it is time to go back to basics. Try some of the examples from this Simple nRF24L01+ Tutorial
If you can't get the example to work post the code that YOU have uploaded to your Arduinos and post some examples of the output.