Pages: [1]   Go Down
Author Topic: Resistors & common anode 7-segment leds  (Read 3385 times)
0 Members and 1 Guest are viewing this topic.
Ghent, Belgium
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34567
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: June 17, 2009, 02:04:16 am by TBAr » Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34567
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: June 18, 2009, 02:22:15 am by TBAr » Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34567
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 388
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34567
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

berlin
Offline Offline
Full Member
***
Karma: 0
Posts: 154
fubbi.com
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

UK
Offline Offline
Faraday Member
**
Karma: 17
Posts: 2884
Gorm deficient
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Per Arduino ad Astra

berlin
Offline Offline
Full Member
***
Karma: 0
Posts: 154
fubbi.com
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

of course! thanks!
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34567
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

yes that is fine.
Logged

Pages: [1]   Go Up
Jump to: