96 Silicon chip Australia’s electronics magazine siliconchip.com.au
Our lab has an air conditioner which
is needed to keep the computer equip-
ment at a reasonable temperature dur-
ing summer.
But if we simply use the thermostat,
it will run continuously on a summer’s
day and that is not required; we want
a lower duty cycle than that. So I de-
cided to build an Arduino-based tim-
er to switch it on and off based on the
time of day. But others in the lab want
to be able to see the time and date dis-
play from this timer and also get an
idea of when the air conditioner is to
be switched on and off.
I found that difficult to incorporate
into the timer software without inter-
fering with the operation of the tim-
er. So I used a second Arduino chip
to drive the display and it reads the
time and date out of the same real-
time clock module.
So this project demonstrates how
a single RTC module can be shared
between multiple microcontrollers
which are doing different jobs. I didn’t
want to use two separate RTC modules
since there’s no guarantee that they
will not drift apart.
As the old adage goes, “a man withTwo micros control an aircon with a single real-time clock module
one watch always knows what time
it is. A man with two watches is nev-
er sure.”
The circuit is based on a DS3231
real-time clock module, two Arduino
ATmega328 chips and two small 5V
DC coil relays which drive the 5kW
contactor that controls the air con-
ditioner.
You can share the RTC module this
way because the ATmega328’s hard-
ware I^2 C implementation supports
the “multi-master” bus mode, which
can handle the case when both devic-
es want to use the bus at once – one