top of page

Lesson:04 - Introduction to interfacing of 7 Segment display with Arduino Uno

Updated: 3 days ago

Firstly we will understand what is seven segment and how it works. Then we will learn the interfacing part in more easier way.

The seven segments displays are the oldest yet one of the efficient types of display used in embedded applications. This display has nothing more than 8 LED inside it. Each of the seven LEDs is called a segment because when illuminated the segment forms part of a numerical digit (both Decimal and Hex) to be displayed and sometimes an additional 8th LED is used within the same package thus allowing the indication of a DP(decimal point) as shown in the picture.

These entire 8 segment LEDs have one end of their pins pulled out of the module and the other ends are connected together and pulled out as the Common pin. So to make an LED of a particular segment glow we just have to power common pin along with the segment pin. This way we can power more than one segment at a time to represent the numeric number 0-9 and also few Alphabets as shown on the graphic image below.

The displays common pin is generally used to identify which type of 7-segment display it is. As each LED has two connecting pins, one called the “Anode” and the other called the “Cathode”, there are therefore two types of LED 7-segment display called: Common Cathode (CC) and Common Anode (CA).These are available in common Cathode and common Anode modes. The difference between the two displays, as their name suggests, is that the common cathode has all the cathodes of the 7-segments connected directly together and the common anode has all the anodes of the 7-segments connected together.

7-Segment Display Interfacing with Arduino Uno

Components Required:

  1. Arduino Uno with USB cable

  2. 7 segment display (Common Anode)

  3. Jumper wires (Male to Male (12))

  4. Breadboard

  5. Pushbutton

  6. 1K Ohm resistor

Segment display wiring diagrams for the Arduino

Steps: -

  1. Insert the 7 segment display into the Breadboard

  2. Connect the –ve rail of the breadboard to the ground of the Arduino

  3. Connect the +ve rail of the breadboard to the +5v of the Arduino

  4. Connect the 7th pin of the display to the Digital pin 1

  5. Connect the 6th pin of the display to the Digital pin 2

  6. Connect the 4th pin of the display to the Digital pin 3

  7. Connect the 2nd pin of the display to the Digital pin 4

  8. Connect the 1st pin of the display to the Digital pin 5

  9. Connect the 10th pin of the display to the Digital pin 6

  10. Connect the 9th pin of the display to the Digital pin 7

  11. Connect pin 3 and 8 of display to +ve rail of the breadboard

Coding part for the interfacing

Steps: - Open the Arduino IDE and click on File and the click on New to create a new empty file

  1. Define the Pin Mode in the void Setup

  2. Define the logic in the void Loop

Functions used in this example:

  1. pinMode(Pin_Number, IN/OUT); to set the mode i.e. input or output for example pinMode(3,OUTPUT);

  2. digitalWrite(Pin_Number,LOW/HIGH); to set the pin as High or low for example digitalWrite(3,LOW);

  3. delay(microseconds) to put a time delay between two instructions. For example delay(1000) i.e. 1 sec delay

Thank you guys that is it in this lesson. If you want to learn more about Arduino based projects do register for IoT course provided by Nation innovation.

1 view0 comments

Recent Posts

See All
bottom of page