RTC DS1307 Wiring
VCC To 5 Volts
GND To PIN 6
SDA To PIN 3
SCL To PIN 5
sudo apt update
sudo apt upgrade
sudo raspi-config "To Enable i2c And Set Local Time Zone"
sudo reboot
Install The Following Software:
sudo apt-get install python-smbus i2c-tools
Run The Following Command:
sudo i2cdetect -y 1 "You Should See The Number 68"
sudo nano /boot/config.txt "Add The Following To The Bottom Of File And Save
dtoverlay=i2c-rtc,ds1307
sudo i2cdetect -y 1 "Make Sure You See UU"
Do The Following Commands To Remove The hwclock:
sudo apt-get -y remove fake-hwclock
sudo update-rc.d -f fake-hwclock remove
Do The Following Command To make Changes To File:
sudo nano /lib/udev/hwclock-set "Add The Three #'s To Make The File Like This"
#if [ -e /run/systemd/system ] ; then
# exit 0
#fi
To Read The Time From The RTC:
sudo hwclock -D -r
Before We Set The Time From The Pi To The RTC We Need TO Make Sure The Time Is Right On The Pi. Run The Following command To Do So
date
If The Time Is Right, Do The Following Command:
sudo hwclock -w
Run sudo hwclock -s "To Set Time To RTC"