Skip to content
A project ofgwark.dev

Analog Devices (Maxim) · Integrated circuit

DS1307 Real-Time Clock

The cheap I2C clock chip. Keeps time on a coin cell for years and drifts minutes a month, because the crystal is bare and uncompensated.

Cheat sheet (SVG)
Logic level
4.5-5.5 V
Package
PDIP-8 / SOIC-8

1.Pinout diagram

Highlight a signalhover to preview, click to keep

Pins 1-4

DS1307

Pins 5-8

Pin detail

Hover a pin for its mappings and gotchas. Click to keep it here.

Logic level
4.5-5.5 V
Package
PDIP-8 / SOIC-8

Fig. 1. DS1307 Real-Time Clock, PDIP-8. Hover or tap a signal to light up every pin that carries it.

2.Watch out

3.Minimum circuit

What has to go around the chip before it will run.

VCCGNDDS1307CR2032 cell between VBAT (3) and GNDCR2032cell4.7 kOhm between SDA (5) and VCC4.7 kOhm4.7 kOhm between SCL (6) and VCC4.7 kOhm100 nF between VCC (8) and GND100 nFGND (4) to GNDVCC (8) to VCC32.768 kHz crystal between X1 (1) and X2 (2)32.768 kHz crystalX1 1X2 2VBAT 3GND 4SDA 5SCL 6VCC 8VCC 8
Fig. 2. Minimum circuit, drawn from Table 1. Crossing wires are not connected.
Table 1. External parts, and why each one is there.
PartBetween
32.768 kHz crystalX1 (1) to X2 (2)
CR2032 cellVBAT (3) to GND
4.7 kOhmSDA (5) to VCC
4.7 kOhmSCL (6) to VCC
100 nFVCC (8) to GND

Stray capacitance around the crystal is the main reason a hand-built DS1307 runs fast or slow. The DS3231 puts the crystal on-die and avoids the problem.

4.Full pin reference

Every pin, alias and mapping. This is the table that prints.

Table 2. Pin assignments.

Complete pin reference for DS1307 Real-Time Clock
PinNameFunctions

Found a wrong pin? The whole board is one file, data/boards/ds1307.json.

Edit this file on GitHubReport it instead