Author Topic: Adding a DS3231 Real Time Clock to the Pi  (Read 5099 times)

0 Members and 1 Guest are viewing this topic.

norman

  • Administrator
  • Sr. Member
  • *****
  • Posts: 268
    • View Profile
    • Zipzap Computers Limited
Adding a DS3231 Real Time Clock to the Pi
« on: September 11, 2017, 09:18:19 am »
The Pi does not have a RTC as standard but they cost less than 5 pounds. Fitting and setup is easy but it would have been even easier if it came with instructions!

Add the i2c interface in RASPI-CONFIG

Add the following line in /boot/config.txt using Nano -

dtoverlay=i2c-rtc,ds3231

So sudo nano /boot/config.txt

CTRL O then CTRL X to finish.

Then -

sudo nano /lib/udev/hwclock-set

Alter -

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

to

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

Power down. Fit the RTC. A diagram of where to fit it would have been nice. https://www.zipzap.co.uk/images/rtc.jpg

Restart.

Test with -

sudo hwclock -r

Norman
;)
PS Another one to remind me!
« Last Edit: February 08, 2023, 08:39:22 pm by norman »