Raspberry Pi DS3231 Precision RTC Module for Pico User Manual

June 12, 2024
Raspberry Pi

Raspberry Pi DS3231 Precision RTC Module for Pico

Product Information

The Precision RTC Module for Pico is a high precision real-time clock module designed to be used with the Raspberry Pi Pico microcontroller board. It incorporates the DS3231 high precision RTC chip and supports I2C communication. The module also includes
an RTC backup battery slot that supports a CR1220 button cell for maintaining accurate timekeeping even when the main power is disconnected. The module features a power indicator that can be enabled or disabled by soldering a 0 resistor on the jumper. It is
designed with a stackable header for easy attachment to the Raspberry Pi Pico

What’s on Board:

  1. DS3231 high precision RTC chip
  2. I2C bus for communication
  3. RTC backup battery slot supporting CR1220 button cell
  4. Power indicator (enabled by soldering a 0 resistor on the jumper, disabled by default)
  5. Raspberry Pi Pico header for easy attachment

Pinout Definition:

The pinout of the Precision RTC Module for Pico is as follows:

Raspberry Pi Pico Code Description
A I2C0
B I2C1
C GP20
D P_SDA
1 GP0
2 GP1
3 GND
4 GP2
5 GP3
6 GP4
7 GP5
8 GND
9 GP6
10 GP7
11 GP8
12 GP9
13 GND
14 GP10
15 GP11
16 GP12
17 GP13
18 GND
19 GP14
20 GP15

Schematic:

The schematic diagram of the Precision RTC Module for Pico can be viewed by clicking here.

Precision RTC Module for Pico – Product Usage Instructions

Raspberry Pi Code:

  1. Open a terminal of Raspberry Pi.

  2. Download and unzip the demo codes to the directory Pico C/C++ SDK. Note that the directory of SDK may be different for different users, so you need to check the actual directory. Generally, it should be ~/pico/. Use the following command: wget -P ~/pico https://www.waveshare.com/w/upload/2/26/Pico-rtc-ds3231_code.zip

  3. Navigate to the Pico C/C++ SDK directory: cd ~/pico

  4. Unzip the downloaded code: unzip Pico-rtc-ds3231_code.zip

  5. Hold the BOOTSEL button of Pico and connect the USB interface of Pico to Raspberry Pi. Then release the button.

  6. Compile and run the pico-rtc-ds3231 examples using the following commands:

    cd ~/pico/pico-rtc-ds3231_code/c/build/ cmake .. make sudo mount /dev/sda1 /mnt/pico && sudo cp rtc.uf2 /mnt/pico/ && sudo sync && sudo umount /mnt/pico && sleep 2 && sudo minicom -b 115200 -o -D /dev/ttyACM0

  7. Open a terminal and use minicom to check the sensor’s information.

Python:

  1. Refer to Raspberry Pi’s guides to set up Micropython firmware for Pico.
  2. Open the Thonny IDE.
  3. Drag the demo code to the IDE and run it on Pico.
  4. Click the run icon to execute the MicroPython demo codes.

Windows:

Instructions for using the Precision RTC Module for Pico with Windows are not provided in the user manual. Please refer to the product documentation or contact the manufacturer for further assistance.

Others:

The LED lights on the module are not used by default. If you need to use them, you can solder a 0R resistor on the R8 position. You can view the schematic diagram for more details.

What’s on Board

Raspberry Pi DS3231 Precision RTC Module for Pico-FIG1

  1. DS3231
    high precision RTC chip, I2C bus

  2. RTC backup battery
    supports CR1220 button cell

  3. Power indicator
    enabled by soldering a 0Ω resistor on the jumper, disabled by default

  4. Raspberry Pi Pico header
    for attaching to Raspberry Pi Pico, stackable design

Pinout Definition

Raspberry Pi DS3231 Precision RTC Module for Pico-FIG2

Raspberry Pi Code

  1. Open a terminal of Raspberry Pi
  2. Download and unzip the demo codes to directory Pico C/C++ SDK

Raspberry Pi DS3231 Precision RTC Module for Pico-FIG3

  1. Hold the BOOTSEL button of Pico, and connect the USB interface of Pico to Raspberry Pi then release the button.
  2. Compile and run the pico-rtc-ds3231 examples

Raspberry Pi DS3231 Precision RTC Module for Pico-FIG4

  1. Open a terminal and user minicom to check the sensor’s information.

Raspberry Pi DS3231 Precision RTC Module for Pico-FIG5

Python:

  1. Refer to Raspberry Pi’s guides to setup Micropython firmware for Pico
  2. Open the Thonny IDE, and drag the demo to IDE and run on Pico as below.

Raspberry Pi DS3231 Precision RTC Module for Pico-FIG6
Raspberry Pi DS3231 Precision RTC Module for Pico-FIG7

  1. Click the “run” icon to run the MicroPython demo codes.

Raspberry Pi DS3231 Precision RTC Module for Pico-FIG8

Windows

  • Download and unzip the demo to your Windows desktop, refer to Raspberry Pi’s guides to set up the Windows software environment settings.
  • Press and hold the BOOTSEL button of Pico, connect the USB of Pico to the PC with a MicroUSB cable. Import c or python program into Pico to make it run.
  • Use the serial tool to view the virtual serial port of Pico’s USB enumeration to check the print information, the DTR needs to be opened, the baud rate is 115200, as shown in the picture below:

Raspberry Pi DS3231 Precision RTC Module for Pico-FIG9

Others

  • The LED light are not used by default, if you need to use it, you can solder a 0R resistor on the R8 position. Click to view the schematic diagram.
  • The INT pin of DS3231 is not used by default. if you need to use it, you can solder the 0R resistor on the R5,R6,R7 positions. Click to view the schematic diagram.
    • Solder the R5 resistor, connect the INT pin to the GP3 pin of Pico, to detect the output status of the DS3231 alarm clock.
    • Solder the R6 resistor, connect the INT pin to the 3V3_EN pin of Pico, to turn off the Pico power when the DS3231 alarm clock outputs low level.
    • Solder the R7 resistor, connect the INT pin to the RUN pin of the Pico, to reset Pico when DS3231 alarm clock outputs low level.

Schematic

Raspberry Pi DS3231 Precision RTC Module for Pico-
FIG10

Raspberry Pi DS3231 Precision RTC Module for Pico-
FIG11

References

Read User Manual Online (PDF format)

Loading......

Download This Manual (PDF format)

Download this manual  >>

Related Manuals