How to use a 7 Segment LED

After a nice fella on this forum room guided me to the right direction on how to use this beautiful device.

if you are like me totally newbie to the world of electronic then this is the right place to start.

Please feel free to correct me if I am wrong in explaining this process.

basically if you want to experience with 7 Segment LED depending on what type you have got , the middle pin is positive
The device has 10 pins arranged in 2 rows of 5 pins at the top and bottom of the display. The middle pin of each row is an anode (positive) pin. We can choose which one of these to use. This is a common anode display. That means that there is one anode. To light up a segment we connect its cathode to a digital pin and drive that pin low, grounding the circuit. To turn off a segment, we drive its cathode high.

this is my first time doing something like this so feel free to improve

connect your pins like I have making sure the middle pin is connected to 5v pin on arduino , the way you can tell if the device is facing the correct way is the little dot near the conner of the device

once you connected your pins on the bread board then connect all your remaining pins from 11 all the way down to pin 4

copy this code in the new sketch for testing

int ledpins[] = {4,5,6,7,8,9,10,11};

void setup()
{
for (int i =0;i<8;i++)
{
pinMode(ledpins*,OUTPUT);*
_ digitalWrite(ledpins*, HIGH);_
_
}_
_
}_
void loop()
_
{_
_
for (int i =0;i<8;i++)_
_
{_
_ digitalWrite(ledpins, LOW);
delay(500);
digitalWrite(ledpins, HIGH);
delay(500);
}
}
I hope the above helps :slight_smile:



*_

You need the resistors in each cathode drive line!

(Not in the common anode.)

220 ohm will do.

Here is something that might help ... And remember to put resistors before the L.E.D's like the previous post said ...

sa05-11ewa_7segment_display_common_anode.pdf (226 KB)

sc05-11ewa_7segment_display_common_cathode.pdf (226 KB)

Yes get the resistors right. If you want to display numbers on it then this is what to do:-
http://www.thebox.myzen.co.uk/Tutorial/Arrays.html

Hi,
A shift register, for example the very cheap SN74HC595N may help a lot to handle a single 7 segment LED.
Max7221 or 7219 for 4 digit 7 segments are good choices. Neither have PWM, by the way, but intensity can be adjusted by resistors (in different way for each IC).
Imho direct drive of LEDs with Arduino is the first thing to learn, and the next to forget for ever.

Max7221 or 7219 for 4 digit 7 segments are good choices. Neither have PWM, by the way, but intensity can be adjusted by resistors (in different way for each IC).

Get your facts straight please.

HC595 can accept PWM on its output enable pin to control brightness. If more than 70mA total is needed for the display (say 20mA/segment, 140mA total if all segments are on) then TPIC6B595 and cd74ac164 are better choices. A resistor per segment is needed.

MAX7219 & MAX7221 both intensity control registers. 1 resistor is needed to set the overall max brightness used for any LEDs connected.

CrossRoads:
HC595 can accept PWM on its output enable pin to control brightness.

Hi,
Thanks for the correction.
I've spent hours to find trustable sources to properly use HC595, none of them ever mentioned PWM output. Of course, my sources may be wrong.
So, how can I do that? May I ask you to suggest a source, please?
Thanks in advance.

Does this make it more clear?

CrossRoads:
Does this make it more clear?

Absolutely yes, thank you.
Tried that, works fine.

Wow , so many responds to this , I am sure many newbie are going to find this tread useful , Thank you once again guys

Really owe you a pint or so 8)

I am sure many newbie are going to find this tread useful

Maybe - I am sure we will see the same question again next week 8)