User Tools

Site Tools


chronopi

This is an old revision of the document!


ChronoPi

ASCIIASCII The ChronoPi is an extremely accurate real time clock module designed for use with the Raspberry Pi Models 1, 2, and 3. It is based on the DS3231 temperature compensated RTC (TCXO). It includes a CR1220 battery which should last at least 3-4 years without power…longer if power is usually available. No external crystal or tuning capacitors are required.

The DS3231 has an internal crystal and a switched bank of tuning capacitors. The temperature of the crystal is continuously monitored, and the capacitors are adjusted to maintain a stable frequency. Other RTC solutions may drift minutes per month, especially in extreme temperature ranges…the ChronoPi will drift less than a minute per year. This makes the ChronoPi very well suited for time critical applications that cannot be regularly synchronized to an external clock.

Applications that may benefit from accurate timekeeping include:

  • Security cameras or intrusion logging systems
  • Punch clock systems for work start and stop times
  • Capturing satellite signals with software-defined radio
  • Recording television broadcasts
  • Weather & news display mirror with alarm clock function

The ChronoPi will plug into the GPIO header of a Raspberry Pi single board computer, and will not otherwise interfere with Raspberry Pi connectors or most optional processor heatsinks.

Time information is sent and retrieved over the Raspberry Pi's I2C interface. This is fully supported by Raspbian Linux, which even recognizes the ChronoPi's internal temperature sensor to allow users access to the current ambient temperature.

Features

Controller: Maxim DS3231SN
Function: Temperature-compensated RTC
Accuracy: ± 3.5ppm at -40C to +85C (~1 minute per year)
Power Supply: 2.3 to 5.5 V DC
Current: 200uA (active), 840nA (timekeeping)
Dimensions: 23mm x 13.5mm x 12.5mm
Pin Spacing: 0.1 inches

Assembly

The ChronoPi has a top-mounted battery holder – no soldering required. Simply remove the included CR1220 battery from its packaging, and slide into the battery holder. Please ensure the top (marked +) side of the battery is facing the top of the battery holder (also marked +).

Power Connections

The 3V3 and GND pins are used to power the ChronoPi when it is connected to a Raspberry Pi. While typical usage will be with the Raspberry Pi's 3.3 volt GPIO levels, the ChronoPi will also operate between 2.3 and 5.5 volts.

Battery

The battery is a 3V lithium CR1220 coin cell, provided with every ChronoPi purchase. You should install the battery before use, to prevent loss of timekeeping during power off cycles.

SDA/SCL

The SDA and SCL pins are used to communicate with the ChronoPi, using the I2C standard interface. The I2C bus requires pullup resistors from SDA and SCL to 3V3. Since the Raspberry Pi already has the resistors in place, these are not implemented on the ChronoPi itself.

Datasheet

The DS3231 datasheet provides all other necessary information such as registers, maximum voltages, power consumption, and special features.

Installation

With the Raspberry Pi power off, plug the ChronoPi into the far left (pin 1) side of the GPIO header as shown below:
ASCII

Setup

  1. Plug the ChronoPi into the far left side of the Raspberry Pi GPIO header
  2. Open the micro-SD card boot folder and edit config.txt
  3. Add dtoverlay=i2c-rtc,ds3231 on a new line
  4. Save config.txt
  5. (If using SSH to configure the Pi):
    1. Create empty file in micro-SD boot folder called ssh (no file extension)
    2. Eject micro-SD card from your computer and insert into Raspberry Pi
    3. Attach Pi to an Ethernet cable on your network
    4. Attach Pi to a USB power source
    5. Wait for the Raspberry Pi to boot up
    6. SSH to pi@raspberrypi.local (default password is raspberry)
  6. (If using monitor, keyboard, and mouse to configure the Pi)
    1. Eject micro-SD card from your computer and insert into Raspberry Pi
    2. Attach Pi to monitor, keyboard, mouse, and Ethernet cable
    3. Attach Pi to a USB power source
    4. Wait for the Raspberry Pi to boot up
    5. Open a command line terminal
  7. Enter sudo hwclock -r which should display the date and time (example below):
    Fri 12 May 2017 20:28:09 UTC -0.737856 seconds
  8. Enter sudo apt-get update
  9. Enter sudo apt-get upgrade (will take several minutes to complete)
  10. Enter sudo apt-get install lm-sensors
  11. Enter sensors which should display the ChronoPi temperature sensor reading (example below):
    ds3231-i2c-1-68
    Adapter: bcm2835 I2C adapter
    temp1: +27.5°C
  12. Enter sudo nano /lib/udev/hwclock-set
  13. Find the following lines near the beginning of the file:
    if [ -e /run/systemd/system ] ; then
      exit 0
    fi
  14. Comment them out with # to become the following:
    # if [ -e /run/systemd/system ] ; then
    #   exit 0
    # fi
  15. Press CTRL-X and then press Y to save the file
  16. Reboot the Raspberry Pi with sudo shutdown -r now
/home/macetec/public_html/docs/data/attic/chronopi.1500425937.txt.gz · Last modified: 2017/07/18 20:58 by macegr