Skip to main content

Interface a Seven Segment LED display to an Arduino Uno R3

Interface a Seven Segment LED display to an Arduino Uno R3

For many Embedded system applications, there is no need to use an expensive LCD for display purposes, even a simple Seven Segment display can do the work.

Yes, for many Arduino and Embedded system applications if your aim is to display just the numbers, then you should most probably use a Cheaper 7 segment display. 

You can lower down the cost of your project by using a 7 Segment display instead of an LCD display.
Moreover, Using a 7 segment display is much easier than an LCD.

Fig.1 and 2 displays the image of a Seven 7 segment LED display.




                                   Fig. 1 Front view of 7 Segment Display                             
           


   Fig.2 Side View of 7 Segment display

7 Segment LED displays are of two types: Common Cathode and Common Anode. The structure of both types of LEDs is the same, the only difference is in the Polarity of LEDs and the common terminal in the LED displays.

In the common cathode display (generally used) the cathodes of all seven LEDs and the DP (decimal point) are made common and connected to pin 3 and 8 of the LED display. In order to use the LED display effectively, we will have to connect ground to pin 3 and pin 8 and connect +5v supply to other pins to light up the LED of the corresponding pin i.e to light up the individual LEDs.

Fig. 3 shows the internal structure of the common cathode LED display.


 Fig. 3 Internal Structure Common Cathode 7 Segment LED Display

The common anode display is obtained by reversing the polarity, it is the complete opposite of common cathode display. In the common anode display, the anodes of all seven LEDs and the DP (decimal point) are made common and connected to pin 3 and 8 of the LED display. In order to use the LED display effectively, we will have to connect +5v to pin 3 and pin 8 and connect Ground to other pins to light up the LED of the corresponding pin i.e to light up the individual LEDs.

Fig. 4 shows the internal structure of the common anode LED display.




Fig. 4 Internal Structure of Common Anode 7 Segment LED Display


Fig. 5 SSD Configuration of 7 Segment LED Display

Table representing which LED should be ON and which should be OFF for a particular Digit in case of the common cathode display.


Digit
a
b
c
d
e
f
g
dp
0
On
On
On
On
On
On
Off
Off
1
Off
On
On
Off
Off
Off
Off
Off
2
On
On
Off
On
On
Off
On
Off
3
On
On
On
On
Off
Off
On
Off
4
Off
On
On
Off
Off
On
On
Off
5
 On
Off
 On
On 
Off 
 On
On 
Off 
6
 On
Off 
On 
 On
On 
On 
 On
Off
7
 On
On 
On 
Off 
Off 
Off 
Off 
Off 
8
On 
On 
On 
On 
On 
On 
On 
 Off
9
 On
On 
On 
On 
Off 
On 
On 
Off 
A
 On
On 
On 
Off 
On 
On 
On 
Off 
B
 Off
Off 
 On
On 
On 
On 
On 
Off 
C
 On
 Off
Off 
On 
On 
On 
Off 
Off 
D
 Off
 On
On 
On 
On 
 Off
On 
Off 
E
 On
Off 
 Off
On 
On 
On 
On 
Off 
F
 On
Off 
Off 
Off 
On 
On 
On 
Off 


Table 1. Shows the states of the LEDs for representing a digit


You can determine these states by the image shown below.

Fig. 6 shows the LED structure of 7 Segment LED Display.

Experiment No. 1

In Experiment No. 1 we will simply turn on and off the LEDs to get familiar with the working of a 7 segment display.

Components Required:

1. Arduino Uno R3 Board x 1
2. 7 Segment LED Display x 1 (Common Cathode)
3. 220 Ohm Resistors x 7
4. Jumper Wires
5. BreadBoard x 1

Circuit Diagram:

Fig. 7 Pin Diagram of 7 Segment Display


Fig. 8 Circuit Diagram for Experiment 1

Video Tutorial:



How to Use 7 segment display with Arduino - YouTube

Code: 


Download the Code from the Link Below:
Experiment 1 - 7 segment LED 

Experiment No. 2

In Experiment No. 2 we will display all the hexadecimal numbers on our 7 Segment LED Display by making an Up Counter.

Components Required:

1. Arduino Uno R3 Board x 1
2. 7 Segment LED Display x 1 (Common Cathode)

3. 220 Ohm Resistors x 7

4. Jumper Wires

5. BreadBoard x 1

Circuit Diagram:


Fig. 9 Pin Diagram of 7 Segment Display





Fig. 10 Circuit Diagram for Experiment 1

Code:

Download the code from the link below.

Also, If you have any queries, feel free to comment down below and I will try my best to solve, or you can directly DM me at my social media accounts.

Twitter    

Content Creator: Vivek Garg

Comments

Popular posts from this blog

JoyStick HW-504 Interfacing with Arduino

JoyStick HW-504 Interfacing with Arduino Hello Guys, I hope you all are doing well. My Name is Vivek Garg and I welcome you all to my Blog Mostly Programing. If you're new here I will suggest you to check out my YouTube channel  @mostlyprograming . I post 3 New Videos every week, Let's Code Tuesdays, Innovative Thursdays, and Geeky Saturdays.  Go! Go! Go! Check it out and if you like the content you can maybe give me a subscription or a comment or a like (YOU DECIDE!). So, In Today's Tutorial, We are going to see How a PS2 Thumb Joy Stick Works? and How we can use one with an Arduino. Fig. 1 HW - 504 Thumb JoyStick Module When we hear the word joystick, the first thing that strikes our mind is Game Controllers (Like the one shown in Fig. 2). Mainly we use them for playing Games but we can do a lot of fun stuff with them in Electronics. For instance Controlling Robo Cars, Controlling Barrier Gates, etc. Fig. 2 Game Controller Hardware Overview The

Flappy Bird Game with Arduino Uno

Flappy Bird Game with Arduino Uno Hello Guys, I hope you all are doing well. My Name is Vivek Garg and I welcome you all to my Blog Mostly Programing. If you're new here I will suggest you to check out my YouTube channel  @mostlyprograming . I post 3 New Videos every week, Let's Code Tuesdays, Innovative Thursdays, and Geeky Saturdays.  Go! Go! Go! Check it out and if you like the content you can maybe give me a subscription or a comment or a like (YOU DECIDE!). So, Today we are gonna build a fun game with Arduino. This game is called The Flappy Bird game, I bet you must have played this game in your childhood. And if not you can make one today and play. Components Required 1 x BreadBoard 1 x Arduino Uno Board 1 x I2C LCD Display (16x2) 1 x 10 KOhm Resistor 1 x Push Button Jumper Wires USB A/B Cable Circuit Diagram Fig. 1 Circuit Diagram Connections: SCL(LCD) ---> A5/SCL Pin SDA(LCD) ---> A4/ SDA Pin Vcc (LCD) ---> +5Volts Gnd

How to use a Push Button with Arduino

How to use a Push Button with Arduino Hello Guys, I hope you all are doing well. My Name is Vivek Garg and I welcome you all to my Blog Mostly Programing. If you're new here I will suggest you check out my YouTube channel  @mostlyprograming . I post 3 New Videos every week, Let's Code Tuesdays, Innovative Thursdays, and Geeky Saturdays.  Go! Go! Go! Check it out and if you like the content you can maybe give me a subscription or a comment or a like (YOU DECIDE!). In today's tutorial, we are going to see how a push-button works. I know that may sound quite easy to some of you but believe me, it's not as easy as it seems to be (especially for the Newcomers).  So, Today we will be seeing  What is a push-button? How it works? What different configurations can it work in? How to interface one with an Arduino? Also, How to read its status using a software program? How do we control an LED using a Push Button? Let's get started with the Tutorial.