ESP32 digital Clock with DS1302 RTC module

ESP32 19-02-26
21 0

Tutorial plan

1- Objective of the project

2- Required Components

3- Circuit Connections of system

4- Micropython program of ESP32 Clock

 

Objective of the project

The objective of this project is to design and build a digital clock using the ESP32 microcontroller, a DS1302 RTC Module, and an LCD I2C display to show the current date and time in real time.

This project aims to:

- learn how to interface the ESP32 with a DS1302 RTC Module to read accurate time and date information

- display the current time (hours, minutes, and seconds) and date on an LCD I2C screen

- understand how real-time clock (RTC) modules maintain time even when the main power is turned off using a backup battery

- practice using the I2C communication protocol to control the LCD display

- develop skills in MicroPython programming for embedded systems

- build a complete and practical embedded system project

At the end of this project, the ESP32 will continuously read the current time from the RTC module and display it clearly on the LCD I2C screen, creating a functional and reliable digital clock.

 

Required Components

1. BBC Micro:bit (Microcontroller)

The ESP32 is the main microcontroller of the project. It controls all connected components and executes the MicroPython program.

2. DS1302 RTC Module

The DS1302 is a Real-Time Clock (RTC) module used to keep track of the current time and date. It can maintain accurate time even when the ESP32 is powered off because it uses a backup battery. It provides information such as year, month, day, hour, minute, and second. The ESP32 reads this data through digital communication pins.

5. LCD Display with I2C Module

The LCD I2C display is used to show the date and time to the user. It uses the I2C communication protocol, which requires only two wires (SDA and SCL), making connections simpler. The display can show text such as the day, date, and current time in real time.

6. Breadboard 

Breadboard

The backup battery powers the RTC module when the ESP32 is turned off. This ensures that the time and date are not lost. Without this battery, the RTC would reset when power is disconnected.

7. Jumper Wires

Jumper wires

Jumper wires are used to connect the ESP32 to the RTC module and the LCD display. They allow electrical signals and power to flow between the components.

 

Circuit Connections of system

 

1- Connection of DS1302 RTC Module to ESP32

DS1302 RTC ESP32 board
CLK GPIO 19
DAT GPIO 18
RST GPIO 5
VCC 5V
GND GND

 

2- Connection of LCD I2C display to ESP32

LCD display ESP32 board
VCC 5V
GND GND
SDA GPIO 21
SCL GPIO 22

 

Micropython program of ESP32 Clock

This program is designed to create a digital clock system using the ESP32, a DS1302 RTC Module, and an LCD I2C Display 20x4. It reads the current date and time from the RTC module and displays them on the LCD screen in real time.

You need to install this libraries :

i2c_lcd et lcd_api for I2C LCD screen

ds1302 for DS1302 RTC module

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by Mohamed Ali Haj Salah - Teacher info