You are on page 1of 13

Interfacin

g to
7-
Segment
Numeric
Displays

7-Segment Numeric LED Displays

In industrial PLC applications, one of the old, but simpler methods of displaying numeric information is
to use one or more 7-Segment numeric displays connected to an output card of a PLC... Although it is
possible to build such a display yourself, it is far more common to employ a pre-manufactured product
such as the 4-digit panel mount unit shown at the top of this page...

To correctly interface a PLC to such a display, it helps to first understand what basic electronic
components are typically employed in their makeup, and how this effects our task of interfacing to,
and programming such a unit... Although both LED and LCD numeric displays are readily available,
and interfaced similarly, we'll concentrate on the more common LED units in the examples to follow...
BCD to 7-Segment Decoder c/w 4-bit Latch

Once 7-Segment LED displays became readily available, a simple IC known as a "BCD to 7-Segment
decoder" was quickly developed to simplify their use... Binary formatted data presented to this IC's
inputs results in the IC's outputs being placed into the correct state to display the equivalent numeral
(0 to 9) on a 7-Segment display...

Although BCD to 7-Segment decoder ICs are available without built in latches, this particular IC
includes a built in 4-bit latch which we will make use of in later examples... For now the latch is set to
simply allow input data to freely pass through to the decoder...
In the above diagram, the 4 toggle switches, SW0 to SW3 are used to select the desired numeral (0-
9) that will appear on the 7-Segment display... By using a decoder, it's now simply a matter of setting
the correct 4-bit BCD pattern feeding the inputs of the decoder, and the decoder takes care of the
rest...

BCD Input Data

SW3 SW2 SW1 SW0 Numeral Displayed

0 0 0 0 0

0 0 0 1 1

0 0 1 0 2

0 0 1 1 3
0 1 0 0 4

0 1 0 1 5

0 1 1 0 6

0 1 1 1 7

1 0 0 0 8

1 0 0 1 9

The decoder section also has two additional inputs... Lamp Test (LT) turns all segments on so you
can verify at once that all display segments are working, or identify display units that need to be
replaced... This input is normally left at logic 1... The Blanking (BL) input is just the reverse; it forces
the entire display off... This is used in many cases to blank out leading or trailing zeros from a long
display... LT will override BL so you can test even blanked-out display digits...

One should also note that the same circuit could conceivably be controlled by a PLC, if 4 output bits
from a 5VDC PLC output card were used in place of the 4 switches shown... If an 8-bit output card
were available, then two such circuits (2 digits) could be controlled... A 16-bit card would in turn allow
us to control four such circuits (4 digits)..etc...

Parallel Non-Multiplexed Multiple Digit Display


The figure (above) on the left is taken from the LogixPro I/O simulator screen, and depicts a common
method of interfacing to a 4 digit display... The figures on the right are taken from the data sheet of a
pre-manufactured 4 digit display unit which could be readily employed in this particular application...

The manufactured unit does contain four separate circuits, and each circuit (digit) has it's own
decoder, but compared to our earlier circuit example, this unit employs additional components and
circuitry making it far more versatile and easy to use...

Note that there are 4 "Strobe" lines shown; one for each digit... These strobe lines control built in IC
latches which provide us with the option of multiplexing the digits, or displays, if we wished to do so...
In the above non-multiplexed application, the strobes are permanently enabled allowing data to simply
pass through from the BCD inputs and be displayed as normal...

Also note that this particular unit is designed for 24VDC use... This is by far the most common DC
voltage level used in industrial installations, and PLC I/O cards designed for such use are therefore
extremely common... In comparison to 5VDC circuits, 24VDC circuits can typically tolerate far greater
supply voltage excursions, are less sensitive to the effects of contact resistance, and more tolerant of
electrically noisy environments...

Multiplexed Digits
By making use of the 4-bit latches that are built into the 4511 IC, we can easily multiplex the digits if
so desired... By properly controlling the state of each latch enable pin (LE) we can use the same input
data lines (4 switches) to selectively write to each 7-Segment display independently... With just a
minor modification to our circuit, we will be able to essentially treat each digit as a unique 4-bit
memory location where BCD data of our choosing can be stored and retained...

In the above schematic diagram, each display may be written to separately... First the BCD equivalent
of the desired numeral (0-9) is set using the 4 data switches... If SW1 is then closed, the current BCD
input data will enter the latch of the upper 4511 IC, and will be passed on to the decoder causing the
numeral to displayed... if SW1 is then opened, the latch will retain the current data, but will now ignore
any changes on it's inputs... The desired numeral will continue to be displayed by the upper LED
display until power is lost, or SW1 is again closed and new data is allowed to enter it's latch...

The Lower 7-Segment display may be written to in a similar fashion... Set the BCD equivalent of the
desired digit using the 4 data switches, then close SW2 momentarily to store and retain the current
BCD data... We might say that we are strobing the data into the display...

We could readily replace the 4 data switches and 2 latch switches if we had 6 5VDC outputs available
on our PLC... If we wished to add additional digits, we would require 1 more PLC output for each digit
added... By multiplexing the data in this fashion we would only require 8 PLC outputs to control a 4
digit display...

4 Digit Display configured for Multiplexed Digits

By using multiplexed data lines as shown above, we can dramatically reduce the number of PLC
outputs required (8) to control this 4 digit display... The down side is that writing a ladder logic
program to update a display wired in this fashion will be somewhat more complicated then one written
to control 4 digits wired in parallel...

If you have been looking closely, you may have questioned the purpose of the dual inline sockets
located on the wiring PCB of this manufactured display unit.. Well essentially the 16 data lines are
internally connected in parallel with these sockets, and this allows us to easily add additional units by
simply interconnecting them using a flat ribbon cable assembly...

Multiple 4 Digit Displays configured for Multiplexed Digits


For those with a fundamental knowledge of computers, you'll likely note that we have essentially
created a 4-bit data bus, and the strobe lines are in effect our address bus... We can continue to add
additional digits, and for each digit added we will require 1 additional PLC output, or 4 outputs per
quad display...

1 Quad Display requires 4 data + 4 strobes = 8 outputs


2 Quad Displays requires 4 data + 8 strobes = 12 outputs
3 Quad Displays requires 4 data + 12 strobes = 16 outputs
4 Quad Displays requires 4 data + 16 strobes = 20 outputs

If you are reading through this tutorial because you are having difficulty determining how to control the
4 quad displays in the Bottle Line Simulation, you may already have noted that the displays in that
simulation do not employ muxed (multiplexed) digits, but rather the quad displays themselves are
muxed... Why this method was chosen, will be investigated now...

Multiplexed 4 Digit Displays ..... (Bottle Line Simulation)


PARTS AND MATERIALS

• 4511 BCD-to-7seg latch/decoder/driver (Radio Shack


catalog # 900-4437)
• Common-cathode 7-segment LED display (Radio
Shack catalog # 276-075)
• Eight-position DIP switch (Radio Shack catalog #
275-1301)
• Four 10 kΩ resistors
• Seven 470 Ω resistors
• One 6 volt battery

Caution! The 4511 IC is CMOS, and therefore sensitive to static electricity!

CROSS-REFERENCES

Lessons In Electric Circuits, Volume 4, chapter 9: "Combinational Logic Functions"

LEARNING OBJECTIVES

• How to use the 4511 7-segment decoder/display


driver IC
• Gain familiarity with the BCD code
• How to use 7-segment LED assemblies to create
decimal digit displays
• How to identify and use both "active-low" and
"active-high" logic inputs

SCHEMATIC DIAGRAM
ILLUSTRATION

INSTRUCTIONS

This experiment is more of an introduction to the 4511 decoder/display driver IC than it is a


lesson in how to "build up" a digital function from lower-level components. Since 7-segment
displays are very common components of digital devices, it is good to be familiar with the
"driving" circuits behind them, and the 4511 is a good example of a typical driver IC.

Its operating principle is to input a four-bit BCD (Binary-Coded Decimal) value, and energize
the proper output lines to form the corresponding decimal digit on the 7-segment LED
display. The BCD inputs are designated A, B, C, and D in order from least-significant to most-
significant. Outputs are labeled a, b, c, d, e, f, and g, each letter corresponding to a
standardized segment designation for 7-segment displays. Of course, since each LED
segment requires its own dropping resistor, we must use seven 470 Ω resistors placed in
series between the 4511's output terminals and the corresponding terminals of the display
unit.

Most 7-segment displays also provide for a decimal point (sometimes two!), a separate LED
and terminal designated for its operation. All LEDs inside the display unit are made common
to each other on one side, either cathode or anode. The 4511 display driver IC requires a
common-cathode 7-segment display unit, and so that is what is used here.

After building the circuit and applying power, operate the four switches in a binary counting
sequence (0000 to 1111), noting the 7-segment display. A 0000 input should result in a
decimal "0" display, a 0001 input should result in a decimal "1" display, and so on through
1001 (decimal "9"). What happens for the binary numbers 1010 (10) through 1111 (15)?
Read the datasheet on the 4511 IC and see what the manufacturer specifies for operation
above an input value of 9. In the BCD code, there is no real meaning for 1010, 1011, 1100,
1101, 1110, or 1111. These are binary values beyond the range of a single decimal digit, and
so have no function in a BCD system. The 4511 IC is built to recognize this, and output (or
not output!) accordingly.

Three inputs on the 4511 chip have been permanently connected to either Vdd or ground: the
"Lamp Test," "Blanking Input," and "Latch Enable." To learn what these inputs do, remove
the short jumpers connecting them to either power supply rail (one at a time!), and replace
the short jumper with a longer one that can reach the other power supply rail. For example,
remove the short jumper connecting the "Latch Enable" input (pin #5) to ground, and replace
it with a long jumper wire that can reach all the way to the Vdd power supply rail. Experiment
with making this input "high" and "low," observing the results on the 7-segment display as
you alter the BCD code with the four input switches. After you've learned what the input's
function is, connect it to the power supply rail enabling normal operation, and proceed to
experiment with the next input (either "Lamp Test" or "Blanking Input").

Once again, the manufacturer's datasheet will be informative as to the purpose of each of
these three inputs. Note that the "Lamp Test" (LT) and "Blanking Input" (BI) input labels are
written with boolean complementation bars over the abbreviations. Bar symbols designate
these inputs as active-low, meaning that you must make each one "low" in order to invoke its
particular function. Making an active-low input "high" places that particular input into a
"passive" state where its function will not be invoked. Conversely, the "Latch Enable" (LE)
input has no complementation bar written over its abbreviation, and correspondingly it is
shown connected to ground ("low") in the schematic so as to not invoke that function. The
"Latch Enable" input is an active-high input, which means it must be made "high" (connected
to Vdd) in order to invoke its function.

You might also like