Skip to datasheet
The Engineering ProjectsAI Interactive Datasheet

DS3231Temperature-compensated I²C real-time clock

Keep calendar time through a main-power interruption.

Manufacturer-referenced

Analog Devices · DS3231SN#

Wide SOIC-1619-5170 · Rev 10 · March 2015

DS3231 combines a real-time clock, a quartz resonator and temperature compensation inside one wide SOIC package. It keeps seconds, minutes, hours and calendar information, while two programmable alarms and clock outputs support timed events. No external crystal or crystal load capacitors are needed. A backup supply preserves time when the main rail fails. The selected DS3231SN industrial device covers −40 to +85°C; the clock accuracy is specified over temperature, while the readable temperature value is primarily used for oscillator compensation. This is the sixteen-pin DS3231, not the differently packaged DS3231M. The example uses a 3.3 V host, a 3 V backup cell and pulled-up I²C lines at address 0x68. Read the oscillator-stop flag before trusting an inherited date, then set and validate the calendar when needed. The example clock and drift figures are illustrative, not measurements of a connected device.

Real View

DS3231SN# black Wide SOIC-16 package with silver contacts and readable marking.
DS3231SN# · Wide SOIC-16Package illustration

Pinout

DS3231SN#Wide SOIC-16Top view
Select a pin to see its functionWide SOIC-16 · 16 pins

PCB Footprint

Loading footprint…
Powered by
Finding Wide SOIC-16 packageTop view · mm

3D View

Preparing 3D preview…
3D packageDrag to rotate · Scroll to zoom
Clock and alarm outputsSupply and required ground connectionsReset monitorI²C interface
DS3231SN#Wide SOIC-16Top view

Click a lead or use the arrow keys. Top view

1
PIN 1 · Clock and alarm outputs

32kHz

Open-drain clock output

Function

Temperature-compensated 32.768 kHz output when enabled.

How to connect

Leave open if unused; add a pull-up if used.

Electrical note

EN32kHz controls this output.

At a glance

Temperature-compensated I²C real-time clock

A compensated oscillator drives the calendar, while the power-control circuit selects the available supply.

2.3–5.5 VSupply / backup
±2 ppm · 0–40°CClock accuracy
0x68 7-bitI²C address
−40–85 °CIndustrial range

Operating profile

DS3231SN#

Package
Wide SOIC-16DS3231SN#
Integrated resonator
32.768kHz
Backup example
3 VNo charging circuit inside the IC

Electrical and timing limits

Key parameters and their test conditions

VCC / VBAT
2.3–5.5 VConditions / notes: 3.3 V main and 3 V backup in the example
Clock accuracy, 0–40°C
±2 ppmConditions / notes: Specified oscillator conditions
Clock accuracy, −40–85°C
±3.5 ppmConditions / notes: Industrial grade
I²C rate
Up to 400 kHzConditions / notes: Fixed address 0x68
Temperature resolution
0.25°CConditions / notes: Signed two-register result
Temperature accuracy
±3°CConditions / notes: Not a precision ambient thermometer

Package details

Follows the selected physical package

Manufacturer
Analog Devices
Part number
DS3231SN#
Package
Wide SOIC-16
Connections
16 pins
Mounting
SMD
Lead pitch
1.27 mm
Package code
Wide SOIC-16
Thermal reference
See operating and package limits

Connections by function

Select a pin to open its function, electrical notes and wiring guidance.

Clock and alarm outputs2 pins

Supply and required ground connections11 pins

Reset monitor1 pins

I²C interface2 pins

Power and retain

Main VCC runs the clock; VBAT maintains time during an interruption.

Compensate the crystal

Temperature is sampled automatically about every 64 seconds.

Read valid time

Check OSF, decode BCD fields and handle the selected hour mode.

±2 ppm corresponds to ±0.1728 seconds per day from the frequency-error term alone. Aging, calibration and conditions still matter.

DS3231 package cutaway with internal crystal, temperature compensation, calendar, alarm registers and battery switchover.
Original functional architecture; not a die photograph.
DS3231 wide SOIC wired to3.3Vhost withpullups100nFbypass3Vbackupcellandrequiredgroundpins.
Named nodes join; unused outputs are intentionally open.

Pin reference

Select a pin to explore its function and connection.

16 pins
PinSignalTypeFunction
32kHzOpen-drain clock outputTemperature-compensated 32.768 kHz output when enabled.
VCCMain supplyMain operating supply.
INT/SQWOpen-drain interrupt / square waveAlarm interrupt or programmable square wave, selected by INTCN.
RSTOpen-drain reset / button inputSupply monitor reset output and debounced pushbutton input.
NCConnect to groundManufacturer requires these unused package connections to ground.
NCConnect to groundManufacturer requires these unused package connections to ground.
NCConnect to groundManufacturer requires these unused package connections to ground.
NCConnect to groundManufacturer requires these unused package connections to ground.
NCConnect to groundManufacturer requires these unused package connections to ground.
NCConnect to groundManufacturer requires these unused package connections to ground.
NCConnect to groundManufacturer requires these unused package connections to ground.
NCConnect to groundManufacturer requires these unused package connections to ground.
GNDGroundSupply and interface reference.
VBATBackup supplyMaintains the oscillator and calendar when main power is unavailable.
SDAI²C dataBidirectional open-drain data.
SCLI²C clockSerial clock input.
Wide SOIC-16 · Top view · Select a pin number to inspect its connection.

Electrical and timing limits

Selected DS3231SN industrial reference

ParameterValueConditions / notes
VCC / VBAT2.3–5.5 V3.3 V main and 3 V backup in the example
Clock accuracy, 0–40°C±2 ppmSpecified oscillator conditions
Clock accuracy, −40–85°C±3.5 ppmIndustrial grade
I²C rateUp to 400 kHzFixed address 0x68
Temperature resolution0.25°CSigned two-register result
Temperature accuracy±3°CNot a precision ambient thermometer
Temperature updateAbout every 64 secondsManual conversion also available

Frequency accuracy is not a guarantee of total lifetime calendar error.

Calendar register map

Packed BCD, not plain binary

ParameterValueConditions / notes
0x00 / 0x01Seconds / minutes00–59
0x02Hours12-hour or 24-hour format
0x03Day of week1–7; application chooses the naming convention
0x04Date1–31 subject to month
0x05Month and century bitMonth 1–12
0x06Year00–99
Read sequenceBurst from 0x00Decode fields and check validity

Do not increment a BCD byte as if it were a binary decimal count.

Alarm and square-wave controls

INT/SQW is shared

ParameterValueConditions / notes
Alarm 1Registers 0x07–0x0AIncludes seconds matching
Alarm 2Registers 0x0B–0x0DMinute-resolution matching
INTCN = 1Alarm interrupt functionEnable A1IE/A2IE as required
INTCN = 0Square-wave functionRS2/RS1 select frequency
Square-wave choices1 Hz / 1.024 / 4.096 / 8.192 kHzOutput needs a pull-up
A1F / A2FLatched status flagsWrite zero to clear after service
32kHz outputSeparate pin 1EN32kHz controls enable

The reset configuration selects interrupt mode; it does not automatically output a square wave.

Control and status registers

0x0E and 0x0F

ParameterValueConditions / notes
EOSC, control bit 70 enables backup oscillationWith VCC present the oscillator remains enabled
BBSQW, bit 6Backup square-wave permissionObserve the documented supply conditions
CONV, bit 5Force temperature conversionWait until not busy
RS2/RS1, bits 4/3Square-wave dividerUsed when INTCN is zero
INTCN / A2IE / A1IEControl bits 2 / 1 / 0Interrupt selection and enables
OSF, status bit 7Oscillator stopped / invalid-time warningCheck at startup; clear after setting valid time
EN32kHz / BSY / A2F / A1FStatus bits 3 / 2 / 1 / 0Preserve unrelated bits on updates

Read-modify-write control registers carefully, especially shared alarm flags.

Temperature and aging trim

Calibration support

ParameterValueConditions / notes
Temperature MSBRegister 0x11Signed integer part
Temperature fractionRegister 0x12 bits 7–6Quarter-degree fraction
Example bytes0x19 / 0x40+25.25°C
Aging register0x10, signed eight-bitAdjusts oscillator trim
Positive aging valueAdds capacitanceSlows the oscillator
CalibrationUse a reliable frequency/time referenceDo not infer a trim from one noisy sample

The temperature sensor is used internally to stabilize timekeeping.

3.3 V host and backup circuit

All required supply connections

ParameterValueConditions / notes
VCC2 / GND133.3 V / groundPlace 100 nF close to the package
VBAT143 V primary cell positiveCell negative to ground; no charger
SDA15 / SCL16Host I²C4.7 kΩ pull-ups to the host rail
NC5–NC12Connect every one to groundManufacturer requirement
RST4Optional button to groundInternal pull-up; do not add an external pull-up
32kHz1 / INT/SQW3Optional outputsLeave open when unused; pull up when used

Use the bare-IC pin map; breakout modules may add charging or unrelated circuitry.

Startup and time validation

Reliable host sequence

ParameterValueConditions / notes
Apply main powerInitialize I²C at 0x68Backup-only first connection has special startup behavior
Read statusInspect OSFA stopped oscillator can mean invalid time
Set time if neededWrite valid BCD calendar fieldsChoose hour format explicitly
Clear OSFAfter establishing correct timePreserve the other status bits
Read coherent calendarUse a burst transactionValidate month/day/hour ranges
Configure alarmsWrite masks then enablesClear pending flags deliberately
Power interruptionCalendar continues from VBATDo not assume the rest of the host stays powered

First backup-cell connection alone does not start normal timekeeping until VCC or a valid I²C address is applied.

Take it into ProTech

Find DS3231 in the Components Library to place its schematic symbol and connect its pins.

Working clock example available in ProTechOpen ProTech

Component view