This is one of many models of the NRF24 radio module.
Have you ever felt frustrated by not getting this module to work? Because I have. A lot.
So let me show you what problems you might encounter with this module and how to solve them
and improve the connection. Also, to see what new models we have. We will talk about noise,
SPI problems, supply sensibility, amplification and antennas. So guys, let’s get started.
What’s up my friends, welcome back. These are all radio modules. They are actually the same module,
the NRF24 L01. But as you can see, over the years its design evolved
and got better and better. But even so, using this module can be frustrating.
I’ve used this module a lot, and you will understand why it’s still my favorite.
I’ve made several radio controllers and all these are homemade and based on the NRF24 module.
I’ve also made a lot of other radio connection projects and so on, and they all work now. But
I had a lot of problems and in this video I want to go over each problem and a possible solution.
Around 30% of the comments on my NRF24 module videos
are about frustrations with this module because it doesn't work.
So why is that? Problem number 1, connections. The NRF24 uses SPI and it needs 7 pins.
Two for power, two for MOSI and MISO and then we have the CE, CNS and the clock connection.
So obviously, this results in having a bunch of wires so the chances of errors are already high.
Also, the basic NRF24 module pin shape is not compatible with any breadboard.
In my case I had to make these adaptors so I could make my tests.
Like this I can put the module into the adaptor and then the adaptor on the breadboard.
If you want, you could buy such adaptors and they already have the power regulation on the PCB, and
that's another problem we will talk about. So my first recommendation is to make a PCB instead of
separated wires. At the same time, if you do use wires you should make them as short as possible.
Why? Well that’s because of the second problem, noise. I’m not talking about
the radio noise of 2.4GHz. I’m talking about the induced noise over the SPI communication.
So is not the noise over the signal between antennas, is the noise between the module and the
microcontroller. SPI is very fast and sensible. For example, with my Arduino drone I’ve spent
months figuring out why the radio connection was interrupted all the time. One reason was that the
current peaks from the DC motor tracks were inducing noise over the SPI tracks on the PCB.
So make sure that the SPI connections are not passing over or near power tracks,
especially if those tracks are oscillating with PWM or other kind of oscillating signal.
With one project I’ve tried to make some sort of faraday case around the tracks
using vias. That wasn’t a good idea, and it created even more noise.
Best scenario is to avoid other tracks overlapping with the SPI ones.
And speaking about faraday cases, the designers also realized that the module has noise problems
so you could now buy a module like this one. It has the radio module enclosed inside a metal case
to avoid any outside noise, that’s the way to do it, not adding vias around it.
Anyway, the final recommendation for SPI noise is to try wrapping the ground wire or track
around the MOSI and MISO wires. Especially on breadboard tests, this method helped me a lot.
Wrapping the ground wire around the SPI wires reduces the noise a lot,
from other tracks or wires, but even the noise between the SPI wires as well.
So, for SPI noise you should: One, use as short as possible wires or PCB tracks.
Two, place the radio module as far as possible from the power switching tracks, even outside of
the PCB if you can. Three, try insulating the radio module with some sort of faraday case.
And four, wrap the ground wire around the other SPI communication wires.
Ok guys, the third frustrating problem is power and supply. These modules are very sensible with
their supply. They all work at 3.3V. With more you will burn it and with less it won’t work well.
One of the most common voltage regulators used with these modules is the AMS1117. It
could give you a very stable 3.3V output. One problem I found with this IC is that it has a
1.1V voltage dropout. So if your project works with lipo batteries which are 4.2V, the maximum
voltage this IC could give is 4.2 minus 1.1, and that's 3.1 which is not enough. That’s a problem
that I had with the mini drone project since I wanted to make it work with a small LIPO battery.
So I’ve also tried the HT73 33 regulator. This one has only 100mV of voltage dropout.
But another problem to have in mind is power consumption.
Usually, the NRF24 could use up to 20mA when working. But it will use a lot more if you have
the amplified one, with an antenna. The HT73 33 regulator has a maximum output of 250mA.
If you use it for your entire PCB, that current will be divided between your microcontroller,
switching MOSFETs, LEDs and so on, and also the radio module, so the power might
not be enough. Actually, with the HT73 33 I still had some problems. That’s why I always
try to use the AMS11 17 and have a higher input than 5V so the voltage dropout won't affect it.
The worst scenario is to use switched mode regulators such as these ones.
If you use a buck converter to get the 3.3V, you will have a lot of noise
and the voltage won’t be stable enough so linear regulators should be the solution.
These radio modules are so sensitive to voltage changes that is recommended to add a 20 up to
100nF capacitor between its ground and 3.3 volts pins to reduce voltage oscillations.
This is a very effective solution and I do it all the time. Soldered directly to the module
or in case of an SMD version, I add that capacitor close to the module on the PCB.
So guys, for power problems we have linear regulator with sufficient current output, very
stable 3.3V supply and adding a capacitor close to the 3,3V connection and never use switched
regulators with this radio module. Next problem might be the antenna or power amplification.
When I first started with these modules I was using this one which is the most common
one. But for better connection and higher range I always recommend you to use the
power amplified one with an antenna like this one, especially for the transmitter.
As you can see, this one has on the PCB the NRF24 IC but also a power amplifier which is the RFX 24
01 C. And instead of a PCB antenna this time we have an external antenna of around 10cm.
For the radio controller project this was working great.
But when you want to make a small project such as the mini drone, you need a smaller
version. For that we have the SMD module that could get soldered directly to the PCB.
Actually, my electronoobino board already has the SMD pads for that in case you want
to make tests with it. You can also find the NRF24E LE, which is a different version.
But this SMD module doesn’t have the power amplification. Or at least it didn’t till
a few years ago because now you can also find the SMD version of the power amplified module
like this one. Is also very small and the best part is that it also has an IPEX connector.
So you could use the PCB antenna or connect an external one to this connector. All you need
is this small adaptor and then you could screw an external antenna which could be of different
sizes. With this configuration I was able to get a steady connection of up to 2 Km which is crazy.
And you know what, with this huge antenna, back at my father's house in the village,
I had communication up to 5km which is even crazier. I recommend you to watch iforced 2D
channel where he got up to 30Km using this kind of antenna so that’s why I love these modules. They
could have a decent range and they are quite easy to use. And that’s the last frustration problems
you could have. The code. Once you download the Arduino library all you have to do is to define
2 pins and the basic settings. Those two pins are for the CE and CSN connections of the SPI
and they can be any digital pin of the Arduino. The rest are hardware communication pins and they
must be pins 11, 12 and 13. One problem you might have is that you’re using different pipe code
for the transmitter and receiver so make sure you have the same code.
Then we have a few functions to set some configurations.
You can set the speed and obviously, the lower the data transfer speed gets, the less errors
we should have so I always keep my speed at 250 KB PS. And basically that’s all you should know
about these modules. We have a few versions with different sizes, they are sensitive to noise,
you need short wires connection, noise insulation, and they are very sensitive to the power input.
Also, with amplification and a decent antenna you can get to very long ranges and you can also
control some parameters in the code. Check my Arduino or STM32 tutorials on how to use those
microcontrollers with these radio modules. And by the way, don’t buy this module. Is advertised
as a compatible NRF24 but is not. I wasn’t able to make this work so have that in mind.
I hope you can now make your NRF connection work. If you have learned something new,
consider giving me a like or comment below. Thanks again and see you later guys.