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.ComponentQuantity
1Microcontroller (P89V51RD2)1
2LCD display (16×2)1
34×4 keyboard1
4Resistor 10K1
5Capacitor 33pF2
6Capacitor 10uF1
712MHz Crystal1

Circuit diagram

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

[caption id="" align="aligncenter" width="490"]digital clock using 8051 microcontroller and LCD display Digital clock using 8051 microcontroller and LCD display[/caption]

Circuit building

Connect the 4x4 keypad with port 1 of the microcontroller. Connect 16x2 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 numberNameDescription
3VeeContrast Adjustment -2V to -5V
4RSRegister Select
5RW1 -Read, 0-Write
6EEnable Strobe
7D0Data Line
8D1Data Line
9D2Data Line
10D3Data Line
11D4Data Line
12D5Data Line
13D6Data Line
14D7Data Line
15LED+Backlit LED +V Vdd (Optional signal)
16LED-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!