I have a problem with my nRF24L01+ that is driving me crazy.
A an ATMega328 working without a crystal in a custom PCB (attached) I made for a home automation project. Since I'm using the nRF24L01+ for comunication between the nodes, I'm using 3.3v for source for both the ATMega328P and the nRF24L01+.
The problem I'm facing is similar to the one described on this thread. My setup for the testing is one nRF24L01+ on a Arduino Mega 2560 like board and another on my custom PCB. When I'm sending info from the Mega to my custom PCB, there is no problem. But when I try the other way (sending from my custom PCB to the Mega), I only get signals if I put my finger on the nRF24L01+ attached to my custom PCB.
So I thought the problem might be the decoupling capacitor. But I have a 220 uF eletrolitic capacitor, that from what I got from my reading is more than enough. And to make things odder, if I replace the regular nRF24L01+ with a PA+LNA module like this one, it works even without my finger.
So what do you think that might be happening? Could be that the decoupling capacitor is not enough? Could there be a problem with ATMega328P working with 3.3v? I really don't know how to go from here...
Could be that the decoupling capacitor is not enough?
No but it could be it is too big. Large capacitors have large inductance and therefore are limited in the high frequency noise they can suppress. Supplement your 220uF capacitor by putting a 0.1uF capacitor in parallel with it.
Putting a finger on the antenna of the nRF24l01 cannot improve the filtering of the 3.3v power rail so you need to look at the issues separately.
When using capacitors on a power rail bigger does not necessarily mean better. The supply resistance and the capacitor have a cut-off frequency .. the larger the capacitor the lower the frequency. High value capacitors will suppress low frequency ripply but not high frequency. That is the reason for putting a 0.1uF in parallel with a 100uF to sort out high frequencies and low frequencies at the same time.
I am not convinced that the problem you are seeing is caused by the power supply. When you transmit for A to B the B end transmits to acknowledge the packets so both ends can transmit ok. If the transmission from B to A fails it may be related to the length of transmission as the transmit time in this case is much longer than just sending an ack.
Putting a finger on the antenna will not only make you act as an aerial it will seriously de-tune the transmitter circuit. It could be that this is sufficient to move the frequency of the transmitter. You have not said if you have tried other nRF24l01 modules other than the PA option. If it is just one module I would say it was faulty and not operating on the correct frequency.
OK, good info there! I'll try putting a 0.1 uF cap parallel to the bigger one. Is there any difference if it is eletrolytic or ceramic? Which one is better?
Regarding the modules, I've tried switching, replacing (I've got plenty of these modules, 50+), and always with the same results: A (Mega) to B (custom PCB) communication is OK, B to A only works if I place my finger on B.
But the point you made is interesting. Even though B is not capable of sending a full message, it can send and acknowledge answer without much problem.
I'll try adding the cap tonight and see how it goes, but other than that, what else could I try? Maybe a different channel? Currently I'm using channel 90, since the frequency is related to the channel, could that be the problem?
As the short transmission works ok but the longer one fails it could point to a power supply problem but it can't be a simple lack of current capacity as the module with the PA works ok and that draws a lot more current. I would try a few different capacitors and see if anything changes. Still can't see why using your finger would affect the smoothing....
As a simple rule caps < 1uF are ceramic and caps => 1uF are electrolitic/tantalum. There are lots of exceptions to this rule but it is a good guide.
But still, it is bit of hit and miss, some packages are getting lost even though they are close (~ 40 cm / 13"). And funny enough, when I took the capacitor out, it still worked.
I've just done some tests and I think I found the problem. I've attached the image of the connector to make it easier to understand.
The decoupling / bypass capacitor is the C2 at that image. it stays below the nRF24L01+ module. Apparently, the proximity of the capacitor is causing the problem. When I place the capacitor (100 uF) closer to the nRF24L01+ module, I get more missed packages. If I move it a little away from the module, I get better results.
What are the suggestions for capacitor(s) value(s)? If that position for the decoupling / bypass capacitor ok? Or should I solder it(them) directly to the modules (putting them together with the modules at the connector is quite difficult, I need to put quite some force to it).
When I place the capacitor (100 uF) closer to the nRF24L01+ module, I get more missed packages.
That sounds like the capacitor is acting as an antenna. This can happen because a value of 100uF is made by rolling up a foil sandwich which has high inductance.
Try reducing the value to 10uF or so and also using a tantalum, as it is physically smaller and made in such a way as to make the inductance smaller.
If that position for the decoupling / bypass capacitor ok?
Can't say because the supplied image has not enough context.
That sounds like the capacitor is acting as an antenna. This can happen because a value of 100uF is made by rolling up a foil sandwich which has high inductance.
Try reducing the value to 10uF or so and also using a tantalum, as it is physically smaller and made in such a way as to make the inductance smaller.
So only a 10 uF should work? Or do I need a 10 uF + 0.1 uF?
I'll try with only the 0.1 uF for now, since I have no tantalum at home.
Can't say because the supplied image has not enough context.
The 8 pins connector is for the nRF24L01+ module. This is the pinout:
So the pin 2 (VCC) is connected to the decoupling / bypass capacitor (C2). The C2 stays below the nRF24L01+ module.
Hi
I have been playing with the NRF24L01 for while now and what I have picked up is that their is slight variations in performance from board to board, have you tried just another unit ? I have ordered these things before and 3 out of 5 units was defective so be careful where you order from.