How much time can i keep my arduino on?

Hello! programmers.

I want to use my arduino for domotic lights, i had already the programm and the components. I'm going to use ultrasonic sensor and reley module, the lights will activate when I pass my hand over the sensor, same for desactivat. My big question is, how long can i have my arduino on?

THANKS!!

Arduino can run as long as the power supply lasts.

Be aware that the millis() function will rollover (go back to zero and start again) after about 52 days.

From my humble experience, as long as you like, as long as you power it directly without using the voltage regulator. I was running a mega2560 with 12v into the DC jack, after 1+ year, the regulator went bad. The area around the regulator was brownish, which was a sign of excessive heat. The mega itself was still functioning well when powered directly with 5v.

I am currently running 1 mega and 2 pro minis 24/7 for 3 years now, without any issue. But I am going to touch some wood just in case, I wouldn't want to jinx it :slight_smile:

Byork:
I was running a mega2560 with 12v into the DC jack, after 1+ year, the regulator went bad.

I would put that more down to the 12v power supply than the regulator. Things get hot enough with 9v but it isn't really a problem. I understand there is a big difference between 9v and 12v.

rw950431:
Arduino can run as long as the power supply lasts.

Be aware that the millis() function will rollover (go back to zero and start again) after about 52 days.

Thank you for taking the time to answer me! :slight_smile:

Byork:
From my humble experience, as long as you like, as long as you power it directly without using the voltage regulator. I was running a mega2560 with 12v into the DC jack, after 1+ year, the regulator went bad. The area around the regulator was brownish, which was a sign of excessive heat. The mega itself was still functioning well when powered directly with 5v.

I am currently running 1 mega and 2 pro minis 24/7 for 3 years now, without any issue. But I am going to touch some wood just in case, I wouldn't want to jinx it :slight_smile:

Thank you for taking the time to answer me! Have a nice day :slight_smile:

millis() rolls over after 49.71 days, but so what?
Using unsigned long variable and subtraction will yield the correct time difference between events.
Go ahead and run this simple count up timer using micros(), which rolls over after 71.5 minutes

unsigned long currentMicros;
unsigned long previousMicros;
unsigned long elapsedTime;
// Initial time to start, 00:00:00 with 0 years, 0 days. 
// adjust as needed.
// Get this working, then more display code if needed
byte hundredths;
byte tenths;
byte secondsOnes = 0;
byte oldsecondsOnes;
byte secondsTens = 0;
byte minutesOnes = 0;
byte minutesTens = 0;
byte hoursOnes= 0;
byte hoursTens = 0;
int days = 0; //
byte years = 0;

void setup(){
Serial.begin(115200); // make serial monitor match
Serial.println ("Setup Done");
}
void loop(){
currentMicros = micros();
// how long's it been?
elapsedTime = currentMicros - previousMicros;
if ( elapsedTime >=10000UL){  // 0.01 second passed? Update the timers
previousMicros  = previousMicros + 10000UL;
hundredths = hundredths+1;
if (hundredths == 10){
    hundredths = 0;
    tenths = tenths +1;
    if (tenths == 10){
        tenths = 0;
        secondsOnes = secondsOnes + 1;
        if (secondsOnes == 10){
            secondsOnes = 0;
            secondsTens = secondsTens +1;
            if (secondsTens == 6){ 
                secondsTens = 0;
                minutesOnes =  minutesOnes + 1;
                if (minutesOnes == 10){
                    minutesOnes = 0;
                    minutesTens = minutesTens +1;
                    if (minutesTens == 6){
                        minutesTens = 0;
                        hoursOnes = hoursOns + 1;
                          if (hoursOnes == 10){
                              hoursOnes = 0;
                              hoursTens = hoursTens +1;
                                if ( (hoursTens == 2) && (hoursOnes == 4){
                                      hoursOnes = 0;
                                      hoursTens = 0;
                                      if (days>1){
                                          days = days-1;
                                           }
                                      else {
                                         days = 365;
                                         years = years - 1;
                                         }
                                    
                                      } // 24 hr rollover check
                                   } //hoursTens rollover check
                              } // hoursOnes rollover check
                        } // minutesTens rollover check
                     } // minutesOnes rollover check
                 } // secondsTens rollover check
              } // secondsOnes rollover check
          } // tenths rollover check
       } // hundredths rollover check
} // hundredths passing check

if (oldSecondsOnes != secondsOnes){  // show the elapsed time
oldSecondsOnes = secondsOnes;
Serial.print (years);
Serial.print(":");
Serial.print(days);
Serial.print(":");
Serial.print(hoursTens);
Serial.print(hoursOnes);
Serial.print(":");
Serial.print(minutesTens);
Serial.print(minutesOnes);
Serial.print(":");
Serial.print(secondsTens);
Serial.println(secondsOnes);

} // end one second check

} // end loop

Forever, basically.

I have one that's apparently been in more or less constant use since 2010. It gets restarted during power outages and whenever I notice that it has crashed - which is every three or four months or so. I suspect that the crashing is due to bugs in the wifi shield library - I've found and fixed one which caused a daily meltdown, but have never bothered to chase down any others. The watchdog functionality could help if you really need your system to recover from similar problems.

wildbill:
which is every three or four months or so. I suspect that the crashing is due to bugs in the wifi shield library

I think that is not "normal", i.e. something that tends to happen. I have Arduinos that I almost forgot about, because they just do their jobs. E.g. the one that look for the on/off IR commands of my projector and controls the motor screen.