You Are Here: Home » AVR ATmega Projects » Calculator Projects » 2 Digit Up/Down Counter Circuit

# 2 Digit Up/Down Counter Circuit

Generally, one can see the digital displays which display the score when buttons are pressed on score boards. The main heart of this score board is 2 digits up/down counter circuit. The 2 digits are displayed on two 7 segment displays. This article describes 2 digit up/down counter circuit.

#### 2 Digit Up/Down Counter Circuit Principle:

The main principle of this circuit is to increment the values on seven segment displays by pressing the button. When button 1 is pressed value on the display is incremented by one value and when other button is pressed value on the display is decremented by one value. The value on the display can be incremented and decremented from 0-99 as it uses only 2 displays. If one wants to display 3 digits, three displays should be used .There are many circuits available for 2 digit up/down counter but using a microcontroller reduces components and space on the board but simple programming is required.

Circuit Components:

• ATMEGA8 Microcontroller
• Seven segment displays(common cathode) – 2
• Resistors – 18 (R1 to R18)

#### Circuit Design of 2 Digit 7-Segment  Up/Down Counter:

The 2digit Up/Down counter consists of two seven segment displays connected to ATMEGA8 microcontroller. The seven segment display consists of 8 pins and one common pin.

There are mainly two types of seven segment displays 1) common cathode 2) common anode. The display here used is common cathode display. Generally for common cathode displays, common pin should be grounded and for common anode, it should be connected to VCC. In, Seven segment display, there are seven segments and they are similar to seven LEDs. Seven pins belong to these seven segments where as the last pin is dot at the coner of the display. For common cathode, display assigning logic1 to the segment pin glows particular segment. In case of common anode, the segment pin should be assigned logic0 in order to glow the segment. Each segment is given one name starting from ‘a ‘and last segment dot is ‘h’.

In our circuit, seven segment display is connected to micro controller through a current limiting resistor of 330 ohms. Two buttons in pull- down mode are also connected.

The necessity of connecting the buttons in pull down mode is to avoid floating state of the button i.e. unknown state. If the button is connected in pull down mode, this ensures that button is initially in logic0 state.

Do you know How a Bidirectional Visitor Counter Circuit Works using 8051 Microcontroller?

#### How to Operate 2 Digit Up/Down Counter Circuit?

1. Initially, power the circuit.
2. The values displaying on seven segments is ‘00’.
3. Press the button 1 in the circuit. The value on the seven segments is incremented to ‘01’.
4. Again press button 1. Value on the displays is ’02’.
5. Now, press the second button. You can see the value decrementing to 01.
6. The value on the displays can be incremented up to 99, after 99 if button 1 is pressed it starts incrementing from ‘01’. If  the  second button is pressed after decrementing to ‘00’, it displays ‘00’. This value can be changed only after incrementing the value  atleast to ‘01’.

For more detail:  2 Digit Up/Down Counter Circuit