Skip to the content
2 layers32.5 × 24 mmRpi rtc, the printed circuit board in 3D

Maxim DS3231 Based RTC Module for Raspberry Pi

Size
32.5 × 24 mm
Copper layers
2
Thickness
1.6 mm
Parts
7
Nets
11
Pads
32
Tracks, vias
102, 4
Pours
2
Routed
Yes
KiCad
KiCad 4
Created
28 Jan 2018
Updated
19 Feb 2025

Overview

Rpi rtc is an open-source printed circuit board by skiselev, from the skiselev/rpi_rtc_ds3231 repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 32.5 × 24 mm with 7 parts on 11 nets, routed with 102 tracks and 4 vias.

It is built around the DS3231S# and CR2032. Its parts include 1 capacitor, 1 resistor, 1 IC and 1 connector.

Main components

2

README

README.md

RPi DS3231 RTC

Maxim DS3231 Based RTC Module for Raspberry Pi

Introduction

This is a real-time clock (RTC) module for Raspberry Pi and Raspberry Pi Zero. The module is similar to Adafruit PiRTC, but uses the highly accurate Maxim Integrated DS3231 RTC IC with an integrated temperature-compensated crystal oscillator, and more common CR2032 battery.

RPi RTC Assembled Board and PCBs

Hardware Documentation

Schematic and PCB Layout

RPi RTC Schematic

Bill of Materials

RPi DS3231 RTC project on Mouser.com - View and order all components except of the PCB.

RPi DS3231 RTC on OSH Park - View and order the PCB.

Component typeReferenceDescriptionQuantityPossible sources and notes
PCBRPi DS3231 RTC PCB - Version 1.01Order from OSH Park
Integrated CircuitU1Maxim DS32311Mouser 700-DS3231S#T&R-
CapactiorC10.1uF, 06036Mouser 77-VJ0603Y104JXJPBC
ResistorR110 kohm, 06031Mouser 71-CRCW060310K0FKEB
ConnectorP13x2, 2.54 mm, socket1Mouser 517-929852-01-03-RA
Battery HolderBT1CR2032 Battery Holder1Mouser 712-BAT-HLD-001-THM
BatteryBT1CR20321Mouser 658-CR2032

Software Documentation

Raspbian Configuration

The following steps assume that you have a fairly new Rapbian distribution installed and running on your Rapsberry Pi, and that RPi DS3231 RTC module is plugged into the Raspberry Pi.

Enable I2C Support

Run raspi-config:

text
$ sudo raspi-config

Navigate to the Interfacing Options menu. If this menu is missing (on older Raspbian versions), try the Advanced Options menu instead. Next, select the I2C menu, and answer Yes to Would you like the ARM I2C interface to be enabled? and Would you like the I2C kernel modules to be loaded by default? questions.

Reboot the system

Verify that RTC Module Is Detected

Install i2c-tools package:

text
$ sudo apt-get install i2c-tools

Run i2cdetect -y 1 command and verify that the I2C device is detected at address 0x68:

text
$ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Enable Kernel Support for DS3231 RTC

Open /boot/firmware/config.txt in your favorite editor (nano, vi) as root. For example:

text
$ sudo nano /boot/firmware/config.txt

Add the following lines at the end of the file:

text
# Enable DS3231 RTC
dtoverlay=i2c-rtc,ds3231

Remove fake-hwclock package:

text
$ sudo apt-get -y remove fake-hwclock
$ sudo update-rc.d -f fake-hwclock remove

Enable setting up system time to the RTC time at boot. Open /lib/udev/hwclock-set in your favorite editor:

text
$ sudo nano /lib/udev/hwclock-set

And comment out the following lines:

text
#if [ -e /run/systemd/system ] ; then
# exit 0
#fi

Also comment the following line(s):

text
#/sbin/hwclock --rtc=$dev --systz --badyear
#/sbin/hwclock --rtc=$dev --systz

Save the file, and reboot the system

Setting and Reading the RTC time from Command Line
  • Use hwclock -w command to set the RTC time to the system time. You can use date command to set and verify the system time prior to writing it to the RTC.
  • Use hwclock --set --date=<date_string> command to set the RTC time to the time given by <date_string>
  • Use hwclock -r command to read the time from the RTC

Parts

7
QtyValueFootprintReferences
10.1uFCapacitors_SMD:C_0603_HandSolderingC1
110kResistors_SMD:R_0603_HandSolderingR1
1CR2032my_components:Battery_Holder_CR2032_THMBT1
1DS3231my_components:IC_SOIC16_WideU1
1HOLEmy_components:Hole_2.75mmHOLE1
1OSHW-logo_silkscreen-front_4mmOSHW-logo:OSHW-logo_silkscreen-front_4mmG***
1RPi_Headermy_components:Conn_Pin_Header_2x3_2.54mmP1

Similar boards

  • 2 layers200 × 66 mmNixie control board, the printed circuit board in 3D

    Nixie control board

    shengwen-tw/nixie-clock

    IN-14 Russian nixie tube clock

    79 parts9MIT
  • 2 layers127 × 114.3 mmKbxBinaryClock.v2.1, the printed circuit board in 3D

    KbxBinaryClock.v2.1

    kbx81/RGBBinaryClock

    RGB Binary Clock project files - PCB and source

    138 parts2
  • 2 layers68.6 × 53.3 mmTapMatrix, the printed circuit board in 3D

    TapMatrix

    cbonsig/openclock

    Open Clock: an open source hardware touchscreen digital clock

    31 parts27
  • 2 layers398.2 × 398.2 mmLargeWordClock LargeKickstarter, the printed circuit board in 3D

    LargeWordClock LargeKickstarter

    PCBench/PCBench

    resolution = [0.5, 0.5] pcbfolder = '../PCBs/' pcbnames = ["1Bitsy1bitsy"] iters = 30 env = PCBRoutingEnv(resolution=resolution, pcbfolder=pcbfolder, pcbnames=pcbnames) obs, info = env.reset() for in range(iters): act =…

    1,591 parts21MIT
  • 2 layers167 × 52 mmIn-2-nixie, the printed circuit board in 3D

    In-2-nixie

    mistic100/Nixie-Clock-IN2

    Check out my other projects: - Nixie Clock IN14 - Nixie Clock IN12 - IV-27 VFD Clock

    34 parts10

Questions

How big is the Rpi rtc PCB?

It measures 32.5 × 24 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Rpi rtc use?

7 parts, built around the DS3231S# and CR2032. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Rpi rtc KiCad files?

From the skiselev/rpi_rtc_ds3231 repository on GitHub, at the commit this page was made from: the board is KiCad/rpi_rtc.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Rpi rtc design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).