Well, the DS1307 clock module has a tendency to drift about a bit on my Pond pump controller. It can lose a few minutes each month. Irritating at best.
Now the GPS master clock as been created, it should be fairly easy to synchronise the DS1307 with the 433MHz data from the master clock.
The receiver hardware is connected to 5 volts, GND and it's data line is connected to pin 9 of the Arduino. The antenna is simply 17cm of stiff wire.
Once again, the wonderful Virtualwire library is used, and we simply call the receiver routine (remoteClockSet) in the main loop to see if any data has been received. If it has, update the DS1307, and recalculate the sun rise and set times.
There's a few more variables to declare to deal with the incoming time, and, to be honest the whole thing was written a while ago, and is now horribly un-weildy, and could do with a damn good tidy up and re-write, but it works.
No more difting clock!
Here's the code.
Hi, why "int TimeOut = 10;" in the code?
ReplyDeleteLooks like it was made redundant during development ;)
Delete