What Is a Seven Segment Display and How It Works

The glowing, blocky digits on alarm clocks, microwaves, petrol pumps and meters almost always come from a seven segment display: seven separate bar-shaped lights arranged like a figure 8, usually LEDs. Every number is simply a pattern of bars switched on or off, which makes it one of the cheapest and most readable ways to show digits. The idea is also surprisingly old, dating from patents more than a century ago, long before the electronics that now drive it.1Wikipedia. Segment display

The Seven Bars and Their Letter Names

Each of the seven lit parts of the display, called a segment, has a standard letter name from a to g.1Wikipedia. Segment display Bar a is the top, the letters continue clockwise around the outside, and g is the middle bar. Many displays add an eighth light, a small decimal point marked DP, for numbers like 3.5.1Wikipedia. Segment display It usually sits at the lower right of the digit.

The layout is one bar across the top, one across the middle, one across the bottom, and two upright bars on each side. Many displays slant the bars slightly so the digits look handwritten. Seven is the minimum that works for all ten digits with straight strokes only, which keeps the part cheap and the wiring short.

In an LED display each bar is its own small LED, and one of its pins comes straight out of the plastic package.2Electronics Tutorials. 7-segment Display So you can switch any bar on or off independently of the others.

On the back of a typical single-digit package you’ll find ten pins in two rows of five. They’re labelled a to g and DP, plus one or two shared pins. Find pin 1 by the corner or dot marking on the package and count around from there. The pins are not in alphabetical order, so you can’t guess which one is bar a from its position, and you should check the datasheet before wiring. The shared pin is often repeated at the middle of the top and bottom rows, which means those two pins connect to the same point inside.

How Seven Bars Draw Every Digit

Switching bars on in different combinations shows any digit from 0 to 9 and the letters A to F in mixed upper and lower case.3Nuts and Volts Magazine. Using Seven-Segment Displays — Part 1 A 1 lights only the two right-hand bars, b and c, while an 8 lights all seven.

A few more shapes are worth knowing. A 0 lights every bar except the middle g, which leaves the ring open in the center. A 7 lights the top bar a plus the right-hand bars b and c. A 4 lights f, g, b and c, with no top or bottom bar. When a digit looks wrong, these shapes let you see which bar is missing or extra and trace that wire.

One byte, eight on-off bits, can describe every bar plus the decimal point.1Wikipedia. Segment display In the common order gfedcba, the value 0x06 turns on bars b and c and shows a 1.1Wikipedia. Segment display Programmers keep a small table of ten such values, one per digit, and the code simply looks up the right one.4Embed Journal. Interface 7 Segment Display with Microcontroller

There are two common bit orders: some code lists bar a first, some lists g first. Mixing them up scrambles every digit, so check which order your library or chart uses before copying values.

The letters A to F matter because they let one digit show values from 0 to 15, the hexadecimal digits. That’s why these displays turn up on test meters and computer kits. Lowercase b and d are used so they don’t look like an 8 and a 0.

Common Anode Versus Common Cathode

Manufacturers join one side of all the LEDs together to cut the number of pins and connections.5OPTO PLUS LED. 7-segment & 16-segment Displays and Internal Structures – OPTO PLUS LED That gives two types, depending on which side is shared.5OPTO PLUS LED. 7-segment & 16-segment Displays and Internal Structures – OPTO PLUS LED

In a common cathode display, every bar’s negative side joins to ground.2Electronics Tutorials. 7-segment Display A bar lights when its own pin gets a high, or logic 1, signal through a resistor.2Electronics Tutorials. 7-segment Display

In a common anode display, every bar’s positive side joins to the supply.2Electronics Tutorials. 7-segment Display A bar lights when its pin is pulled low, to ground or logic 0, through a resistor.2Electronics Tutorials. 7-segment Display The two types usually look identical and are told apart only by model number.5OPTO PLUS LED. 7-segment & 16-segment Displays and Internal Structures – OPTO PLUS LED

To find out which you bought, look up the part number printed on the package in its datasheet, which states the type and shows the pin layout. If there’s no usable marking, connect a battery or a 5 volt supply with a resistor of a few hundred ohms in series. Try the shared pin on positive and then on negative, touching the other lead to a bar pin each time. The way that lights a bar tells you the type: shared pin on negative means common cathode, and on positive means common anode.

If you assume the wrong type, either nothing lights or every digit appears inverted, with the wrong bars on. Usually no damage occurs, just a confusing result. The fix is to swap the shared connection or flip high and low in your code.

LED and LCD Versions Work Differently

An LED is a semiconductor that gives off light when current flows through it the right way.6SlideShare. Introduction to seven segment display new Brightness rises roughly in step with the current.2Electronics Tutorials. 7-segment Display

An LCD bar makes no light of its own. Voltage on a bar’s electrode turns the liquid crystals and changes how light passes, making the bar look dark.7Panox Display. What Is a Seven Segment Display and How It Works Many LCDs need a backlight to be read in the dark, which draws extra power.8Winstar Display. What Is a Seven Segment Display and How It Works A small LCD module with backlight typically draws about 30 to 80 mA, while a multiplexed LED one draws about 50 to 300 mA.9Industrial Monitor Direct. LED vs LCD vs VFD: Selecting HMI Display Technology

That difference shapes the choice. LEDs are bright and readable from across a room, which suits clocks, signs and meters. LCDs suit battery devices like watches and thermometers, because without a backlight they draw very little current. For a hobby project powered from a USB port or a development board, either works and LED is usually simpler to wire.

You can tell them apart on a finished device. Glowing red or green digits are almost always LED, and gray bars on a pale background are LCD. An older cyan glow usually means a vacuum fluorescent display.

How Several Digits Share the Same Wires

Multiplexing lets several digits share the same bar connections, each digit with its own on switch.10Jameco. What Is a Seven Segment Display and How It Works The controller puts the pattern for the first digit on the shared bar wires, turns on only that digit’s switch, waits, and turns it off. It lights one digit at a time.11GitHub. Multiplexing-2-Digit-7-Segment-Display-using-PIC16F877A/README.md at main · asathiskumar98-byte/Multiplexing-2-Digit-7-Segment-Display-using-PIC16F877A Then it repeats for the second, third and fourth digits and starts again at the first.

If all digits are cycled faster than about 50 times a second, the eye sees no flicker.12Zbotic. Arduino 7-Segment Multiplexing: Drive 4 Digits on Few Pins A four-digit display then needs about 12 wires instead of 32.

Switching digits in turn has side effects. Each digit is on only part of the time, so average brightness drops as digits are added, and designs often allow slightly higher current per digit to compensate. Ghosting can also appear: showing 12 can leave a faint 2 on the first digit and a faint 1 on the second. It happens when one digit is still partly on as the next lights, and the usual fix is to turn all digits off briefly between switches.

Driver chips can do the switching for you. Chips like the MAX7219 drive up to 8 digits from a few serial wires, with the decoding and switching built in.13Maxim Integrated. MAX7219/MAX7221 Serially Interfaced, 8-Digit LED Display Drivers Older decoder chips turn a binary-coded digit into the seven bar signals in hardware.14FAST and LS TTL Data. SN54/74LS48 BCD to 7-Segment Decoder

Why Every Bar Needs a Resistor

An LED burns out if it gets too much voltage and current.15OPTO PLUS LED. 7-Segment LED Display: Current-Limiting Resistor Design Extra current heats it, the heat lets even more current through, and the cycle runs away.16Industrial Monitor Direct. 7-Segment Display Driver Design and Resistor Sizing Guide A current-limiting resistor of the right value in series stops that cycle.15OPTO PLUS LED. 7-Segment LED Display: Current-Limiting Resistor Design

Even though it looks like one digit, the package is seven separate LEDs that each need protection.2Electronics Tutorials. 7-segment Display Use one resistor per bar, not one on the shared pin.

A resistor on the shared pin has to pass the current of every lit bar together. That current splits among the lit bars, so an 8 looks dimmer than a 1, and brightness changes from digit to digit. One resistor per bar gives each bar the same current whichever others are lit.

To choose a value, subtract the LED’s forward voltage from the supply, then divide by the safe current on the datasheet. Values of a few hundred ohms are typical on 5 volts.

What a Seven Segment Display Can’t Show

Letters such as M, V, W and X cannot be shown clearly because they need diagonals or extra vertical strokes.17Wikipedia. Seven-segment display character representations Other letters work only as capitals or only lowercase.17Wikipedia. Seven-segment display character representations

Appliance messages like End or Err are chosen from letters that can be drawn. Units needing full text use 14- or 16-segment displays, which add diagonals and extra bars, or dot-matrix displays.

A failed bar can mislead. If the middle bar is stuck on or off, 0 and 8 look the same.18Journal Royal Society Interface. Testing all bars at once by showing an 8 at power-up catches this.

Where the Seven Segment Idea Came From

Segmented digits appear in a 1903 patent for printing telegraphed numbers.1Wikipedia. Segment display A 1908 patent used plain light bulbs behind slots cut in wood.19Hackaday. The Original Seven (Eight?) Segment Display By 1910 a bulb-lit seven segment display ran on a power plant signal panel.20Fandom (Segment Displays Wiki). 7-segment display Bulbs are bulky, hot and power-hungry, which limited where they could go.

LED displays arrived around 1967 but were very expensive.21vintagecalculators.com. What Is a Seven Segment Display and How It Works Early calculator displays used many LEDs per bar; later ones used one LED and a light pipe to spread its glow.21vintagecalculators.com. What Is a Seven Segment Display and How It Works An LED is small, cool and lasts much longer than a bulb, and electronic circuits can switch it fast, which suits digit-by-digit refresh.