Hardware Reference
In-Depth Information
UnderstandingReal-TimeClocks
Real-time clocks do exactly what their name implies. You set the time once, and
they keep very accurate time, even accounting for leap years and things of that
nature. This example uses the popular DS1307 real-time clock integrated circuit.
Using the DS1307 Real-Time Clock
The real-time clock communicates with your Arduino over an I 2 C connection
and connects to a coin cell battery that will allow it to keep time for several
years. A crystal oscillator connected to the real-time clock enables precision
timekeeping. To make things easier, I suggest using the adafruit DS1307 break-
out board ( www.exploringarduino.com/parts/adafruit-DS1307-breakout ); it
combines the IC, the oscillator, a coin cell battery, a decoupling capacitor, and
the I 2 C pull-up resistors into a nice package that can easily be mounted on your
Arduino (see FigureĀ 13-18).
Figure 13-18: Real-time clock breakout mounted on an Arduino
The rest of these instructions assume that you are using this breakout board.
However, you can just as easily assemble these components on a breadboard
and wire them directly to your Arduino. The crystal is a 32.768kHz unit, and
the I 2 C pull-up resistors are 2.2kilohms. The battery is a standard 3.0V coin cell.
If you choose to assemble it yourself, you can buy all these components and put
them on a breadboard as shown in FigureĀ 13-19.
Search WWH ::




Custom Search