Timed events with Arduino

Starting a new thread because my last thread went dead :-)

I'm looking into buying an Arduino Uno and Ethernet shield. I wanted an Ethermega but can't find a UK stockist. Only an Australian warehouse with a UK style storefront ;-)

I want my Arduino project to do (amongst a lot of other things, like monitoring inputs) to sound a piezo buzzer on the hour every hour from 1800-2200.

I don't want to adjust for daylight savings time.

I read that I can query an internet time server to obtain the current time. I could do this in my sketch every day at 1500, for example. And on power on.

But what I don't know is if I need a RTC module for this to be useful?

Can anyone advise on how this is practically done?

Thanks

But what I don't know is if I need a RTC module for this to be useful?

Maybe, maybe not.

If you can query a web server for the time, often enough, then it is not necessary to have an RTC.

An RTC, on the other hand, is cheaper than an ethernet shield, if all the ethernet shield is being used for is to get the time.

The standard Uno these days comes with a ceramic resonator for its clock - this is not very accurate (couple of percent or so). So you probably want to do one of three things:

(1) desolder the resonator and replace it with a crystal and capacitors. This is fiddly and not really feasible if you haven't worked with surface mount components before. Then you'll have 50ppm or better accuracy from millis().

(2) Use an RTC for timekeeping - has the advantage of maintaining time across resets, during power down etc. Some more expensive RTC modules have extreme accuracy (1ppm or better).

(3) Keep a rough time using millis () and update it from the internet on a regular basis.

(Of course (3) can help (1) or (2) keep better time)

The convenience of an RTC is high - adding internet time can then be a later stage in the project.

Much of this depends on the end goal. If all you really want to do is sound an hourly chime and its not all that important that it work, and you have internet access 24/7, then just query the time server every so often and let the Arduino keep the time. If the Aduino is too inaccurate to keep time within 1 second each day, then query more often. Query hourly if you like.

If you will find yourself without Internet access for long periods of time, or if your requirement is to keep time very accurately, then go with the RTC. Its not all that expensive, its easy to write software for, and you won't have to worry about loosing Internet access.

But in general, think about what's important and design what you need to meet those requirements.

DANE: Starting a new thread because my last thread went dead :-)

I'm looking into buying an Arduino Uno and Ethernet shield. I wanted an Ethermega but can't find a UK stockist. Only an Australian warehouse with a UK style storefront ;-)

Simply because I have one and I like it, I recommend taking a look at the Freetronics EtherTen (http://www.freetronics.com/products/etherten), which is an Arduino clone with onboard Ethernet and a microSD card slot. There does not seem to be a Freetronics reseller in the UK, though there is one in Germany.