How to power cycle nRF24L01+ module, without power cycling Arduino

Hi,

I have been successfully using nRF24L01+ module with Arduino in a few projects I built. However, I noticed that occasionally (maybe once every few days or weeks) the nRF24L01+ module will stop correctly receiving the data. Pushing the reset button on my Arduino doesn't help with that. I need to disconnect and reconnect the power supply to fix it. I don't know what exactly is going on.
I want to solve it by automatically power cycling the module in case Arduino detects than no data was successfully sent or received in a given time window. My idea is to power the nRF24L01+ module from an Arduino digital pin, instead of Vcc output. That pin would always be HIGH for normal operation, but if I change it to LOW, that would basically disconnect power to nRF24L01+ and power cycle it this way.

Is this a good solution? Am I missing something important here that could cause a problem with this?

Opinions are welcome.

Try Google: nRF24L01+ stops receiving

https://devzone.nordicsemi.com/f/nordic-q-a/1894/is-there-any-way-to-reset-nrf24l01

There is a link at the bottom of the page to a potential software solution

If the software solution does not work, its probably not a good idea to drive the module directly from a pin. But you could drive a transistor to power cycle the module. A small voltage drop across the transistor should not be an issues because the nRF24 works down to 1.9V.

Klaus_K:
There is a link at the bottom of the page to a potential software solution

The linked code uses some PowerUp() and PowerDown() functions that don't seem to exist in RF24 library. I have no idea what these came from. So this solution won't work.

If the software solution does not work, its probably not a good idea to drive the module directly from a pin. But you could drive a transistor to power cycle the module. A small voltage drop across the transistor should not be an issues because the nRF24 works down to 1.9V.

Using transistor will cost me some power, which is not idea for my low-power battery operated sensor. Why is it a bad idea to power directly from the pin?

cadence22:
The linked code uses some PowerUp() and PowerDown() functions that don't seem to exist in RF24 library. I have no idea what these came from. So this solution won't work.

I was wrong. I made a typo. It's powerUp() not PowerUp(). This function exists, indeed. I will play around with it and read some more documentation.

Well, powerDown() actually won't work for me, because it still keeps the module powered up. Here is what the documentation says:

In full powerDown mode, the radio will consume approximately 900nA

So going back to my original idea of using digital pin to power this module, why is it a bad idea?

You can't use a digital I/O pin to power an nRF24 because it cannot provide enough current. On an Uno or Mega the max is 40mA and 20mA would be sensible. Also, the I/O pins work at 5v and the nRF24 must be powered with not more than 3.6v. Indeed the Arduino 3.3v pin is barely able to provide enough current.

AFAIK if you use a MOSFET transistor to switch the nRF24 power it will consume very little power when the nRF24 is off (or on).

...R

As Robin2 mentioned I/O pins have limited power sourcing capability.

Additionally, the power must enter the chip somewhere and the chip needs power for other things as well. So even if you have I/O pins that can provide enough current for one device, the total current needed can be more than what the power pins can handle. There is also a limit for each I/O port. You need to read the data sheets electrical characteristics section very carefully when you drive high loads. Simply using a MOSFET will eliminate the chance you miss something.

There are other potential side effects. You are using the device in multiple projects, building a solution with little side effects makes your life easier for the future. Let’s say you want to use the internal temperature sensor or need high precision A/D conversion. Driving a high current constantly trough your package will increase temperature and noise.

Having a large volume product in an ultra-competitive market, might be a reason to remove every non-essential component from your board to compete. But there is no free lunch. :slight_smile:

Thanks for all the suggestions. I'm going to buy some of those MOSFET transistors and measure how much current they waste. Hopefully the results will be good enough for my project.

cadence22:
I'm going to buy some of those MOSFET transistors and measure how much current they waste.

Be sure to get one that can be turned ON with a 5v signal and which also has a very low ON resistance.

...R