IntermediateDisplays and Timekeeping

OLED Real-Time Clock

Combine a DS3231 clock module and OLED to display the time while learning I²C and timekeeping backup.

Estimated time: 1–2 hours · Skills: I²C devices, time libraries, display setup

Parts from the database

Other supplies

Amazon links may be affiliate links. As an Amazon Associate, Electronics Hobby Hub earns from qualifying purchases.

Connections

  1. On the Pico, connect both breakouts' SDA to GP4 and SCL to GP5; share GND.
  2. Power modules from 3V3 unless their documentation explicitly says otherwise.
  3. Check I²C addresses; if both default to 0x68, the DS3231 and OLED normally differ (0x3C for common SSD1306 modules).

Build steps

  1. Install RTClib and Adafruit SSD1306/ GFX libraries.
  2. Run an I²C scanner and confirm the clock and display addresses.
  3. Set the RTC once to the current time using the library's set-adjust example; remove that line after setting.
  4. Render date and time on the OLED and unplug USB briefly to confirm the coin cell keeps time.

Software and firmware setup

Firmware is required, but a complete combined clock/display sketch is not included yet. Install RTClib, Adafruit SSD1306, and Adafruit GFX; run each library's example separately, then combine the RTC time read with an OLED text update. Set the RTC once, then remove the set-time line before normal use.

Test your build

The clock should advance once per second and preserve time across a short USB power-off when its backup cell is installed.

Troubleshooting

  • A blank OLED may have a different address or 128×32 geometry; check the module listing.
  • If the time resets, check coin-cell orientation and whether the module has a good cell.
  • Do not leave a set-to-compile-time line active after initial setup; it resets the clock on every boot.

Safety and limitations

Use a coin cell only in the intended holder and keep it away from children; do not charge a non-rechargeable coin cell.

Manufacturer and platform documentation

Community Notes for This Project

These are unverified visitor contributions, separate from the build guide and manufacturer specifications. Verify technical advice against the linked datasheets before relying on it.

Set up the comments service to load community notes.

Share a tip or question about this build

← Browse all projects