edit

High Accuracy Pi RTC (DS3231)

The High Accuracy Pi RTC is based on the clock chip DS3231, the DS3231 is a low-cost, extremely accurate I2C realtime clock (RTC). It can provide a real-time clock(RTC) for raspberry pi via the UART interface. With the clock source from the TCXO(temperaturecompensated crystal oscillator), the RTC provides seconds, minutes, hours, day, date, month, and year information. The date at the end of the month is automatically adjusted for months with fewer than 31 days, including corrections for leap year.The clock operates in either the 24-hour or 12-hour format with an AM/PM indicator.

The clock provides two programmable time-of-day alarms and a programmable square-wave output. The INT/SQW pin either generates an interrupt due to alarm condition or outputs a square-wave signal and the selection is controlled by the bit INTCN.

If you want to keep this module timing when the Raspberry Pi is powered off, you need to put a 3-Volt CR1225 lithium cell in the battery-holder.

Note

The battery is not included.

Features

  • Support Raspberry Pi 2/ 3 B/B+ Zero
  • Suport seconds,minuutes,hours,day of week,month, year
  • Support 24-hour or 12-hour format with AM/PM indicator
  • Low-Power Consumption
  • Two Time-of-Day Alarms
  • Fast (400kHz) I2C Interface

Specification

Item Value
Operating Voltage 3.3V
Operating Temperature 0℃ to +70℃
Accuracy ±2ppm from 0°C to +40°C
Interface I2C
I2C Address 0x68

Typical applications

Any applications need Real Time on Raspberry.

Pin Out

Note

1- The chip itself supports the alarm function, we also reserved the relevant hardware interface, but our software library does not include this function(S/INT pin), you need to carry out related software development.

2- RX/TX is not used in this module, but the 6x2 header takes up the RX/TX pin of the Raspberry Pi, so we bring the RX/TX out and come with a 2pin header.

Platforms Supported

Arduino Raspberry Pi BeagleBone Wio LinkIt ONE

Materials required

Raspberry Pi High Accuracy Pi RTC(DS3231)
Get One Now Get One Now

Note

Please plug the USB cable gently, otherwise you may damage the port. Please use the USB cable with 4 wires inside, the 2 wires cable can't transfer data. If you are not sure about the wire you have, you can click here to buy

Install

The driver we provide only applied for Raspbian Jessie/Stretch.

Tip

If you do not know how to use a raspberry pi, please check here before start.

  • Step 1. Driver Installation

Tap the following command in your terminal

1
git clone https://github.com/Seeed-Studio/pi-hats.git

When the download finish, tap the following command in your terminal

1
2
cd pi-hats
sudo ./install.sh -u rtc_ds3231
  • Step 2. Power off Raspberry Pi
1
sudo shutdown -h now
  • Step 3. Insert the HAT to Raspberry Pi

Please make sure plug the pin 1 of this hat into the pin 1 of raspberry GPIO, just like the picture above.

  • Step 4. Power up Raspberry Pi

Usage

Now you can use the command to check whether the driver is installed successfully.

1
./install.sh -l

If you want to uninstall the driver you can use the command below:

1
sudo ./install.sh -u

Now let's see what the RTC module can do:


Read hardware clock and print result

1
sudo hwclock -r

Set the system time from the hardware clock

1
sudo hwclock -s

Set the hardware clock from the current system time

1
sudo hwclock -w

More usage

1
hwclock --help

Resources

Project

This is the introduction Video of this product

Tech Support

Please do not hesitate to submit the issue into our forum