TINKER PiEDESIGN IN INDIA

Real-time clock DS3231 with TinkerPie

A clock with a coin battery: alarms, timers, data logging.

TypeSmart sensors (I2C)
Connect toSENSOR port · 0x68
Givestime and date, kept by its battery
SimulatorYes: a control appears under the simulated board

How it works

The DS3231 is a real-time clock: it keeps counting seconds, minutes, hours and dates even when the board is off, using a coin cell. Its crystal is temperature-compensated, so it drifts only about a minute a year.

How to wire it

Plug into any SENSOR 1-4 port (SDA, SCL, 3.3 V, GND). Each type has a fixed I2C address, so different types can share the bus.

Code

In blocks: Accessories category in TinkerPie Studio. As code:

// JavaScript
clock.hour()
clock.minute()
clock.set(2026, 10, 13, 9, 30, 0)

// Arduino C++
clock::hour()
clock::minute()
clock::set(2026, 10, 13, 9, 30, 0)

Good to know

Projects with the Real-time clock DS3231

Digital clockA DS3231 clock module keeps the time; a 4-digit display shows hours and minutes. Button A sets the time.Sensor projects

Similar modules

Questions

Can I try the Real-time clock DS3231 without buying one?

Yes. In TinkerPie Studio the simulator shows a control for it under the board, so you can test your program before you build it.

Why do I need a clock module if the board has Wi-Fi?

Without Wi-Fi the board forgets the time when it restarts. The DS3231 keeps the right time on battery, which is perfect for timers, alarms and data loggers.