In today’s world showing numbers and letters on multiple LED displays is pretty simple, thanks to microcontrollers like Arduino or Raspberry Pi.
With just a small piece of code we can easily display the digits we need. But as electronics students or hobbyists there are times when we need to show multiple numbers or digits in a project or digital logic circuit. So how do we achieve that?
7-segment displays provide a practical solution for displaying numerical info from 0 to 9. These displays are made up of several light-emitting diodes (LEDs) arranged in one unit.
Each LED or “segment” is powered by an electrical current. By turning different segments on and off, we can create different combinations to display numbers or characters.
As we learned in our tutorial about light-emitting diodes LEDs work like regular diodes in that they only allow current to flow in one direction. The main difference is that LEDs emit light when electrical current flows through them at their PN junction.
This light emission called electroluminescence occurs when the anode (A) terminal of the LED is about 2 volts more positive than the cathode (K) terminal. The current needed to light up an LED typically ranges from 6mA to 20mA, and this current is usually regulated by a series resistor.
By forward-biasing any of the LED segments in a display where the anode is connected to the supply (positive) and the cathode to ground (negative) we can light up specific segments to show a digit between 0 and 9 providing a visual output for our project.
Understanding 7-Segment Display
A 7-segment display as the name suggests, is made up of seven individual segments, each consisting of a light-emitting diode (LED). These segments work together to form a single digit on the display.
Interestingly most 7-segment displays also include an eighth LED which is used for displaying a decimal point, typically located in one of the lower corners of the display.
Now if we think about it a 7-segment display has seven LEDs (excluding the decimal point) and each LED has two terminals, an Anode and a Cathode. So it might seem like a 7-segment display would have 14 pins in total. However thats not quite the case.
Even though each LED can be lit up independently, one terminal of each LED is actually connected to a shared point.
So instead of the expected 14 pins a standard 7-segment display only has eight pins, seven for the individual LEDs and one for the common connection. This common pin is important because it determines the type of display.
When all the cathode terminals of the LEDs are connected then display is called a Common-cathode (CC) display.
On the other hand when the anode terminals are connected together then it is a Common-anode (CA) display. So in short a 7-segment display can be either Common Cathode (CC) or Common Anode (CA).
Common Cathode (CC) Display
So in a common cathode display setup, we connect all the cathode (K) connections from the LED segments together and link them to the ground or a zero-volt reference point.
To light up the individual segments we need to apply the right electric current that forward biases the anode terminals (labeled a through g). This means we need a driving circuit that can provide current for the common cathode display.
Common Anode (CA) Display
Conversely, in a common anode display, we connect all the anode (A) connections of the LED segments to a positive voltage supply.
Here, to illuminate the specific segments we apply a ground or “LOW” signal to the cathode terminal of each segment (from a to g). So for a common anode display we require a driving circuit that can sink current.
Connecting 7-Segment LED Displays
When it comes to connecting multiple 7-segment LED displays to an electronic circuit, we find plenty of methods to use, each with its own perks.
Since each segment usually needs about 6 to 20 milli-amperes (mA) of current for normal brightness and considering there are seven segments plus an extra decimal point, it is pretty standard for us to use dedicated decoder/driver chips to drive each display directly.
Integrated circuit (IC) decoder chips are designed to convert one type of input data into another.
We have various digital decoders available that cater to specific input types like binary, BCD, or hexadecimal and produce the desired output code that represents the number of decoded output lines. For example we might come across configurations like 3-to-8 lines or 4-to-16 lines.
So in our particular situation, we really need the decoder chip that can take the specific binary code and turn it into the array of output signals.
These signals are super important for making the 7-segment display work. One great option for this is the “BCD-to-seven-segment decoder.”
Now when we say the Binary Coded Decimal or BCD for short, we’re talking about the system that uses 4-bit binary digits to represent the ten decimal digits from 0 to 9. Below we’re sharing a selection of the integrated circuit (IC) decoder chips that are really good at doing this job.
Among these options, the TTL 74LS47 is definitely the most popular 7-segment decoder IC out there. It’s well-known for driving the common anode (CA) displays.
This chip has a 4-bit BCD input and seven active “LOW” outputs, each one meant for lighting up one of the seven LED segments.
Now when we say “Active LOW” it means that the output pin goes to ground (0V) to turn on an LED segment while a “HIGH” output will switch the LED segment “OFF.”
The HDSP series of displays is actually a fantastic starting choice but honestly any standard common anode display would work just fine since there are so many options available.
We can use four switches to feed a 4-bit binary number into the BCD inputs labeled A, B, C, and D of the 74LS47 decoder.
This setup generates the output signals a, b, c, d, e, f, and g that we use to drive the 7-segment display. This way we can show the numbers from 0 to 9 just like we want, as indicated below:
Analyzing the 74LS47 Decoder Circuit
So the relationship we establish between the 74LS47 decoder/driver and the common anode display means that we need to use seven resistors, eight if we include the decimal point, to properly regulate the flow of current.
For each LED segment of the display to light up correctly, it’s really important that we manage the current passing through the each segment carefully.
The best way for us to limit the current flowing through the each segment of the display is to put a current-limiting resistor in series with each of the seven LED segments, just like shown in the diagram.
If we forget to use the resistor in series then too much current could surge through the LED, making it super bright for a moment but ultimately causing irreversible damage to the LED.
Since each LED segment in a standard 7-segment LED display is designed to work best within the current range of 6 to 20mA, which is about a 1.8-volt drop across the diode junction of the LED for normal brightness, so we can figure out the right value for the current-limiting resistor that we need to keep the current at the right level for each LED segment.
I hope that by now in our tutorials you have got a solid grasp that a 7-segment display is really just a bunch of individual light-emitting diodes (LEDs) all packed into one rectangular casing.
We need to remember that these LEDs require a series resistor which plays a crucial role in limiting the direct current (DC) flow for each segment.
When we are dealing with a common-anode display setup, the anodes of each the LED segment are all connected together and hooked up to the 5-volt power supply which we call the (VS).
So when we turn on the LEDs, and if we think about the forward voltage drop across the LED junction to be around 1.8 volts then we can figure out the voltage across the series resistor like this: VS – VLED = 5 – 1.8 = 3.2 volts.
If you want to calculate the value for the series current-limiting resistor for one segment, we just need to use the Ohm’s Law. But we must also keep in mind that the current flow needed to light up the segment is optimal and sufficient.
This way we can determine the range of resistance values that will keep the current flowing through the LED between 6mA and 20mA, depending on the specific application and how bright we want the LED to be.
Formula to Calculate the 7-segment Display Resistor Values
R(6mA) = (Vs – Vled) / Iled = (5 – 1.8) / 0.006 = 533 ohms
R(20mA) = (Vs – Vled) / Iled = (5 – 1.8) / 0.02 = 160 ohms
So at the current level of 6mA, we need to add the series current-limiting resistor that’s about 533Ω. We can round that to the nearest standard value, which is 560Ω.
If we want to keep the current at a max of 20mA, we’ll need the 160Ω resistor. In the real-life situations we can use any standard resistor value between 220Ω and 360Ω to power the 7-segment display with the 5-volt supply; the exact resistor we choose will depend on what we have available.
Even though we are talking about the common anode LED display here, the calculations and resistor values work just as well for the common cathode displays.
Plus there are the dual-in-line package (DIP) resistor networks out there that come with all seven (or eight) resistors in one package, making it super easy to wire everything up between the driver IC and the display.
Also just so we’re clear, we’re using the TTL 74LS47 BCD to 7-segment decoder/driver IC in this setup. It has the active LOW (current sink) outputs that are perfect for driving a common anode display.
On the flip side, if we’re working with the common cathode displays, we would use the TTL 74LS48 BCD to 7-segment decoder/driver IC instead since it gives us the active HIGH (current source) outputs.
So depending on whether we have the common anode or the common cathode 7-segment LED display, we might go for the 74LS47 IC for something like the LT542 CA display or the 74LS48 IC for its counterpart, the LT543 CC display. The choice is totally up to us!
How to Display Numbers on the Seven-Segment Display
So when we want to show the numbers on the seven-segment display, we use the 74LS47 integrated circuit. This chip has the four inputs for the Binary-Coded Decimal (BCD) representation of the digits which we label as A, B, C, and D.
It also has the outputs that connect to each segment of the display.
To make this work, we use the four switches—SA, SB, SC, and SD—to create the input sequence needed to light up the right LED segments for displaying the numbers.
For everything to function properly, we need to connect the LT (Lamp Test), BI/RBO (Blanking Input/Ripple Blanking Output) and RBI (Ripple Blanking Input) pins of the 74LS47 to a +5V power supply.
This ensures they stay in the HIGH state. As a result, we might see the following numbers displayed:
Numbers or Figures Generated by the 7-segment Display Module
So when we operate the four SPST switches, we do get to see the corresponding numbers or random characters on the display. But managing all the four switches at once can be a bit of a hassle.
That is why it makes way more sense for us to use the single integrated circuit chip that can generate the needed four-line binary info without needing all those individual switches. Luckily we have the great solution in the 74LS90 BCD Counter.
This chip the 74LS90, can be easily set up to work as the MOD-10 decade counter which means it divides by ten and gives us the Binary-Coded Decimal (BCD) output. It counts from 0000 to 1001 and then resets back to 0000.
By using this asynchronous decade counter/divider IC, we can simply increment the digits on the 7-segment display with just the one switch!
Understanding the Single Digit 7-segment Display Counter
Now we have the ability to increment the numbers displayed from 0 to 9, just by pressing the single pushbutton switch which we call SW1, up to ten times.
By tweaking the setup of the pushbutton and the 1kΩ resistor, we can make the counting happen either when we press the button or when we let go of it.
Our simple circuit shows how we can build the digital counter that counts from 0 to 9 using the 74LS90 BCD Counter along with the 74LS47 7-segment display driver.
But this basic single-digit counter can be taken up a notch! By adding another counter stage, we can turn it into the two-digit counter that counts from 00 to 99.
Understanding the Two Digit 7-segment Display Counter Circuit
Understanding the Two-Digit 7-Segment Display Counter
So here is how the two-digit 7-segment display counter works. The first part of the digital counter circuit operates similarly to what we have seen before, but there is a key difference. When we press the pushbutton SW1, it increments the LED display for the “one’s” place which we often call the “units” display.
In this setup our first 74LS90 BCD counter U1, counts from 0 to 9 in binary (that is 0000 to 1001). Each time we press SW1, it increases the count when the switch closes (that is the trailing edge).
A cool thing to note is that when we hit “8” (binary 1000) on the one’s display, output pin-11 of U1 (which is the output “D”) goes HIGH and stays that way until U1 finishes its cycle and resets back to the zero after counting to ten. At that point, pin-11 goes back to the LOW.
Now since the output pin-11 (BCD pin D) of U1 is connected directly to the clock A (CLKA) input pin-14 of our second 74LS90 BCD counter U3, every time pin-11 switches between the HIGH and LOW, it triggers an increment in the second LED display that shows the ten’s digit.
This means that when we place these two LED displays next to each other, they can count from 00 to 99 and then reset back to the 00 for the next counting cycle.
We have the super simple digital counting circuit that can be used in the ton of school projects. For example instead of using the manual pushbutton switch which is the SW1, we could swap it out for the sensor that counts the things like the people, the cars, or other moving objects.
Another option is to replace SW1 with the 555 timer or an astable oscillator circuit. This would let us count the pulses or even create the basic 2-digit timer or reaction timer circuit and we can choose whether or not to include the decimal point.
Now even though our 2-digit counter circuit works great with the 74LS90 decade (divide-by-ten) counter, there is a little hiccup, we need the two units U1 and U3.
But here is the good news, the TTL 74LS390 and its CMOS buddy, the 74HC390 actually combine the two 74LS90 decade counters into one integrated circuit package. This makes it way cheaper than buying the two separate 74LS90 units.
The TTL 74LS390 is a 4-bit decade counter that has the two internal counters that can divide by two and five. We can set it up to divide by multiples of “2, 5, or 10” and it gives us a BCD output just like the individual 74LS90.
So we can easily replace those two 74LS90 integrated circuits U1 and U3, with just one 74LS390 chip. Each half of the IC will drive one of the LED displays as shown in our diagram.
Designing the Improved Two Digit Counter Circuit
We are looking at the simple digital counter that counts from 00 to 99. It uses the 74LS390 BCD Counter along with the two 74LS47 drivers for the 7-segment displays.
If we want to count beyond 99, we will need to hook up some extra counter circuits in the cascading setup.
For the bigger counting range, we can use the 4-digit BCD counter, which lets us count from 0000 up to 9999 and then loops back to the 0000.
If our goal is to count all the way from 0 to 999999, then we will need to implement the three cascaded decade counters.
Basically it is totally doable for us to build multiple decade counters by cascading the individual BCD counter circuits, with each one handling a specific decade, just like what is shown in the schematic.
How can we Connect Counters as Cascaded form
In this tutorial we have deeply explored the 7-segment Display Counters. We found out that we can actually build the LED display decoder circuits using the standard combinational logic circuit integrated circuits (ICs). Also we discovered a ton of the dedicated integrated circuits out there that are specifically made for this purpose.
When it comes to the display decoder ICs, the 74LS47 Seven-segment decoder/driver IC looks very impressive because it can drive a common anode (CA) display.
However we also find that the 74LS48 Seven-segment decoder/driver IC is designed for the common cathode (CC) displays.
Both of these components, along with their CMOS versions are easy to find for various applications.
We also learned that the 74LS90 asynchronous counter IC can be set up to work as a MOD-10 decade counter.
This means that, it divides by ten to give us a Binary-Coded Decimal (BCD) output code.
It counts from 0000 to 1001 and then resets back to 0000, starting the counting cycle all over again.
What is really nice about the 74LS90 BCD Counter is that it is extremely versatile. It can not only act as a counting circuit but also as a frequency divider, handling any whole number count from 0 to 9 for a single display.
If we want to create a 2-digit counter, we can cascade two 74LS90 counters together. But an even better option is to use the dual decade/driver IC 74LS390.
References:
Up-Down-Counter—7-segment-display
Logic in displaying numbers in 7 segment 4 digit display
Leave a Reply