The seven segment display in an intermediate level project for beginners. This project is mainly focused on how to connect the seven segment display with the Arduino and mBlock. Once you have learnt the connection and the logic of working. Nobody can stop you from reprogramming the seven segment display.
To get started we will need an Arduino (Uno or whichever one you have that would not make a difference). But ideally as the number of pins increase on our Arduino boards the capability is higher and better projects can be built.
Don’t know Arduino yet? Click here to learn about the Pins and other ports available on it.
- 7 Segment Display
- Arduino Uno
- Jumper cables (Ribbon cable wire will make it easier for beginners)
- Resistors of 220 ohms
- mBlock or Arduino IDE on your computer
Connect the circuit
Let us try to understand the 7 segment display first.
We all know to light up a LED given a resistor and a battery. Similarly we have 8 LEDs on the display which are the 7 Segments and the other is the Decimal Point (DP).
Now we can hereby turn the segments ON and OFF as needed which would display a particular number. So now lets look at the Pin Diagram and try to figure our which segments to turn ON and which segments to turn OFF for the number 1.
Note to remember, always find out whether your display is anode (+) or cathode (-) display. So
How do you know if a 7 segment is anode or cathode display?
- Hold the display in your hand, with the label side towards you which is the bottom side of the display. Now the bottom left corner is Pin 1.
- Take a 220 ohm resistor and connect it to the Pin 1 and connect them in two ways as shown below.
- If the LED segment “e” turns ON in circuit 1, it is an anode display.
- If the LED segment “e” turns ON in circuit 2, it is a cathode display.
- if nothing works, try to check your circuit or else it means your segment “e” does not work.
Now we can see that we need to turn ON segment “b” and “c”. So when program it using mBlock or the Arduino IDE as needed.
I have an Anode display. So i will keep my com pins on the display HIGH and the other segments pins to be LOW when i want to turn them ON.
Lets do our complete connection with reference to the below circuit diagram.
So lets try the most simplest digit 1. We need to turn ON the segments “b” and “c”. So as per the anode display logic i will code my digit as follows:
Segment “b” and “c” are segment display Pins 6 and 4 which are also connected to Arduinos Digital Pins 6 and 4. So we need to turn then LOW in order for the segments to turn ON.
Similarly the code is made for all the digits and can be downloaded here. I have done a reverse counter of digits. You could use the code and make one of your own. Happy Learning Enthusiasts! Keep it up the world needs more people like you.
You can also view a full video tutorial of this project and enjoy.