Real Time Clock Rpi
add a real time clock to the raspberry pi

Raspberry Pi B and B+ with the RTC 3231

Product Link: from Seeduino


Connect the module to the inner pins at 3.3 V

apt-get update && apt-get dist-upgrade


apt-get install i2c-tools libi2c-dev ntpdate

sudo i2cdetect -y 1 (1 for b and b+ 0 for a)

sudo vim /etc/modprobe.d/raspi-blacklist.conf

blacklist spi-bcm2708
#blacklist i2c-bcm2708

sudo vim /etc/modules


modprobe rtc-ds1307

sudo vim /etc/rc.local

#for B and B+
echo ds3231 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
/sbin/hwclock -s

optional remove fake HW clock:

  • sudo update-rc.d -f fake-hwclock remove

  • sudo update-rc.d -f ntp remove

sudo reboot

get time from a time server and write it to the real time clock

  • sudo ntpdate

  • sudo hwclock -w

check the time on the module with: sudo hwclock -r

Posted on:

December 28, 2014
127 words

Contact Me:

If you are interested in contacting me feel free to do so by mail or online:

nob {at}