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 ?
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.
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.
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.
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.
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.
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.
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)