Arduino RTC DS3231 Time and Date display on a 16×2 LCD

(Last Updated On: June 26, 2020)

Arduino RTC DS3231


Arduino RTC DS3231 Time and Date display on a 16×2 LCD- In this tutorial, you will learn how to make a real-time clock using Arduino, RTC DS3231 module and a 16×2 LCD. This is my first tutorial on the RTC DS3231 real-time clock and in this tutorial, I will explain the extreme basics.

Arduino RTC DS3231

While in my upcoming tutorial I will use the same DS3231 module in the Battery efficiency monitoring system.

Arduino RTC DS3231

In this project, the battery voltage is stored in the Arduino along with the date and time information. The information which is stored in the Arduino can be requested through Bluetooth using the cell phone application. The data which is received from the Arduino is stored in the database for the post-analysis.

In this tutorial, we will cover.

  1. RTC DS3231module Pinout
  2. Complete circuit diagram explanation
  3. Programming and finally number
  4. Testing

Let’s get started!!!!

For the Step by Step Explanation watch Video Tutorial given at the end of this article.

The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno:
Mega 2560:
RTC DS3231 Real Timeclock:
16×2 LCD:

Other Tools and Components:

Super Starter kit for Beginners

Two Channel / 200 MHz Digital Oscilloscope

Variable Supply:

Digital Multimeter:

Soldering iron kit: “best”

PCB small portable drill machine:


Please Note: these are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

RTC DS3231 Real Time Clock:

Arduino RTC DS3231

This is the RTC DS3231 module. The RTC stands for Real-Time Clock. You might be thinking why we need the RTC DS3231 module when the Arduino itself has the built-in timekeeper. Arduino is really powerful and we can make a real-time clock, but the problem comes in when the Arduino is turned off, or the power is disconnected, the time and date information is completely lost.

Arduino RTC DS3231

But if you look at the RTC DS3231 module it has a battery and can keep track of the Time and Date information even if the main power supply is disconnected or we reprogram the microcontroller.

RTC DS3231 Features:

The RTC DS3231is a low-cost, highly accurate Real Time Clock, which can maintain hours, minutes, and seconds. This module can also maintain the day, month, and year information. The RTC DS3231 module also has automatic compensation for leap years and for months with fewer than 31 days.

This Module can be powered up using 3.3 volts or 5 volts.

As you can see clearly in the picture above, the DS3231 module has a total of 6 male headers and are clearly labeled. Out of these 6 Pins, we will be using only 4 Pins which are the SCL, SDA, VCC, and GND.

16X2 LCD:

Arduino RTC DS3231

This is the 16×2 LCD, as you can see I have already soldered some jumper wires. I have a very detailed getting started tutorial on the 16×2 LCD, which covers the extreme basics like for examples, Soldering, interfacing, and basic programming.


Arduino RTC DS3231 Circuit Diagram:

Arduino RTC DS3231

This is the complete circuit diagram explaining how a 16×2 LCD and RTC DS3231 module is connected with the Arduino. This schematic is designed in Cadsoft eagle 9.1.0 version. If you want to learn how to make a schematic and PCB, then watch the following tutorial.

As you can see the ground of the Arduino is connected with pin number 1, 5 and pin number 16 of the LCD…5v from the Arduino is connected with pin number 2 and pin number 15…the middle pin of the variable resistor or potentiometer is connected with pin number 3 of the LCD…while the other two pins are connected with the ground and 5v. Pin’s 4 to 7 of the Arduino are connected with pins D7 to D4 of the LCD.

Pin number 8 of the Arduino is connected with the Enable pin of the LCD.

Pin number 9 of the Arduino is connected with the Rs pin of the LCD, while the R/W pin of the LCD is connected with the Ground.

The Vcc pin of the RTC DS3231 module is connected with the 3.3 volts pin of the Arduino, while the Ground of the DS3231 module is connected with the Arduino’s Ground. The SDA and SCL pins of the RTC DS3231 Real Time Clock module are connected with the Analog pins A4 and A5 of the Arduino. The RTC DS3231 module uses the SPI Protocol.

Interfacing DS3231 and 16×2 LCD with Arduino:

Arduino RTC DS3231

RTC DS3231 module and 16×2 LCD Interfacing with the Arduino is as per the circuit diagram already explained.

Arduino RTC DS3231 Programming:

Before, you start the programming, first of all, make sure that you download all the necessary libraries.

Download Wire library: Wire

Download RTClib library:RTClib

For the Program Explanation and practical demonstration watch the following video. Don’t forget to Subscribe. Support my YouTube channel by liking and sharing this video.

Watch Video Tutorial:



Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply