Digital Clock using 8051 Microcontroller & LCD display – Mini Project

Hello friends, today we are going to make a simple digital clock using 8051 microcontrollers which you can make as your engineering mini-project. In this mini project, we are using one 8051 families based microcontroller, one 16×2 LCD display and one 4×4 keyboard for settling the time.

Components required

For making a simple digital clock using microcontroller you will require following components:

Sr. no. Component Quantity
1 Microcontroller (P89V51RD2) 1
2 LCD display (16×2) 1
3 4×4 keyboard 1
4 Resistor 10K 1
5 Capacitor 33pF 2
6 Capacitor 10uF 1
7 12MHz Crystal 1

Circuit diagram

A circuit diagram for simple digital clock using 8051 microcontrollers is shown below:

digital clock using 8051 microcontroller and LCD display
Digital clock using 8051 microcontroller and LCD display

Circuit building

Connect the 4×4 keypad with port 1 of the microcontroller. Connect 16×2 LCD display with port 2 of the microcontroller (make sure that all the data pins of LCD display are connected to the microcontroller correctly). The rs (register set) pin of  LCD is connected to pin 3.5 (pin number: 15) and en (enable) pin is connected to pin 3.6 (pin number 16) of the microcontroller. Connect crystal to pin 18 and 19 of the microcontroller. We are using 12MHz frequency Crystal. For reset, circuitry connects a pushbutton to pin 9 of the microcontroller. We can also use a potentiometer to adjust the contrast of LCD.

Pin description of LCD display

lcd pin diagram

Pin number Name Description
1 Vss Ground
2 Vdd +5V
3 Vee Contrast Adjustment -2V to -5V
4 RS Register Select
5 RW 1 -Read, 0-Write
6 E Enable Strobe
7 D0 Data Line
8 D1 Data Line
9 D2 Data Line
10 D3 Data Line
11 D4 Data Line
12 D5 Data Line
13 D6 Data Line
14 D7 Data Line
15 LED+ Backlit LED +V Vdd (Optional signal)
16 LED- Backlit LED +V Vdd (Optional signal)


Click here to download C program and HEX file for this mini project.

You may also like

If you like this article, please share it with your friends and like or facebook page for future updates. Subscribe to our newsletter to get notifications about our updates via email. If you have any queries, feel free to ask in the comments section below. Have a nice day!

4 thoughts on “Digital Clock using 8051 Microcontroller & LCD display – Mini Project”

Leave a Reply

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