Issue with Arduino + NRF24L01 + Raspberry when current in home goes "low"



  • Hi to all,
    I have some issues in home power. I live in Italy and base voltage is 220V.
    When I use a big load, as washer dinner, washing machine or electric oven, voltage goes from 220/221V to 210V (sigh).

    Home is not mine, I live in rent.

    PC, Tv and Raspberry are feeded via UPS, that reacts very well to this voltage peak. Arduino is connected and powered via USB from the PI itself, and Arduino has NRF24L01 connected, trasmitting with other (battery) powered Atmega.

    The trouble is that sometimes this peaks render the Arduino (original R1) instable, and I need to restart the PI+Arduino itself or wait for the big user ending. 😢

    Is there something that I can do (other than ask to the owner to call his technicians)? I think to know also the issues. The watt meter is distant from the home (about 100 meters) and the cables are not so-big, from meter to the home itself. But it is not my home, cannot act directyle.

    Thank you very much!


  • Hardware Contributor

    @sineverba - watchdog timer?



  • @sundberg84 said in Issue with Arduino + NRF24L01 + Raspberry when current in home goes "low":

    @sineverba - watchdog timer?

    Ehm... sorry.. what do you mean? (I know what is watchdog, but I did not understand you).... thank you!


  • Mod

    He meant to add a watchdog timer to the code so that when the code hangs it will resets the arduino automatically.


  • Hardware Contributor

    @sineverba - what @gohan said.
    There is something called a watchdog which can either be in the software or you can have a external component that is connected to the arduino reset pin. The arduino needs to ping the timer and if the arduino hangs and stops pinging the timer it will send a signal and reset the arduino.



  • Thank you to both. I will test and I will update 🙂



  • @sundberg84 said in Issue with Arduino + NRF24L01 + Raspberry when current in home goes "low":

    @sineverba - what @gohan said.
    There is something called a watchdog which can either be in the software or you can have a external component that is connected to the arduino reset pin. The arduino needs to ping the timer and if the arduino hangs and stops pinging the timer it will send a signal and reset the arduino.

    I did try to introduce Watchdog in my script. But... Arduino is not re-booted, if I use a function with wait inside. Is it normal?

    This is the function that prevent watchdog to reset the board....

    
    /**
     * Light the LED status
     * 
     * @since 2.0
     */
    void lightLedStatus() {
    
      int k = 0;
    
      for ( k = 0; k < WAIT_LOOPS; k++) {
        
        digitalWrite(PIN_LED_STATUS,HIGH);
          wait(10); // 5 * 1000 millisends = 5 seconds;
        digitalWrite(PIN_LED_STATUS,LOW);
          wait(4990);
        
      }
      
    }
    
    
    

Log in to reply
 

372
Online

6.7k
Users

7.6k
Topics

80.4k
Posts

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.