I was wondering if anyone had experience of setting multiple rtc's at the same time so that they all keep the exact same time. Is it as simple as connecting the rtc's all in parallel to the same arduino (scl, sda) and running the code?
If anyone could offer advice on this i'd be really grateful!
Is it as simple as connecting the rtc's all in parallel to the same arduino (scl, sda) and running the code?
Probably won't work. The RTCs will interfere with each either on the bus.
No matter what you do, they will not keep "the exact same time". The individual RTC oscillators will drift at different rates. The only option for really accurate timekeeping is to discipline each RTC to a separate, very accurate clock, like the GPS time signal.
Switch your brewery to ESP8266 based Arduino boards, and get time automagically off the net.
No RTC module anymore, and/or adjusting/setting of clocks.
Leo..
jimmymcknife:
as simple as connecting the rtc's all in parallel to the same arduino (scl, sda)
No, but since you imply all Arduinos are interconnected, you could have one clock at a central point that sends time signals to all the others. It would save on clocks, and save you from chasing your tail.
Thanks for your reply. Sorry, no the arduinos aren't all interconnected they are all separate. The exact same time isn't necessary, just to the nearest second or so....
jimmymcknife:
o that they all keep the exact same time.
jimmymcknife:
The exact same time isn't necessary, just to the nearest second or so....
In that case you don't appear to have a problem. If you can't set the time to the nearest second or so, you just aren't trying hard enough. The time is set at the release of the reset button. It could be that your (unstated) real problem is the drift between the RTCs once they are set. Fixing this depends on how serious you are, which is apparently not very. If you are using DS1307s, particularly in an outdoor environment, you can improve the situation dramatically by swapping them for DS3231s, and that may be all you need. No change of code is needed.
I was wondering if anyone had experience of setting multiple rtc's at the same time so that they all keep the exact same time. Is it as simple as connecting the rtc's all in parallel to the same arduino (scl, sda) and running the code?
If anyone could offer advice on this i'd be really grateful!
Cheers
James
You cannot connect most RTC's in parallel because they have fixed I2C addresses. But you don't have to set them at the same time. Do you have to set all the clocks in your house at the same time? No.
One approach to synchronization is to determine the offset between one clock (the reference) and each of the other clocks and apply this offset to the output of the other clocks. Regardless, the clocks will drift apart over time, typically a few seconds a month.