Arduino Projects    |   Raspberry Pi  |     Electronic Circuits   |    AVR    |    PIC    |    8051    |    Electronic Projects

Up down counter using 8051 microcontroller (AT89C51)


Developed By: 
Himanshu Choudhary

This article shows an easy to build up down counter. The counter is based around the 8051 microcontroller (AT89C51). Two switches are provided, one for increment and second for decrement. The switches can also be replaced by sensors to increment or decrement.

Up Down Counter Project using 8051 Microcontroller with circuit & C code



In this circuit, four seven segment display are used to show the value of count. The maximum value of count is 9999. The circuit uses the concept of multiplexing of seven segment to display the value of count. For more details on seven segment multiplexing, refer article titled “Seven segment multiplexing”.

In this circuit data output for the seven segment is given on the port P2 of the microcontroller AT89C51. The control signals for enabling the seven segment displays are given on pin no. 1,2,3,4 of microcontroller. The input of switches is taken on pin number P3.5 and P3.6. Switch connected on pin P3.5 is the increment switch and that at pin P3.6 is the decrement switch. The seven segment used here are common anode.
Whenever the increment switch is pressed the counter increments by one and when the decrement switch is pressed it gets reduced by one. The inputs of the microcontroller are made positive edge triggered by using a capacitor and resistor as shown in the circuit diagram.  This helps in removing the problem of counting more than one on a single press of a switch. The value of the counter is displayed using the concept of seven segment multiplexing.

Circuit Diagram



This Code is only visible to Registered users. Please Login/Register


This Code is only visible to Registered users. Please Login/Register


BC547 | Transistor BC547  | PDF Datasheet
Transistor BC547
BC547 is an NPN bi-polar junction transistor. A transistor, stands for transfer of resistance, is commonly used to amplify current. A small current at its base controls a larger current...
7 Segment Display | Seven Segment LED Display
Seven Segment Display
A seven segment display is the most basic electronic display device that can display digits from 0-9. They find wide application in devices that display numeric information like digital clocks, radio, microwave ovens...
AT89C51 Microcontroller, Atmel 89C51 Controller Image
AT89C51 Microcontroller

AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C51 has 4KB of Flash programmable and erasable read only memory (...

You are here