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:
Arduino Uno with USB cable
7 segment display (Common Anode)
Jumper wires (Male to Male (12))
Breadboard
Pushbutton
1K Ohm resistor
Segment display wiring diagrams for the Arduino
Steps: -
Insert the 7 segment display into the Breadboard
Connect the –ve rail of the breadboard to the ground of the Arduino
Connect the +ve rail of the breadboard to the +5v of the Arduino
Connect the 7th pin of the display to the Digital pin 1
Connect the 6th pin of the display to the Digital pin 2
Connect the 4th pin of the display to the Digital pin 3
Connect the 2nd pin of the display to the Digital pin 4
Connect the 1st pin of the display to the Digital pin 5
Connect the 10th pin of the display to the Digital pin 6
Connect the 9th pin of the display to the Digital pin 7
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
Define the Pin Mode in the void Setup
Define the logic in the void Loop
Functions used in this example:
pinMode(Pin_Number, IN/OUT); to set the mode i.e. input or output for example pinMode(3,OUTPUT);
digitalWrite(Pin_Number,LOW/HIGH); to set the pin as High or low for example digitalWrite(3,LOW);
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.
Recent Posts
See AllLet us now understand basics of Relay and then will move on to the interfacing part of Relay with Arduino Uno. Relay A relay is an electrically operated switch. It consists of a set of input terminals
Firstly will look into the introduction of servo motor and it's working. Then we will study how to interface this servo motor with Arduino Uno. Description of Servo motor Positional rotation servo mot
Let us first understand what is Ultrasonic sensor and why, where it is used? Then will move to interfacing part. Ultrasonic sensor As shown below the HC-SR04 Ultrasonic (US) sensor is a 4 pin module,