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



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 (...

Browse 4m+ Electronic Products

Pick the right product for your next design project with "Mouser Store". Mouser Electronics brings broadest range of semiconductors and electronic components from over 500 industry leading suppliers. 
Mouser specializes in the rapid introduction of new products and technologies for design engineers and buyers that includes semiconductors, interconnects, passives, and electro-mechanical components. Providing the best possible service with the flexibility of not requiring a minimum order and same-day shipping, Mouser has it all.
When you need the right part right now, think of Mouser
Thank you
Team EG


You are here