Hardware Reference
In-Depth Information
Chapter 4
Real-Time Clock
The Dallas Semiconductor DS1307 Real-Time Clock is the perfect project for the
Raspberry Pi, Model A. Lacking a network port, the Model A cannot determine the
current date and time when it boots up. A 3 V battery attached to the DS1307 will keep its
internal clock running for up to 10 years, even when the Pi is powered off. If you have a
Model B, don't feel left out. There is no reason that you can't try this project too; a Model
B not connected to a network could use the DS1307.
DS1307 Overview
The pinout of the DS1307 chip is provided in Figure 4-1 . The chip is available in PDIP-8
form or in SO format (150 mils). Hobbyists who like to build their own will prefer the
PDIP-8 form.
Figure 4-1. DS1307 pinout
A crystal is wired between pins 1 and 2 (X1 and X2). The battery powers the chip
through pin 3 and flows to ground (pin 4). This keeps the clock alive while the main
power is absent. When there is power, it is supplied through pin 8 (V CC ). The I2C
communication occurs via pins 5 and 6. Pin 7 provides an optional output clock signal or
can operate as an open collector output.
While you could build this circuit yourself, you can find fully assembled PCB
modules using the DS1307 on eBay for as little as $2.36 (with free shipping). These are
available as Buy It Now offers, so you don't have to waste your time trying to win auctions.
Just keep in mind that some are not shipped with a 3 V battery. (Check the product.
 
Search WWH ::




Custom Search