0

I am using two Arduino Unos, NRF24L01+ transceivers, and a few components as per this site on which I am following the second tutorial on this page: Arduino Wireless Communication – NRF24L01 Tutorial.

I am using the exact code from the page as well - and have set everything up as per the diagrams, however everything stops working after a short amount of time. Usually between 15 and 30 seconds, everything stays powered but it seems like the transceivers stop communicating. A reset of the Transmitting board (the one with the potentiometer) will fix the problem until it again stops 15 or 30 seconds later.

Any idea what might be going on?

1
  • I can say that a lot of the problems with these modules can be avoided with hefty decoupling of power going in to the modules. So could you please solder a 5000uF-10000uF electrolytic and a smaller ceramic capacitor directly to the GND and VCC of the module. It would also help to know which nRFs you have, exact pictures if possible please.
    – Avamander
    Commented Jul 18, 2018 at 14:09

4 Answers 4

1

Your question does not provide much information to go on. Setting up as given in the tutorial is a good start, but does not guarantee that there will be no problems. It can still either be a problem due to hardware or firmware.

Firmware problems:

  • The radio data may be getting corrupted after some time, which shows up as a failed radio transaction
  • You inadvertently change the register settings of the radio

Hardware problems:

  • There is noise interference on the radio channel you are using due to the urban environment (wifi, etc). Does the system work any better on a different channel?
  • The radio drains too much power and browns out, then will revert to default settings on the IC rather than the ones set by your Arduino sketch.
1

There are few possible reasons:

First: If you soldered a capacitor it's capacity may bee too big , then if brownout appear radio module will not recover from it because of your big sized capacitor.

Second: it could be wrong config. use RF24_PA_LOW, RF24_PA_HIGH and RF24_PA_MAX but not MIN because it is not correctly supported by all RF24 modules.

Third: it could be brownout which is causing arduino board to fail (not the radio module). Then use alternative power source for radio module. But don't forget to leave ground cable of radio module connected to arduino (for data).

0

I had the same problem and so far I have not been able to find the reason why this happens.

Anyways my temporary solution was to make arduino go to sleep and wake up. The moment the board goes to sleep and reboots everything works great again.

Execute this code every now and then

#include <avr/wdt.h>

....

// enable the watchdog timer. This will wake up the board after 120ms
wdt_enable(WDTO_120MS);

// go to deep sleep
if (true)
{
  SMCR |= (1 << 2); // power down mode
  SMCR |= 1;        // enable sleep;
  __asm__ __volatile__("sleep");
}

I know this is not a solution but it is better than nothing like in my case.

Edit (Solution that worked for me)

For some reason if I remove the millis() function the code keeps working.

    unsigned int end = millis() + 2500; 
    for(int i=0; i<2000; i++) // New code
    // while (millis() < end)  // Old code stops working after 2 minutes ....
    {

I perform a task for 2.5 seconds that is why I was using the millis function...

0

I had a similar issue. I got my NRF24L01+ working for an entire day, but then it suddenly broke and I could not fix it. From my online research, there seem to be a lot of reliability issues with NRF24L01+. Eventually, I implemented my plan Z: switch NRF24L01+ for a HC-05 bluetooth module (which is really easy!!), check out: https://www.instructables.com/How-to-Connect-HC-05-to-Windows-1011-Mac-Apple-Com/ If you continue to trouble, I suggest just use HC-05, which would save you a lot headache and time.

However, the UART on HC-05 transmits data a lot slower than the SPI on NRF24L01, but I did not need the speed, so the switch was a great decision for me.

Not the answer you're looking for? Browse other questions tagged or ask your own question.