Use Delay function OR Real-time Clock?

Hey Everybody,

I am currently using an Arduino Uno for a project. The project requires a valve to open every 2 hours for 30 days.

I figured that I could probably create a 2 hour delay using a series of smaller delays (one after the other) and then looping through that to prolong the delay to 2 hours. I can then do the math and then loop through this 12 times per day and then loop through the number of days 30 times.

OR

I can use a real-time clock module (like the Sparkfun RTC https://www.sparkfun.com/products/12708).

Which option will use more energy? Will running through the loop on the Arduino use more energy than the RTC?

Any opinions about the best way to go about this?

Thanks in Advance, Neal

I'd use the RTC, if only to allow the system to recover if there's a loss of power. If you're concerned about power, you could take a look at the various sleep modes the arduino has.

I agree with Wildbill. A DS1307 shield costs next to nothing ($1.31 with free shipping), is easy to program, has battery backup on most shields, and draws little current. There are plenty of examples of code for it on this Forum, and the accuracy will meet your needs.

I would highly recommend you use an accurate clock that keeps proper time https://www.tindie.com/products/JChristensen/mcp79412-real-time-clockcalendar-breakout-board-1/

Thanks for your advice. I will go ahead and do just that.