Skip to content
MCU Atlas
moduleunknown

DS3231 RTC module

DS3231 real-time clock module with a temperature-compensated crystal: ±2 ppm timekeeping, coin-cell backup, two-wire I2C wiring to an Arduino Uno, ESP32 or STM32, and a fit-checked roundup of 3D-printable cases for every module variant. It keeps time in our Arduino Uno e-ink weather station.

Datasheet

Specifications

InterfaceI²C, up to 400 kHz
I2 C address0x68 fixed (the datasheet address is 1101000)
Supply voltageVCC 2.3–5.5 V
Timekeeping accuracy±2 ppm from 0 to +40 °C; ±3.5 ppm from −40 to +85 °C
Active supply current200 µA typ (VCC = 3.63 V)
Battery timekeeping current0.84 µA typ, 3.0 µA max (VBAT = 3.63 V)
Onboard temperature sensor±3 °C accuracy
Package / temp range16-pin, 300-mil SO; commercial 0…+70 °C and industrial −40…+85 °C ranges

DS3231 enclosures and 3D-printable cases

The 3D-model directories rank DS3231 cases by popularity, but none of them answers the question that decides your print: which case fits the DS3231 module you actually have. Three different boards are sold as a "DS3231 module" — the common battery-backed ZS-042-style board (38.5 × 22 mm, 13 mm thick over the coin-cell holder), the 3-in-1 DS3231SN LED clock/thermometer/voltmeter panel (40 × 13 mm), and the two Adafruit breakouts (23 × 17.6 mm and 25.4 × 17.8 mm) — and their cases do not interchange: a 3-in-1 housing's ~13 mm display slot cannot swallow the 22 mm-wide ZS-042, and a ZS-042-sized cavity leaves an Adafruit board more than 14 mm of rattle room. The tables below pair each variant with the cases whose fit we could actually check.

Three DS3231 module variants drawn to one scale: the common battery-backed ZS-042-style module at 38.5 by 22 mm with its 13 mm-tall coin-cell holder, the 3-in-1 DS3231SN LED-display module at 40 by 13 mm, and the Adafruit 5188 breakout at 25.4 by 17.8 mm with the smaller 3013 shown dashed — no two of these cases interchange.
DS3231 module variants at true scale — board outlines and heights from vendor pages (Bastelgarage, Parallax, LaskaKit, Aretronics, Adafruit), checked 2026-11-26. Diagram: MCU Atlas.

What we verified vs what the case authors claim. Module dimensions come from live vendor pages (checked 2026-11-26). Case dimensions marked measured are ours: the STL was downloaded and its bounding box computed with a binary-STL parser (2026-11-26, four files, hashes on file). Everything else is the case author's own description, taken from the linked page. Fit ratings are used exactly as verified — CONFIRMED means the dimension comparison closes; LIKELY means the author designed the case for that module but publishes no internal dimensions; NO MATCH means the numbers rule it out. No LIKELY rating has been upgraded.

Cases for the common battery-backed module (ZS-042 style)

The module: a 38–38.5 × 22 mm board, 13 mm high over the battery holder on the back (14 mm counting header pins), 6-pin 2.54 mm header on one edge, M2 mounting holes in the corners (dimensions per the Bastelgarage and Parallax product pages). The one-minute answer if you own the common blue module: start with Mauricio_Ivan's compact case — a free CC BY-SA 4.0 download that covers the PCB and the CR2032 holder while leaving the I2C pins accessible. Its fit rating is LIKELY, not CONFIRMED, because the page publishes no internal dimensions: before committing filament, check that the cavity is at least 39 × 23 × 13 mm to clear the board and its holder. If you would rather have a case generated to exact measurements than a fixed STL, the SpeakCAD row below does that.

CaseLicenseFitPrint notes
Compact Case for DS3231 RTC Module — Mauricio_Ivan, ThingiverseCC BY-SA 4.0LIKELY4× M2.5×7 self-tapping screws; PLA, PETG or ABS, 0.2 mm layers, 15–20 % infill; covers PCB and coin cell, pins accessible; no internal dimensions published — verify cavity ≥ 39 × 23 × 13 mm
Housing for Realtime Clock RTC DS3231 — TheBestDaddy, Cults3D (paid: $1.56, checked 2026-11-26)CULTS PU — printing allowed, no remix or redistributionLIKELYTwo-piece housing and lid, M2 wood screws; PLA, 0.18 mm layers, 30 % infill, no supports, no rafts; an opening swaps the coin cell without opening the case; dimensions exist only as sketch images, and the author asks buyers to verify fit
DS3231 Real Time Clock modules mount — Dyne, Thingiverse (canonical page; the Printables listing is an import)CC BY-NC-SA 4.0LIKELYOpen mount, no cover — the module bolts on with M2 screws through its corner holes, external tabs take M3; no print settings given; the NC term forbids commercial use of the design
DS3231 RTC module case generator — SpeakCAD, a generate-to-measurement service, not a downloadable STLProprietary service; generated parts are yoursLIKELYReference design: 39 × 23 × 12 mm cavity, 6-pin header slot, 22 mm back opening over the coin cell, two M2.5 pegs; the 12 mm depth is 1 mm short of the 13 mm module, so enlarge the depth when generating; 4 credits per part, Maker plan $7.99/month (checked 2026-11-26)
The Mauricio_Ivan compact case for the common battery-backed DS3231 module: a screwed-together box designed around the 38.5 by 22 by 13 mm ZS-042 board and its coin-cell holder. Fit is LIKELY — no internal dimensions are published, so check for a 39 by 23 by 13 mm cavity before printing.
Mauricio_Ivan · Thingiverse thing:7339741 · CC BY-SA 4.0 — author's preview render, cropped (adaptation under CC BY-SA 4.0).

All four rate LIKELY for the same reason: none of the authors publishes machine-checkable internal dimensions — the fit evidence is the author's stated intent (plus, for SpeakCAD, a reference cavity you can adjust). Note the two licensing outliers before you print: the Cults3D housing is a paid download whose license forbids remix and redistribution, and the Dyne mount's CC BY-NC-SA forbids commercial use — fine for a one-off desk build, not for a product you sell.

Cases for the 3-in-1 DS3231SN LED-display variant

The panel module is a 40 × 13 mm front face with 0.39-inch digits, 13 mm deep, no battery holder — it needs a case with a display window, not a PCB cavity (dimensions per the LaskaKit and Aretronics product pages). The pick: cornneliu's Voltmeter+Clock+Thermometer housing, designed for the red 3-in-1 DS3231SN AliExpress module and shipped as two STLs — straight and angled face — which we measured at 57.6 × 15.4 × 19.7 mm and 57.0 × 15.4 × 20.0 mm outer. kr75's box is the alternative, designed for the blue module, adding a USB-plug cutout for the power lead.

CaseLicenseFitPrint notes
Voltmeter+Clock+Thermometer housing — cornneliu, ThingiverseCC BY 4.0LIKELYSTLs measured: outer 57.6 × 15.4 × 19.7 mm (angled) and 57.0 × 15.4 × 20.0 mm (straight); snap or slide fit, no screws; at a ~15.4 mm outer depth the clearance over the 13 mm module is 0.0–0.4 mm — a clone board even slightly taller than 13 mm will not fit; no print settings stated
Box for litle clocks (with usb plug) — kr75, ThingiverseCC BY 4.0LIKELYDesigned for the blue 3-in-1 module (linked in its description); USB-plug cutout at the power lead; no dimensions published — the STL is not downloadable without a Thingiverse login
Printed housing for the 3-in-1 DS3231SN clock module by cornneliu, rendered from the author's STL: a 57 mm-long sleeve the 40 by 13 mm display module slides into. Fit is LIKELY — the measured outer shell is 57.0 by 15.4 by 20.0 mm, so a clone module taller than 13 mm will not fit.
cornneliu · Thingiverse thing:2256356 · CC BY 4.0 — rendered by MCU Atlas from the author's STL.
The kr75 printed box for the 3-in-1 DS3231SN clock module: an open case with a USB-plug cutout at the power lead, sized for the 40 by 13 by 13 mm display module. Fit is LIKELY — the design is author-fitted with no published dimensions.
kr75 · Thingiverse thing:3583061 · CC BY 4.0 — author's preview render, cropped.

The honest gap: no 3-in-1 case with published internal dimensions exists anywhere we searched — Printables, Thingiverse, Cults3D, MakerWorld, STLFinder and maker blogs all carry author-fitted, undocumented designs at best (a PrusaPrinters-listed candidate's source page is dead, so it is not cited here). Both rows above are LIKELY by necessity: print the first few layers and test-fit the panel before committing the full housing.

Cases for the Adafruit DS3231 breakouts (3013 and 5188)

No dedicated case STL exists for either Adafruit breakout — not on Printables, Thingiverse, Cults3D, STLFinder or MakerWorld. The 3013 is a 23 × 17.6 mm board 7.2 mm high; the STEMMA QT 5188 is 25.4 × 17.8 mm and 7.8 mm high, both with the CR1220 holder on the back (dimensions per Adafruit's product pages). The closest verified option is not a standalone case at all: the enclosure from Adafruit's own digital-clock project, whose mount we measured and whose guide documents the 5188 held with M2.5 hardware.

OptionLicenseFitPrint notes
Digital Clock with CircuitPython enclosure — Ruiz Brothers, Adafruit Learning SystemAdafruit Learn; STLs and Fusion 360 CAD freely downloadable from the guideCONFIRMED for the 5188 onlyMeasured: Casing 138.0 × 62.4 × 74.9 mm, PCB Mount 60.0 × 51.3 × 6.0 mm; the 25.4 × 17.8 × 7.8 mm 5188 mounts with 2× M2.5×6 mm screws next to a Feather RP2040; PLA, prints without supports — but it is a whole clock build, not a standalone RTC case
The Ruiz Brothers CircuitPython digital-clock enclosure, the closest verified option for the Adafruit DS3231 STEMMA QT breakout: a whole-clock case whose measured PCB mount carries the 25.4 by 17.8 mm 5188 board on M2.5 screws. CONFIRMED for the 5188 only — there is no purpose-built case for the 3013.
Ruiz Brothers / Adafruit Learning System — learn.adafruit.com/digital-clock-with-circuitpython · render: MCU Atlas.

For a 3013, or for a standalone case for either board, nothing verified exists. Do not try a ZS-042 case as a substitute: a 39 × 23 mm-class cavity is a NO MATCH — too loose by more than 14 mm, with the board rattling unless you add foam or a custom spacer. The practical route is designing your own shell: a CAD model of the 3013 board itself exists on GrabCAD (search "Adafruit 3013 DS3231") to model against — a model of the board, not a case.

Wiring: I2C to an Uno, ESP32 or Blue Pill

Four pins do all the work: VCC, GND, SDA and SCL. The DS3231 is an I2C peripheral with a fixed 7-bit address of 0x68 — the datasheet writes it as 1101000 — so it shares a bus with other sensors without address jumpers. Both bus pins are open-drain: the chip needs external pull-up resistors to see any bus traffic, and the pull-up rail may sit anywhere up to 5.5 V regardless of the chip's own VCC. Most breakouts — Adafruit's included — carry their own pull-ups; if an I2C scanner finds nothing at 0x68, add 4.7 kΩ pull-ups on SDA and SCL and re-check the wiring.

BoardSDASCLModule power
Arduino Uno / ATmega328PA4A55 V or 3.3 V
ESP32 DevKitCGPIO 21GPIO 223.3 V
STM32F103 Blue PillPB7PB63.3 V

Pin facts per lane: the Uno's hardware I2C sits on A4 (SDA) and A5 (SCL) per Arduino's documentation; the ESP32's Arduino core defaults to GPIO 21 (SDA) and GPIO 22 (SCL), with the GPIO matrix able to route I2C to almost any pin; on the Blue Pill, I2C1 defaults to PB6 (SCL) and PB7 (SDA), and a second bus, I2C2, sits on PB10/PB11.

Level shifting: usually you don't need it. The clean fix is a 3.3 V rail — power the module from the 3.3 V pin of an ESP32 or Blue Pill and its onboard pull-ups land the bus at 3.3 V, comfortably above the DS3231's 0.7 × VCC logic-high threshold at that supply (2.31 V). What doesn't work is the reverse: a 5 V-powered module with its pull-ups at 5 V on 3.3 V-only GPIOs. The DS3231 tolerates it (pull-ups to 5.5 V are allowed regardless of VCC), but ESP32 and Blue Pill bus pins are not 5 V tolerant. Adafruit's breakout sidesteps the question with support circuitry for both 3.3 V and 5 V logic.

Before you fit a CR2032 in a cheap ZS-042-style module: those boards carry a charging circuit — a 1N4148 diode plus a 200 Ω resistor (marked 201) from VCC to the battery holder — designed for a rechargeable LIR2032 cell. A standard CR2032 must not be charged: on a 5 V rail that circuit pushes current into the cell, and community reports include swollen, venting cells. Use an LIR2032 as designed, or remove the diode or the resistor before fitting a CR2032. The DS3231 chip itself is UL recognized against reverse charging with primary lithium cells — the hazard is the module's add-on circuit, not the chip.

One scanner surprise: most ZS-042-style boards also carry an AT24C32 EEPROM on the same bus, answering at 0x57. Two devices on a scan is normal, not a fault. Our Arduino Uno e-ink weather station is a real build around this module — and if you're putting one in a box, see the enclosure section on this page for which 3D-printable case fits which module variant.

Accuracy: what ±2 ppm actually buys

The headline spec: frequency stability of ±2 ppm from 0 °C to +40 °C, and ±3.5 ppm from −40 °C to +85 °C, measured with the aging register at 00h. Adafruit's translation is the useful one — ±2 ppm is about ±1 minute per year — and the arithmetic agrees: 2 ppm × 525,960 minutes per year works out to ±1.05 minutes.

How it stays there. The crystal lives inside the chip, next to an on-die temperature sensor. The DS3231 measures temperature at power-up and then once every 64 seconds, looks up the capacitance the oscillator needs at that temperature, and switches internal capacitors in or out to pull the frequency back. That is the TCXO in the part's title — temperature-compensated crystal oscillator — and it is why the DS3231 holds ±2 ppm where an ordinary 32 kHz crystal drifts tens of ppm across a room's temperature swing. The same sensor is readable over I2C at ±3 °C accuracy: handy for logging, not for calibration.

What time does to it: aging. Crystals drift as they age. The datasheet specifies crystal aging at ±1 ppm in the first year and ±5 ppm over 0–10 years (measured after reflow, not production tested) — a worst-edge 5 ppm cumulative drift is roughly 26 minutes over a decade. The DS3231 gives you a correction: the aging offset register (0x10h) takes a signed value that adds or removes capacitance from the oscillator's array — one LSB is one small capacitor, worth about 0.1 ppm at +25 °C (0.7 ppm at −40 °C) — and the trim is folded in at the next temperature conversion, which you can force with the CONV bit. In practice, a module that has drifted for a few years can be nudged back if you can measure it against a known-good reference for a few weeks.

What it is not. A clock, not a lab reference: the compensation targets the 1 Hz tick that drives the calendar, and while the 32 kHz output is also temperature-compensated, Maxim's application guidance (relayed in a community comparison of DS3231 variants) is that the design is strictly focused on the most accurate 1 Hz signal, not on being a 32 kHz reference.

DS3231, DS3231S and DS3231SN — what the suffixes mean

The suffixes confuse module listings, but the datasheet's ordering table is short:

PartTemperature rangePackageAccuracy difference
DS3231S#0 °C to +70 °C (commercial)16-pin, 300-mil SOnone
DS3231SN#−40 °C to +85 °C (industrial)16-pin, 300-mil SOnone

The N is the industrial-temperature option, not an accuracy grade. Both order codes carry the same ±2 ppm from 0 °C to +40 °C and ±3.5 ppm outside it; the SN simply holds that ±3.5 ppm across the full −40 °C to +85 °C industrial span where the commercial S part is only rated to +70 °C. Modules almost always ship with an SN-marked chip, which is fine — you get the industrial range whether you needed it or not. If a listing claims the SN is "more accurate", the ordering table is the refutation.

The letter that does change the silicon is M. The DS3231M replaces the internal crystal with a MEMS oscillator: ±5 ppm instead of ±2 ppm, and it is an RTC only — no TCXO output, and the INT/SQW pin offers just a 1 Hz signal or an interrupt where the crystal parts can output programmable square waves (per a community comparison of the two chips, working from their datasheets). For a project that only needs a calendar, the M still works; for anything leaning on the accuracy, the SN is the one to buy.

DS3231 FAQ

Does it need pull-up resistors? The chip does: SDA and SCL are open-drain with no internal pull-ups (the RST pin is the only one with an internal resistor, a nominal 50 kΩ). Modules almost always include them, so in practice you add pull-ups only when a bare chip or an unusual board is involved. If an I2C scanner finds nothing at 0x68, missing pull-ups are the first thing to check — 4.7 kΩ to the logic rail is the standard fix.

Can I use a CR2032 in my module? Only once the charging circuit is dealt with — see the warning in the wiring section above. Unmodified ZS-042-style boards want a rechargeable LIR2032; a CR2032 is safe after the diode or 200 Ω resistor is removed.

How long will the coin cell last? The datasheet's timekeeping current on battery is 0.84 µA typical (3.0 µA maximum). Against a 220 mAh CR2032, that arithmetic is decades on paper — far past the cell's own shelf life — so expect the battery, not the chip, to be the limit. The ~40 mAh LIR2032 in an unmodified module works out to roughly five years, and it tops up whenever the board is powered (cell capacities per module guides).

What I2C address does it use? 0x68, fixed — the datasheet's 1101000. There is no address-select pin. Boards with the AT24C32 EEPROM add a second device at 0x57.

Does it work with 3.3 V boards? Yes — the supply range is 2.3–5.5 V, and running the module at 3.3 V puts its pull-ups in the right place for ESP32, Pico and Blue Pill GPIOs. Adafruit's breakout explicitly supports both 3.3 V and 5 V logic.

Questions about putting one in a 3D-printed case — which box fits which module variant — are answered in the enclosure section on this page.

Projects Using DS3231 RTC module3

Arduino Uno e-ink home weather station
Illustration
ARDUINOUNO
A beginner-friendly weather station on an Arduino Uno: a Waveshare 4.3in e-ink display, BME280 sensor and DS3231 clock show home conditions at a glance.
Beginner·Code
6 parts listed
EBCTester V2: an ESP32-S3 brain for ZKE battery testers — days-long tests with no PC
Illustration
ESP32ESP32-S3
Open firmware that makes a ZKE EBC battery tester standalone: an ESP32-S3 runs charge and discharge plans for days, logs to microSD and serves a web UI.
Intermediate·Code
7 parts listed
Smart beehive scale: weigh your hive with an ESP32, HX711 and a load cell
Illustration
ESP32
An ESP32, an HX711 amplifier and a bar-type load cell turn a hive stand into a telemetry station: weight every day, temperature beside the brood, and a graph on your phone — so you watch the nectar flow come in and catch the swarm sign from your kitchen, without opening the hive once.
Beginner·Code
9 parts listed
Where to Buy
Stores we've checked for this part

Heads up: some Buy links are affiliate links. If you buy through one, MCU Atlas may earn a small commission at no extra cost to you. It never changes which parts we list. How this works

Check the store for current price and stock.