Skip to Content
Circuitera

DS1307 real-time clock

Keep calendar time through a main power interruption with the DS1307, and check its crystal, battery and I²C supply requirements.

Assembled DS1307 real-time clock breakout with a coin-cell holder
Adafruit DS1307 Real Time Clock module - assembled.jpg by oomlout · CC BY-SA 2.0. Resized and encoded as WebP without cropping.

Timekeeping

The clock stores calendar and time fields in binary-coded decimal. It continues counting on battery backup when main power is unavailable, while ordinary bus access needs sufficient main supply voltage.

Source: Analog Devices

Hardware

A bare IC needs a suitable 32.768 kHz crystal, a backup source within limits and I²C pull-ups. For a module, inspect the backup battery holder and charging circuit before choosing a battery.

Source: Analog Devices

When the time is wrong

Confirm that the oscillator is enabled and set a known time. Read several consecutive values to check that time advances. Crystal and circuit tolerances can cause drift compared with a temperature-compensated RTC.

Source: Analog Devices

Specifications

ParameterValue or conditionSource
Main supply4.5–5.5 V recommendedAnalog Devices
User memory56 bytes of battery-backed SRAMAnalog Devices

Compatibility and practice

Use the recommended main supply and backup circuit. Confirm I²C levels at the MCU.

Sources and datasheets