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

(Last Updated On: October 19, 2019)

Arduino RTC DS3231

Description:

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: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
RTC DS3231 Real Time clock: https://amzn.to/2LvQi8X
LM7805 Voltage Regulator: https://amzn.to/2IZEl5x
Potentiometer: https://amzn.to/2JSLbfg
330 ohm resistors pack: https://amzn.to/2NtlAeh
5v 2A adaptor: https://amzn.to/2GsNfcw
2n2222 npn transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCkt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / strip board: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wire cutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

DISCLAIMER:

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:

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:

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

Close