Interfacin g to 7-Segment Numeric Displays

A typical 7-segment LED display component, with decimal point. A seven-segment display, or seven-segment indicator, is a form of electronic display devicefor displaying decimal numerals that is an alternative to the more complex dot-matrixdisplays. Seven-segment displays are widely used in digital clocks, electronic meters, and other electronic devices for displaying numerical information. Contents [hide]

1 Concept and visual structure 2 Implementations 3 Alphabetic display 4 Numbers to 7-segment-code 5 References 6 See also 7 External links Concept and visual structure

The individual segments of a seven-segment display. A seven segment display, as its name indicates, is composed of seven elements. Individually on or off, they can be combined to produce simplified representations of the arabic numerals. Often the seven segments are arranged in an oblique (slanted) arrangement, which aids readability. In most applications, the seven segments are of nearly uniform shape and size (usually elongated hexagons, though trapezoidsand rectangles can also be used), though in the case of adding machines, the vertical segments are longer and more oddly shaped at the ends in an effort to further enhance readability. Each of the numbers 0, 6, 7 and 9 may be represented by two or more different glyphs on seven-segment

this is done to obtain a unique. where the optional DP decimal point (an "eighth segment") is used for the display of non-integer numbers. Notice the variation between uppercase and lowercase letters for A±F. a capital D would look identical to an 0 (or less likely O) and a capital B would look identical to an 8). LED-based 7-segment display showing the 16hex digits. middle. The segments of a 7-segment display are referred to by the letters A to G. The animation to the left cycles through the common glyphs of the ten decimal numerals and the six hexadecimal "letter digits" (A±F). The seven segments are arranged as a rectangle of two vertical segments on each side with one horizontal segment on the top. unambiguous shape for each letter (otherwise. Additionally. which is described technology-wise in the following section. these have mostly been replaced by dot-matrixdisplays. however. There are also fourteen-segment displays and sixteensegment displays (for fullalphanumerics).displays. Implementations . It is an image sequence of a "LED" display. and bottom. as shown to the right. the seventh segment bisects the rectangle horizontally.

arrays of light-emitting diodes (LEDs). .An incandescent light type early seven-segment display. display for Seven-segment displays may use a liquid crystal display(LCD). A mechanical seven-segment displaying automotive fuel prices.

neonlamp-like nixie tube. incandescent filaments. [1] In a simple LED package. while the cathodes of all segments for each digit would be connected. To operate . and others. RCA sold a display device known as the Numitron that used incandescent filaments arranged into a seven-segment display. Multiple-digit LED displays as used in pocket calculators and similar devices used multiplexed displays to reduce the number of IC pins required to control the display. Starting in 1970. in order to match industry standard pinouts). Integrated displays also exist. For gasoline price totems and other large signs. For example. vacuum fluorescent. typically all of the cathodes(negative terminals) or all of the anodes (positive terminals) of the segment LEDs are connected together and brought out to a common pin. this is referred to as a "common cathode" or "common anode" device.or other light-generating or controlling techniques such as cold cathodegas discharge. though most do not ± each individual LED is brought out to a connecting pin as described. Hence a 7 segment plus decimal point package will only require nine pins (though commercial products typically contain more pins. with single or multiple digits. Some of these integrated displays incorporate their own internal decoder. vane displays made up of electromagnetically flipped lightreflecting segments (or "vanes") are still commonly used. An alternative to the 7-segment display in the 1950s through the 1970s was the cold-cathode. and/or spaces where pins would go. all the anodes of the A segments of each digit position would be connected together and to a driver pin.

Unlike LEDs. dot-matrix LCDs have largely superseded LED displays. though even in LCDs 7segment displays are very common. However. instead of sixty-four drivers and IC pins. Seven segment displays can be found in patents as early as 1908 (in U. Patent 974. which displayed the number 4 using a diagonal bar). pressing multiple keys at once would produce odd results on the multiplexed display. the controlling integrated circuit would turn on the cathode driver for the selected digit.any particular segment of any digit. the high common . In this manner an eight digit display with seven segments and a decimal point would require only 8 cathode drivers and 8 anode drivers. or (spray)paints color through a seven-segment digit template. which makes it difficult to form more complex shapes than the segments of 7segment displays. however. the shapes of LED segments tend to be simple rectangles. and the anode drivers for the desired segments.S. where the user either applies color to pre-printed segments. For many applications. in a sequential fashion. They are sometimes even used in unsophisticated displays like cardboard "For sale" signs. reflecting the fact that they have to be physically moulded to shape. then after a short blanking interval the next digit would be selected and new segments lit. Often in pocket calculators the digit drive lines would be used to scan the keyboard as well.943. providing further savings. In contrast. but did not achieve widespread use until the advent of LEDs in the 1970s. to compose figures such as product prices or telephone numbers. F W Wood invented an 8-segment display. the shapes of elements in an LCD panel are arbitrary since they are formed on the display by a kind of printing process.

Short messages giving status information (e. seven-segment displays are commonly used by school children to form words and phrases using a technique known as "calculator spelling". Using a restricted range of letters that look like (upsidedown) digits. Alphabetic display Main article: Seven-segment representations display character In addition to the ten numerals. makes sevensegment multiple-digit LCD screens very common on basic calculators. and the comparatively high visual contrast obtained by such displays relative to dot-matrix digits. In the case of such messages it is not necessary for every letter to be unambiguous. It is possible to represent hexadecimal unambiguously by using a mixture of letter cases (AbCdEF is typical) and using a representation of 6 that has the top segment illuminated.g. Numbers to 7-segment-code . but only few representations are unambiguous and intuitive at the same time. "no disc" on a CD player) are also commonly represented on 7-segment displays. seven segment displays can be used to show letters of the latin.cyrillic and greek alphabets including punctuation. merely for the words as a whole to be readable Similar displays with fourteen or sixteen segments are available allowing decent representations of the alphabet. This is frequently used to output hexadecimal codes for troubleshooting purposes.recognition factor of 7-segment displays.

both usually assume 0 is off and 1 is on. The most popular bit encodings aregfedcba and abcdefg . This table gives the hexadecimal encodings for displaying the digits 0 to F: Digit gfedcba abcdefg a 0 1 0x3F 0x06 0x5B 0x4F 0x66 0x6D 0x7D 0x07 0x7F 0x7E 0x30 0x6D 0x79 0x33 0x5B 0x5F 0x70 0x7F b c d e f g on on on on on on off off on on off off off off on on off on on off on on on on on off off on off on on off off on on on off on on off on on on off on on on on on on on on off off off off on on on on on on on 2 3 4 5 6 7 8 .A single byte can encode the full state of a 7-segmentdisplay.

9 A b C d E F  0x6F 0x77 0x7C 0x39 0x5E 0x79 0x71 0x7B 0x77 0x1F 0x4E 0x3D 0x4F 0x47 on on on on off on on on on on off on on on off off on on on on on on off off on on on off off on on on on off on on off off on on on on on off off off on on on .

. To correctly interface a PLC to such a display..... we'll concentrate on the more common LED units in the examples to follow.. Although it is possible to build such a display yourself.7-Segment Numeric LED Displays In industrial PLC applications. and how this effects our task of interfacing to. Although both LED and LCD numeric displays are readily available. one of the old. . it is far more common to employ a premanufactured product such as the 4-digit panel mount unit shown at the top of this page. 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.. it helps to first understand what basic electronic components are typically employed in their makeup.. and interfaced similarly. and programming such a unit.

this particular IC includes a built in 4-bit latch which we will make use of in later examples. Although BCD to 7-Segment decoder ICs are available without built in latches.... .. a simple IC known as a "BCD to 7-Segment decoder" was quickly developed to simplify their use.. For now the latch is set to simply allow input data to freely pass through to the decoder..BCD to 7-Segment Decoder c/w 4-bit Latch Once 7-Segment LED displays became readily available. 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...

. 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. SW0 to SW3 are used to select the desired numeral (0-9) that will appear on the 7-Segment display.In the above diagram. the 4 toggle switches. BCD Input Data SW3 SW2 SW1 SW0 Numeral Displayed .

. This is used in many cases to blank out leading or trailing zeros from a long display...... if 4 output bits from a 5VDC PLC output card were used in place of the 4 switches shown.... Parallel Non-Multiplexed Multiple Digit Display ..etc.. it forces the entire display off. then two such circuits (2 digits) could be controlled..0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 0 0 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 2 3 4 5 6 7 8 9 The decoder section also has two additional inputs. LT will override BL so you can test even blanked-out display digits.. If an 8-bit output card were available... 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.. Lamp Test (LT) turns all segments on so you can verify at once that all display segments are working.... One should also note that the same circuit could conceivably be controlled by a PLC. A 16-bit card would in turn allow us to control four such circuits (4 digits).

.. Note that there are 4 "Strobe" lines shown. In the above non- . These strobe lines control built in IC latches which provide us with the option of multiplexing the digits..... one for each digit.... 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. but compared to our earlier circuit example.The figure (above) on the left is taken from the LogixPro I/O simulator screen. or displays. and each circuit (digit) has it's own decoder.. this unit employs additional components and circuitry making it far more versatile and easy to use. and depicts a common method of interfacing to a 4 digit display. The manufactured unit does contain four separate circuits. if we wished to do so.

. 24VDC circuits can typically tolerate far greater supply voltage excursions. the strobes are permanently enabled allowing data to simply pass through from the BCD inputs and be displayed as normal... we can easily multiplex the digits if so desired..... This is by far the most common DC voltage level used in industrial installations. In comparison to 5VDC circuits. 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. and more tolerant of electrically noisy environments... 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.... Also note that this particular unit is designed for 24VDC use.multiplexed application. ... and PLC I/O cards designed for such use are therefore extremely common. Multiplexed Digits By making use of the 4-bit latches that are built into the 4511 IC. are less sensitive to the effects of contact resistance.

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

.. If we wished to add additional digits.... We could readily replace the 4 data switches and 2 latch switches if we had 6 5VDC outputs available on our PLC.. 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. then close SW2 momentarily to store and retain the current BCD data. 4 Digit Display configured for Multiplexed Digits By using multiplexed data lines as shown above.. . Set the BCD equivalent of the desired digit using the 4 data switches.. we can dramatically reduce the number of PLC outputs required (8) to control this 4 digit display.... 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.The Lower 7-Segment display may be written to in a similar fashion. We might say that we are strobing the data into the display.

Multiple 4 Digit Displays configured for Multiplexed Digits .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.

and the strobe lines are in effect .For those with a fundamental knowledge of computers. you'll likely note that we have essentially created a 4-bit data bus.