7-Segment Display Counter

Nowadays, it is very easy to display numbers and letters on multiple LED screens using microcontrollers such as Arduino or Raspberry-Pi and a small software-related code to display the required figures. However, sometimes we want to display two or more numbers or numbers as part of our project or digital logic circuit. So how can we do this without a microprocessor?

7-segment displays provide an appropriate way to display numerical information from zero to nine, as they consist mainly of a series of light-emitting diodes connected to each other within a single indicator package. Each light-emitting diode (called a segment) is illuminated using an electric current and illuminates various segment combinations, with some segments held as "ON" and light emitting, while others are held to be "OFF".

As we see in our tutorial on Light Emitting Diode, LEDs are like normal diodes, allowing the current to flow in only one direction. This difference between the two is that when an electric current passes through an LED, it emits light energy from the PN-connection. This electroluminescence action occurs when the ANOT (A) terminal of the LED is about 2 volts more positive than the Cathode (K) terminal. The typical feed current required to illuminate an LED connection is approximately 6mA to 20mA and is controlled using a current limiting resistance, the value of which is usually serial with the LED.

Therefore, by connecting any of the display LED segments forward so that the anode terminal is facing the source (positive) and the cathode terminal facing the soil (negative), we can produce a series of randomly lit segments or a dex dexer number from 0.

What is a Seven Segment Display?

7 segment screen counter

As the name suggests, a 7-segment screen consists of seven segments, that is, seven light-emitting diodes or LEDs, and together they can be used to create a complete number on the screen.

In fact, most 7-segment screens contain eight internal LEDs, since the eighth is usually used for decimal point in one of the lower corners of the screen.

An LED segment can be illuminated individually as needed, while a terminal of each internal LED connects to a common point or node. Thus, instead of having 14 connection pins for the screen, we only have eight (7 + 1) pins.

If the cathode terminals of all LEDs used on the display are connected to each other, the display is called the Common Cathode (CC) screen. Likewise, if all the anode terminals of the LEDs used on the screen are connected together, the display is called the Common Anode (CA) screen. Therefore, a 7-segment display can be a Common Cathode (CC) or Common Anod (CA) type display.

Common Cathode (CC) Configuration

7 segment screen counter

Common Cathode (CC) Display – All cathode (K) connections of LED segments are connected to each other and connected to soil or zero volts. Separate segments are illuminated by the application of a suitable electric current to transmit separate Anode terminals (a to g). Therefore, the common cathode representation requires a driving circuit that can provide current.

Common Cathode (CC) Configuration

7 segment screen counter

Common Anode (CA) Display – All anode (A) connections of led segments are combined into a positive voltage source. Individual segments are illuminated by applying a grounding or "LOW" signal to the Cathode terminal of the specific segment (a to g). Therefore, a common anode representation requires a circuit that absorbs a current.

There are many different ways to connect multiple 7-segment LED displays to an electronic circuit, and each has its own advantages. Special decoder/drive chips are usually used to drive each screen directly, since each segment requires approximately 6 to 20 milli-amp (mA) currents to illuminate at normal brightness, and there are seven segments (plus one decimal point). .

Integrated decoder chips basically convert one type of input data to another type, and different types of digital decoders are available, depending on the type of input data (such as binary, BCD, or hexadecimal) and the required output code that represents the number of decoded data. output lines For example: 3 to 8 lines, 4 to 16 lines, etc.

In our case, we need a decoder integration that can convert some binary code into a series of output signals to run a 7-segment screen, such as "BCD to seven segments decoder". Binary Decimal, or BCD for short, is a set of 4-bit binary digits that can do just that with the following list of integrated decoder chips, used to represent 10 decimal places from 0 to 9.

TTL Decoder Integrateds
74LS47 Common Anode
74LS48 Common Cathode
74LS247 Common Anode


CMOS Decoder
Integrateds 74HC4511 Common Cathode
CD4513 Common Cathode

The TTL 74LS47 is by far the most popular 7-segment decoder integrated and can run common anode (CA) displays. The TTL 74LS47 has a 4-bit BCD input and seven separate active "LOW" outputs to drive each of the seven LED segments. Active "LOW" means that the output pin passes into the ground (0V) to illuminate an LED segment, while a "HIGH" output will make the LED segment "OFF". HDSP series displays are a good starting point, but any standard common anode display will do the trick.

With the help of four switches, a 4-bit binary number is applied to the A, B, C, and D BCD inputs of the 74LS47 decoder to produce the used output signals a, b, c, d, e, f, and g.

7 segment screen counter

The connection between the 74LS47 decoder/drive and the common anode display requires seven resistors (eight, including decimal points) to limit current flow. In order for each LED segment of the display to burn properly, the current passing through each segment must be carefully controlled. The best way to limit the current through a display segment is to use a current limiting resistance in series with each of the seven LED segments, as shown. If we do not use a serially connected resistance, the maximum current will flow and the LED will be very bright for a short time before it is permanently destroyed.

Each LED segment of a typical 7-segment LED display is rated to run from 6 to 20mA, delivering a voltage drop of about 1.8 volts along the LED's diode connection for normal brightness. We can calculate the value of the current limiting resistance required to produce the required current per LED segment.

7 segment screen counter

I hope that so far we have learned and understood that a 7-segment display is basically a group of separate LEDs in a single rectangular package, and that LEDs require a series of resistance to limit DC currents per segment.

For a common anode display, the anode of each LED segment is connected to a 5 volt source (VS). If the forward voltage drop along the connection of the LED when lit is approximately 1.8 volts, the voltage on the serial resistance should also be equal: VS – VLED = 5 – 1.8 = 3.2 volts.

Therefore, the resistance value required for the serial current limiting resistance of a single segment is simply found using the Ohm Act in the current flow required to illuminate it. Therefore, we can calculate the range of resistance required to limit the current of the LED from 6mA to 20mA, as follows for the application and LED density we want:

7 segment screen counter

Therefore, a series current limiting resistance of 533Ω at 6mA current or a resistance of 160Ω is required to limit the current to 560Ω and the current to 20mA to the preferred value. In reality, any good standard preferred resistance value between 220Ω and 360Ω can be used to illuminate a 7-segment display from a 5-volt feed, all of which depends on what resistance values you have.

Although we use a common anode LED display as our example here, the same calculations and resistance values apply to common cathode LED displays. Dual-row package (DIP) resistance networks are commonly found with all seven (or eight) resistances in a single DIP package that simplifies the wiring process between drive integrations and the display.

Also, although we used the TTL 74LS47 BCD to drive a common anode display with active LOW (current receiver) outputs of the 7-segment decoder/drive IC, the TTL 74LS48 is the same except that it is designed to drive the common cathode display as it produces fully active HIGH (current source) outputs from BCD to 7-segment decoder/drive IC. Therefore, depending on the type of 7-segment LED display you have, you may need a 74LS47 IC for driving, for example, a LT542 CA screen or a 74LS48 IC to drive the equivalent LT543 CC display. The choice is yours.

Viewing Numbers on a 7 Segment Screen

The 74LS47 has four inputs for steps BCD (8-4-2-1) A, B, C and D, and output for each segment of the seven-segment display. Running the four SA, SB, SC, and SD switches will create the required input sequence to enable the appropriate LED segments responsible for displaying the relevant number. For normal operation, 74LS47's LT (Lamp test), BI/RBO (Blinding Input/Surge Dimming Output) and RBI (Surge Dimming Input) depend on +5V welding (HIGH). Thus, the numbers displayed are as follows:

7 segment screen counter

While the operation of four SPST switches causes corresponding numbers or random characters to appear, running four keys at the same time can be a bit tedious. Therefore, we have an integrated chip that can produce 4 lines of binary information without using four switches: 74LS90 BCD.

The 74LS90 integrated circuit, which can be configured as a MOD-10 ten counter to generate a BCD output code, counts from 0000 to 1001 and then resets itself back to 0000. Using this asynchronous tenth counter/divider, IC can increase the numbers on the 7-segment screen using only one key, as shown.

7 segment screen counter
Single Digit 7-segment Display Counter

Now we can increase the number on the screen from 0 to 9 by pressing only one button switch, SW1 ten times. We can count by changing the position of the push button and 1kΩ resistance, making changes to the activation or release of the SW1 button.

Our simple circuit shows how to use a digital counter from 0 to 9 using a 74LS90 BCD Counter and a 74LS47 7-segment display driver. However, this single-digit 0 to 9 counter can be expanded by adding a second counter stage to make a two-digit 00 to 99 counter.

7 segment screen counter
Single Digit 7-segment Display Counter

So how does this 2-digit 7-segment screen counter work? The first half of the digital meter circuit works in the same way as before, except that the activation of the SW1 button increases the LED display of "one" (also called "units"). The first 74LS90 BCD counter, U1 counts from 0 to 9 (0000 to 1001) each time SW1 closes (the last edge). However, when the order of counting on the person's screen reaches "8" (1000), the pin-11 corresponding to the output "D" of U1 becomes "HIGH" and remains HIGH until U1 resets itself at the 10th count. U1's pin-11 becomes "LOW" again.

Because the output pin-11 (BCD pin D) of U1 is connected to the U3-hour A (CLKA)input pin-14 of the second 74LS90 BCD counter, the second LED indicator of U1's pin-11 (output D) each increases the second LED indicator for the consecutive HIGH/LOW switching action decimal place. Thus, when placed side by side, it causes the two LED screens to count from 00 to 99 before resting again to 00 for the next count.

This very simple numerical counting circuit has many different school project applications. For example, if we can replace the manually operated button switch with a sensor to count SW1 as moving objects, people or cars, etc., or even replace SW1 with a 555 timer or unstable oscillator circuit, for example, it can be used for this.

Although the above 2-digit meter circuit works well with a 74LS90 ten (split ten) counter, the problem is that we need two of them, U1 and U3. The TTL 74LS390 and CMOS equivalent 74HC390 include two 74LS90 ten counters in a single integrated package and are more cost-effective than purchasing two 74LS90s in most cases.

The TTL 74LS390 4-bit tenth counter has an internal split-in-two and five-part counter, which can be configured as dividing into the same "2, 5, or 10" multiples as the BCD output. Thus, we can replace the U1 and U3 of the two 74LS90 integrated in the previous circuit with a single 74LS390 integration, and each half of the integration runs one of the LED screens as shown.

7 segment screen counter

The circuit shows a simple 00 to 99 digital counter that uses a 74LS390 BCD Counter and two 74LS47 7-segment display drives. To count above 99, we need to cascade more counter circuits together. A 4-digit BCD counter is counted as a decimal from 0000 to 9999, and then resets back to 0000. Similarly, if we want to count from 0 to 999999, then a three-stage tenth counter is required. In fact, multi-de tenth counters can be simply created by combining individual BCD counter circuits, one for each ten, as shown.

Cascading Numers

7 segment screen counter

In this tutorial on the 7-segment screen counter, we found that LED display decoder circuits can be created using standard combinational logic circuit integrations, and there are many special integrated circuits on the market to perform this function.

The 74LS90 asynchronous counter integration can be configured as a MOD-10 ten (divide by 10) counter to generate a BCD output code, counts from 0000 to 1001, and then resets itself back to 0000 to restart the loop.

The 74LS90 BCD Counter is a very flexible counting circuit and can be used as a frequency divider or to divide any exact number from 0 to 9 for a single screen. Cascading two 74LS90 counters together allows us to produce a 2-digit counter, but even better, we can produce any combination of counter stages using multiple 7-segment LED displays using dual-ten/drive integrated 74LS390.