The Arduino LCD Clock

Share on facebook
Share on google
Share on twitter
Share on linkedin
A VPN is an essential component of IT security, whether you’re just starting a business or are already up and running. Most business interactions and transactions happen online and VPN

Lots of projects require a battery backed time and date display or stamp. In this project we took a SainSmart DS1307 RTC Module and connected it to a SainSmart UNO & LCD Shield. We are displaying the date and time on the lcd display.

Normally, on a lcd, if you print 35, then 7, you’ll get 75, as the 7 slides to the left, and leaves the old digit. I’m using a if statement to detect if a number is less than 10, then inserting a 0 first. This maintains the placement. You can insert a space if you prefer.

We used a Real Time Clock library from Adafruit as the base project, and made our modifications to that.

To set the time, pull the battery from the unpowered clock module, reinsert it, and upload the sketch to the Arduino. The clock module will be set to your computers date and time at the time the sketch was compiled / uploaded.

The 4 connections necessary are:

+5vdc to RTC VCC
Gnd to RTC Gnd
SDA to SDA (A4)
SCL to SCL (A5)


You can add a relay, buzzer and alarm code to turn things on and off or notify you.

Steve Spence

Steve Spence

Leave a Reply

1 thought on “The Arduino LCD Clock”

Leave a Comment

Your email address will not be published. Required fields are marked *