7 segments BCD display is very easy to manage and is perfect for some aplications with low data to display.
Is made from 7 LEDs mounted in a package like in the pictures below:
With this device you can display 0,1,2,3,4,5,6,7,8,9,A,b,C,d,E,F and next we will explain a modality to use the device with arduino or a atmega 328p-pu standalone.
Before start we need to know what type is our BCD, because this devices can be with common cathode and common anode like in the picture:
In the first case with common cathode, to light up the LED the arduino pin must be HIGH or 5V and for the case with common anode the arduino pin must be LOW or 0V(when the pin has 5V the LED is not light up). So to light up the all 7 LED-s we will need 7 pins of arduino, and depending the combination of these we can display the carrcteres mentioned above.
Now we must be carefully with the current for every LED because it’s the current from the arduino pin and from the datasheet has a maximum value around 40 mA.
It’s not indicate to use this value so we will use a 20(25)mA.
In this case we must calculate some resistor values wich mounted between the arduino pin and LED will reduce the current throught the pin at the value established above.
Also you must have the resistors when are using the arduino board, otherwise you can burn the arduino.
In the picture below we have the calculated value for resistor and the schematic for an one digit display:
The resistor value from calculation is 120 ohms but to be sure the current it’s in a safe zone we can choose a bigger value but the LED will dim the light.
For the project I choose the atmega 328 without the arduino powered by a 7805 voltage regulator from a 12V power source and one digit from a four digit package display. The model utilized is ELF-511SYGWA/S530-E2 (datasheet here).
From the picture above (datasheet) we can make the connection between the arduino pin and display pin- pin 3 arduino(atmega)-LED A(pin 11 of display); pin 2 arduino(atmega)- LED B(pin 7 of display) etc. and for to light up the digit from the right(digit 4) we must put the pin 6 of display to the ground.
These associations are required for the program.
In the pictures below we see the character “b” and number “4”:
The electronic board in the picture is for all 4 digits of display, wich we will discuss later.
The program utilized is here.
This program read the value(character) introduced by us and then in the updateafisaj function is checking if exist a match between the value(character) introduce by us and the values(character) predefined in function and after that it makes all the pins associated with the value(character) HIGH(5V).
This is the basic program for this kind of display.
Please let us in the comment zone any suggestions that you think will improve the article!
If you like the article click the follow button from social media to stay in touch with us!