Arduino DS3231 RTC Clock With LCD





Introduction: Arduino DS3231 RTC Clock With LCD

To familiarize myself with a DS3231 RTC (real time clock), I built a simple arduino based 24 hour clock. It has 3 buttons with the following functions: press any button to enter the time setting mode, increase and decrease the time in minutes with two of the buttons, and set the clock with the third button. You can checkout a video of it working at

Materials Required:

  • An arduino development board (I used an Uno)
  • A standard 16x2 HD44780 based LCD display
  • A DS3231 based RTC (I got mine on Amazon)
  • Three push buttons
  • Three resistors (~10K ohm)
  • A potentiometer (~10K ohm)
  • A breadboard
  • Several jumper wires

Step 1: Wiring

Refer to the drawing for wiring instructions. The buttons are connected to pins A0, A1, and A2. The RTC uses pin A5 for SCL and pin A4 for SDA. The potentiometer varies the contrast on the LCD and the LCD uses digital pins 2 through 7.

Step 2: Programming

Use the arduino IDE to upload my sketch to your arduino.

My code was partly based on the code provided here. And, of course, my code is explained in its comments.

You can download the sketch from this instructable.

Step 3: Continuing on With Your Life

You did it! Unless you didn't- in which case comment below and I'll do my best to help you out. Otherwise, go on ahead and do even greater things!

As a student, I do not always have the finance to fund projects. I love making and sharing things with the world, but sometimes supplies are expensive. There is by no means any pressure, but if you like my work and want to help show appreciation and offset the cost of some of my projects, I have an Amazon Wishlist where you can donate items or gift-cards. You also check out my complete list of ways to help at


2 People Made This Project!


  • Epilog Challenge 9

    Epilog Challenge 9
  • Paper Contest 2018

    Paper Contest 2018
  • Science of Cooking

    Science of Cooking

We have a be nice policy.
Please be positive and constructive.




I have all the wiring and coding right, and the LCD lights up and the potentiometer works perfectly. The problem is that the time doesn't show up on the LCD screen, and it only shows a blank screen with squares. Suggestions?

If your LiquidCrystal library isn't working, this would explain the LCD not displaying anything, getting the library loaded in your IDE and in your sketch should solve this.

Also I can't seem to upload the BasicClock.ino to my library and sketch. It says library not found. Maybe there is an updated version or I can use a different ds3231 library for it?

On my installation of the Arduino IDE the Wire and LiquidCrystal libraries were both included. Check out for help checking if you have these, and if not you should be able to use the library manager to install them. Thanks!

good day, can i use this as a stopwatch with lap times?

Hey, this project was designed to be a clock rather than a stopwatch. However, you could use a similar hardware design and make use of the RTC to keep good time and print the output to the LCD.


thank you for your reply,
however i'm new to this and trying to learn arduno, can guide me,
thank you

This doesn't include a rtc, but an rtc is not as important in a stopwatch application anyway.

It is a simple stopwatch, and if you want to incorporate an rtc simply connect it to I2C like I did and use the setRTCTime() and readRTCTime() methods to access the time from the rtc. From there, you should be able to use arithmetic to calculate the passing of time.

Best of luck!

thank you so much for your help

thank you very much for your help