Go Down

Topic: Resistors & common anode 7-segment leds (Read 3704 times) previous topic - next topic

zozefski

Just finished testing a common anode ( common + )  7-segment led and controlling it via Arduino, all works well. I put a resistor between each Arduino pin connected to the pins of the display.
I wonder if it makes a difference if I use 1 resistor on the common anode pin ( cabled to Arduino 5V ) of a 7-segment instead of using 1 for each pin cabled to a digital Arduino pin ?
Would save a lot of work and resistors if it makes no difference ... since I will be ( trying to ) multiplexing 4 or 6 separate 7-segment leds.

Also, what is the best method to keep difference in brightness at minimum ( eg the number 1 is much brighter than number 8 since number 1 uses only 2 segments, 8 uses all 7 ). Would using resistors with a separate 5V line and / or a voltage regulator do ?

Grz,
ucf

Grumpy_Mike

Quote
I wonder if it makes a difference if I use 1 resistor on the common anode pin


Yes it would make a lot of difference, it wouldn't work. Each LED needs it's own resistor because the voltage drop across an LED is not a liner function. It would end up with one LED being bright and the others being dim or off. In other words the current would no be shared out amongst the LEDs.

Quote
what is the best method to keep difference in brightness at minimum

Are the segments different brightnesses or is it the the fact that there are just more segments on. If it is the former then your power supply is drooping and you need one capable of supplying more current.

rFree

I wired up a 7 segment common anode a few days ago, used a seperate [1k] resistor for each segment. My 8 as bright as any other number.

With 1k resistors I am only making a modest power drain on the AVR though.

TBAr

#3
Jun 17, 2009, 09:02 am Last Edit: Jun 17, 2009, 09:04 am by TBAr Reason: 1
I have the same non-uniform display problem with an 8x8 LED matrix. Is there any solution to this problem when I only have 8 cathode pins and 16 anode pins for 64 LEDs? It's a 2 color matrix, but I'm only using one color.

I'm driving it with a version of the playground's DirectDriveLEDMatrix software. The software is fine, but the LED intensities are non-uniform with a 220 ohm resistor on each of 8 anode pins. They're actually off by a lot for columns with 8 LEDs lit compared to one LED lit.

Here's the circuit diagram for the matrix if it helps. http://www.flickr.com/photos/39541970@N06/3635103150/

I'm hoping for a software PWM solution of some kind? I can deal with complex code or pseudo-code, no problem.

Grumpy_Mike

Quote
They're actually off by a lot for columns with 8 LEDs lit compared to one LED lit.


That sounds like your power supply or your column drivers not being able to supply the current.

It's ok posting a picture of the matrix but what is important is how you are connecting this to the arduino. Can you post that?

TBAr

#5
Jun 18, 2009, 09:12 am Last Edit: Jun 18, 2009, 09:22 am by TBAr Reason: 1
Fair enough.  Here's the circuit: http://www.flickr.com/photos/39541970@N06/3638159546/sizes/o/

All the Arduino pins are manipulated with digitalWrite()

[edit]The PDF data sheet for the matrix is at http://www.sparkfun.com/datasheets/Components/SanYoung-Medium-RG.pdf.[/edit]
Thanks for taking a look at it for me.

Grumpy_Mike

Right I see you problem. There isn't enough output current capability to drive this many LEDs directly from the Arduino.
Say pin 10 is high and 3 to 9 are low, then the number of LEDs on is determined by the state of the pins attached to the resistors. Each LED takes about 14mA so potentially pin 10 is being asked to supply 8 * 14 =  112mA. This is too much. The maximum current you can source is 40mA which means no more than 2 LEDs can be supplied with current.

Also trying to draw so much current from an output will damage it.

What you need are some high level current drivers for pins 3 to 10. Either a PNP transistor or a P-channel FET rather like the circuit I used in my mini monome:-
http://www.thebox.myzen.co.uk/Hardware/Mini_Monome.html

TBAr

Thanks, Grumpy_Mike. As soon as I read your first reply to me, I realized it would end up something like that. I appreciate your analysis and the details in the link you gave.

Grumpy_Mike

OK on a closer look you also have the thing connected the wrong way round. To turn on an LED you need Pin 11 high and Pin 10 low. That means the resistor is restricting the current to all the LEDs. This will also affect the brightness depending on how many LEDs are on at one time. This probably protected your output pins from damage.

Solution swap the lines that contain the resistors (put them on pins 3 to 10) and put the current drivers on pins 11 to 19.

fubbi

Hi

I have some common anode 7segment displays. I want a few segments to just be on permanently.

So i connect the anode to 12v in this case, and then I ground the respective segment.

My questions:

I guess I need a resistor, but I would have to add it on on the cathode side, is that okay? (12v -> segment -> R -> GND)

And for the one digit I want to control with the arduino, do I write a HIGH to turn it off and LOW to turn it on? (I am not bothering with a shift register, its just one display and it gets it's own arduino anyway)

Thank you!

fubbi

Groove

Quote
And for the one digit I want to control with the arduino, do I write a HIGH to turn it off and LOW to turn it on?

Not if the anode is connected to 12V, no, don't do this.
You'll need a transistor in there.
Per Arduino ad Astra

fubbi


Grumpy_Mike

Quote
I need a resistor, but I would have to add it on on the cathode side, is that okay?


yes that is fine.

Go Up