■ FIGURE 20. Proto shield alarm clock.
■ FIGURE 21. Select DS1307 in RTClib.
will set the correct date and time based on what it reads rom your PC. Thereafter,
if you keep the backup battery running at three volts (we'll get to that in a minute),
it will continue to keep time.
Figure 22 shows the output of the program on the Arduino serial monitor. In
the first line, we see the year/month/day hour:minute:second. In the next line, we
see the elapsed time since the Unix base time of midnight 1/1/1970 expressed as
seconds and days. In the third line, we see the results of
calculating a date which is seven days and 30 seconds
into the future. Take a look at Jean-Claude's code and
you'll see he has given you a really useful toolset for
working with the DS1307 RTC.
So, now we have it all put together on a mini
breadboard and tested it with some simple Arduino
Next month, we will continue with using the
Arduino proto shield alarm clock kit by first transferring
the parts from the mini-breadboard to the PCB to give
us more robust hardware. Then, we'll write software for
an alarm clock that is not only useful in itself, but
provides a good basis for more advanced data logging
This software will allow us to set alarms from the
PC over the USB port, and use that button to shut the
alarm off and generate various alarm tone sequences as
■ FIGURE 22. Serial monitor input.
December 2012 61