How to use an RTC (Real Time Clock) on Touchberry B3 Pi

How to use an RTC (Real Time Clock) on Touchberry B3 Pi

In this post it is showed hot to configure the Touchberry B3 Pi to add an RTC (Real Timer Clock). The requirement for this post is to have a Touchberry B3 Pi  and a RTC.

How to connect them? Normally, RTC use an I2C connection. So, on the top of the Raspberry PinOut there is the I2C connection:

 

The RTC that was used to do this post use the last ten pinout pins (on picture: left area). 

Once RTC is connected with the Raspberry, the next step is configuring the Rapsberry. First, the config.txt Linux file has to be modified.

Type on your Raspberry Terminal to open it:

cd /boot
sudo leafpad config.txt 

Then, on config.txt must be uncommented the line #dtparam=i2c_arm=on (without the #) to enable the I2C connection and must be added the next line:

dtoverlay=i2c-rtc,ds1307 

“ds1307” this is the RTC used on this example. There are many on the marked just use the name of your RTC (if there is identified for the Linux).

After that the Raspberry must be rebooted.

When the Raspbery is running again type the next command lines to set the date on your Raspberry:

sudo date -s 20170623120000

This command line corresponds to set the next date: 23/06/2017 12:00:00

After to set up the date on your RTC type on terminal:

sudo hwclock -w

This is all that you must do to configure the RTC on your Rapsberry pi. To be sure that your sets up succeed type:

hwclock -r

The Terminal shall show you the configured date.

 

See also:

HOW TO CREATE USD LINUX TO TOUCHBERRY PI3 AND HUMMTOUCH,

SIMPLECOMM LIBRARY TO SEND DATA THROUGH ANY ARDUINO STREAM,

CREATE A NEW TOUCHBERRY PI B3 SD CARD,

PLC- HUMMTOUCH RS485/RS232

 

 

 

 

 

 

 

 

 

Comments are closed.