Seven Segment Display Tutorial Interfacing with microcontroller Full Guide Reviewed by Momizat on . This tutorial will guide you all about seven segment display, how it works, and how to interface with any microcontroller and make some cool projects. If you ar This tutorial will guide you all about seven segment display, how it works, and how to interface with any microcontroller and make some cool projects. If you ar Rating: 0
You Are Here: Home » Electronics For Noob » Seven Segment Display Tutorial Interfacing with microcontroller Full Guide

Seven Segment Display Tutorial Interfacing with microcontroller Full Guide






This tutorial will guide you all about seven segment display, how it works, and how to interface with any microcontroller and make some cool projects.

If you are a beginner in electronics, I will suggest you read working principle of seven segment display first, before jumping into code and example directly.

Seven Segment display comes in different form factor.

  1. Single Digit Seven Segment Display
  2. Multi Digit Seven Segment Display

multi-digit-seven-segment-display seven-segment-display-module-single

It purely depends upon your requirement, how many digits you want to display in your project or product using seven segment displays.

Few think Seven Segment display are obsolete now days, No you heard it wrong, Seven Segment Display have more benefits over LCD or LED display.

Here are few points, why seven segment still a good choice:

  • Seven Segment Looks are big and eye catching
  • They Draw Less power
  • Seven Segment are cheap
  • Bright in color so can be noticed from distance.
  • Longevity of seven segment display are more than LCD and Needs less maintenance.

How Seven Segment Display Works?

If you will look at below figure, you can see there are seven( A, B, C, D, E, F, G ) bar excluding DP. Each Bar is called one segment, and combining all seven bar , we call it seven segment display.

Behind Each bar, there is one LED(Light Emitting diode),  As you can see in below Figure, Anode of All LED are connected to a common terminal and Cathode of all led are named as A, B, C and So on.

 

seven-segment-schematic

So When you Connect voltage source to Anode and Give Ground to B and C, then LED B and C will light up, which will Look like  Decimal “1” in the display, Like shown in below figure.

seven-segment-display-my-electronics-lab

Similarly, If If you will ground A, B, C , D and Give Voltage at common anode terminal then it will become 3. This is how Voltage Divider works.

Interfacing with Microcontroller / Arduino :

There are many ways you can interface seven segment Display with a microcontroller.

  1. Single digit
  2. Using BCD to Seven Segment Decoder
  3. Using Multiplexing Method

Single Digit:

                Interfacing single digit seven segment displays with microcontroller is fairly very simple. You just have to interface.

interfacing-seven-segment-with-microcontroller-8051-arduino-my-electronics-lab

You just have to connect common point to voltage source (If it is common anode seven segment display) or to GND (If it is common cathode Seven segment Display). Then you have to connect all other points to GPIO of microcontroller or Arduino and Write Simple Code. To turn on LED of seven segment.

That is simple right? I assume, You can write simple code to turn on seven segment display and display characters. (Do let me know in comment section below, If you still have doubt.)

Using BCD to Seven Segment Decoder:

When you have less GPIO in a microcontroller, and you still have to use seven segment display, then you have to use BCD to Seven Segment Decoder IC. What this IC will do is, it will take 4 digital input and convert it into 7 digital output. Like you can see in below image.

bcd-to-seven-segment-decoder

There are many companies who make this BCD to seven segments Decoder IC.

  1. SN5446A From Texas Instrument Datasheet

Using Multiplexing Method:

Sometimes you have connect lot of seven segment display in some big project and you always of less GPIO left in a microcontroller, in that case you have to use only 8 pins to connect all seven segment display, which can be possible using  multiplexing.

How multiplexing, Works?

            In case of multiplexing you have to connect all seven segments parallelly. Like shown in below image. As you can see all seven segment data pins that is a, v, c, d, e, f, g are connected to same GPIO pins.

display7seg_anim

(The above image is copied from a this link >> http://hackyourmind.org/articles/2013/06/07/raspberry-pi-with-7-segment-display.html)

Then when you have to turn on any particular seven segment, then you have to turn it on using transistor and GPIO 22 or GPIO 21 or so on.

This switching of transistor works so fast that, it looks like all number are being displayed at same time.

 

Hope you like this tutorials, I will suggest you to now just start implementing your first seven segment using any microcontroller, if you have any doubt regarding coding or any other thing , do let me ask in the comment section below.

I will upload one tutorial soon with code on our youtube channel, don’t forget to subscribe and stay tune via our Facebook channel. Happy Learning. 🙂




About The Author

I am a maker, who loves to think, hack and build new electronics stuff, I always find time to document , share my knowledge with others. I am graduate in BTech(Electronics and Communication Engineering).

Number of Entries : 37
Scroll to top