How to Make Basic 7-Segment Display Connections

For experienced electronics hobbyists or professional circuit developers, incorporating a 7-segment (or larger) display into a design might be second nature. Given the plug-and-play nature of many modern devices, though, a beginner might not understand how segmented displays work. A basic overview of the design and function may help.

Basic Diodes

Each segment or point of the display uses a light emitting diode (LED), and like any common diode, there is an anode and cathode point. Connect these to a power source and ground, and the LED will light up that segment.

Common Anode and Common Cathode

The next step to understanding segmented displays is the labeling and connectivity within the unit. One end of the LEDs will have individual connections to an outside device, and the other end will join as a group to a common connection. The two connections will often be labeled as +V and GND (ground) or something very similar, and the two different configurations are referred to as ‘common cathode displays’ and ‘common anode displays’.

In the diagrams below, we can see how the orientation of the LEDs within the segmented display determines if the group connection is to +V or to GND. Note that the two connected segments (‘B’ and ‘C’ lines to the ‘1’ on the display) have the same pathway structure whether the device is common anode or common cathode given that the segments all have the same labels per device. For more information on choosing the current-limiting resistors between the display and the control signal, see the links below the drawings.

Common Cathode Display

Common Anode Display

Digi-key Tech Forum: [ Choosing the Correct Resistor for Your LED ]
Digi-key Conversion Calculators [ LED Series Resistor Calculator ]

To further understand the significance of common anode and common cathode, let’s compare the number of pins that would be necessary if the +V or GND of the display was not a common (group) connection. Assume that the input side is a microcontroller using eight pins to make a path to the display (seven LED segments plus the decimal point [DP] LED = eight).

In the previous diagrams, we can see that eight display pin terminals are needed for the segments and DP, and at least one for +V or GND, for a total of nine. It is not unusual to see two pins used as +V or GND on a segmented display, but for this practice, assume only one. How would this look without the common connections? Instead of one +V/GND pin for all segments and DP, we would need one for each, for a total of eight. There would now be eight pins for one side of the LEDs, and eight pins for the other, for a total of sixteen. Clearly, this would complicate a circuit design and add extra cost to the segmented display product.

Multiplexing and Multiple Segmented Displays

What happens if there are multiple segmented displays? If we already use at least eight microcontroller pins for one display, do we need to add that many for each additional character? Multiple displays could be set up with that configuration, but much like the design without a common anode or cathode, there would be many extra terminations.

Multiplexing is a method used to overcome this problem. For this article, we are only looking at the concept and not a design plus corresponding code. In the drawing below, note the individual path to each display module, and then the common path to each segment or DP LED. Pin D11 controls the D1 display, and pin D10 controls the D0 display. On the other hand, pin D9 has double duty by controlling segment A for both displays, and D8 does the same for segment B.

The idea seems clear—turn on each display only when needed—but how are they used simultaneously? With a microcontroller and the multiplexing method, the displays are turned on and off in sequence with the segments activated as needed to display the correct character. The idea seems clear—turn on each display only when needed—but how are they used simultaneously? With a microcontroller and the multiplexing method, the displays are turned on and off in sequence with the segments activated as needed to display the correct character. Given the frequency at which a microcontroller can operate, this rapid change (refresh rate) across the characters is more than sufficient to appear stable to the human eye. This effect is know as Persistence of Vision (POV), and refers to the image that is retained for a very short period after light from an object has ceased entering the eye.

As an experiment, one circuit could be set up using this multiplexing method, and another set up with enough MCU I/O pins to run a two-character display without multiplexing. Compare the two results versus the microcontroller resources needed to run them.

Before moving on to other ICs and methods of handling the input to a display module, check out the various microcontroller and segmented display products on the Digi-key site.

Product Index > Optoelectronics > [ Display Modules – LED Character and Numeric ]. There are filters for the ‘Number of Characters’ and ‘Display Type’ that relate to the basic topics covered here.

Product Index > Integrated Circuits (ICs) > [ Embedded – Microcontrollers ].

Binary Coded Decimal (BCD)

Are there other ways to reduce the burden on the MCU? The answer is ‘Yes’, and we’ll look at one of them, here. For this example, a basic understanding of Binary Coded Decimal is needed. It’s simply a means of converting a decimal number (0 to 9) into a four-character code that can be further translated as the segments of a display. In the following table, note the binary representation of the decimal numbers and the relation to the activated segments of a display.

7SegmentBCD

There are ICs made specifically to process the BCD format into a code for a segmented display. An example is shown, below. (Depending on the IC, there may or may not be support for the DP LED, but it can also be directly controlled from the MCU.)

It may seem as though this adds more complexity to a design, but it’s usually the microcontroller that becomes overtasked, and upgrading to larger MCUs increases costs while still adding design problems. This fact becomes far more evident when looking at a basic diagram using an LED display driver such as the MAX7219 or MAX7221, below. Note that much of the work has been delegated to the display driver when using an 8-digit segmented display in the circuit, and work means resources are used. In this case, the MCU retains much of its capability to carry out other tasks.

There are display drivers on the Digi-key site that include the BCD interface: [ PMIC – Display Drivers “BCD” ].

For all of the above products and more, be sure to check out the Digi-Key home page: [ Digi-Key ]

To learn more about basic connections, read this forum post: [ Basic Keypad Connections ]

Summary

Now that we’ve covered the basic function and operation of a segmented display, we can venture into using larger models such as 14- or 16- segments for more character options. There are also more ways (and more ICs) to transfer data to the display, and some IC functions negate the need for multiplexing. On the other hand, if one needed to demonstrate the concept of segmented display operation in the simplest terms, a mechanical dip switch could be set up on the control side, and each segment would be turned on or off manually (not a bad idea for educators). The point is that there are multiple options when using a segmented display depending on one’s own skill level and the requirements of the circuit.

What is your favorite method or product? Let us know in the comments.





Further reading:

Jameco [ Identifying Light Emitting Diodes ]

Jameco [ Working with Seven Segment LED Displays ]

Adafruit [ 7-Segment Clock Display ]

Adafruit [ Blog “Segment” ]

1 Like