Lost in the time / Looking for advices

Hi everybody,

I want to feed my plants with an arduino at 8 o'clock and 14 o'clock.
So I simply need to set a digital pin to HIGH during 1000ms at 8 o'clock and 14 o'clock.

My problem : there is a lot of different library to do that. Could you just advice me what's the simplest way according to your experience?

Thanks by advance for your help

I'd recommend something like this... SparkFun Real Time Clock Module - BOB-12708 - SparkFun Electronics. Doesn't cost much, and will keep time if the arduino loses power. Then use Adafruit's RTC library GitHub - adafruit/RTClib: A fork of Jeelab's fantastic RTC Arduino library. There are example sketches in the download. You can then extend one of the examples to check for your required times and act on them as required.

Hi dxw00d,

Thanks for your precise reply, it's seems to be a good solution but I'm more interested in arduino only solution (without external component). even if I understand that if my arduino is out of power, I loose the current time...

Anyway, it's good to know all the solution.

In that case, the Arduino Time library is probably all you need - http://www.arduino.cc/playground/Code/Time. it also has examples that you can build on.

Ok thanks again for your help,

I will try to work with that !

I will try to work with that !

You need something that can supply the actual time. The Arduino only knows how long it has been running. Your choices are a $15 RTC (they can be had for a lot cheaper. Sparkfun's real proud of some of their stuff - this is a good example of that) or a PC.

I think the set-it-and-forget-it RTC is a better solution. You apparently have a different opinion. That's fine. Just don't be fooled into thinking that the Time library does away with the need for external hardware to supply the time.