Go Down

### Topic: Quick query about Common Anode 7 segment displays and transistors. (Read 2429 times)previous topic - next topic

#### tomm

##### Mar 15, 2011, 05:45 pm
I very recently bought an Arduino Uno to brush up my rusty electronics skills, and am starting out with a relatively simple timer project.

I've successfully wired up a common anode 4digit 7segment display to my Arduino and have got it scrolling text, but I've noted that around the web a lot of people are connecting/switching their anodes with transistors. I understand this is to prevent too much current draw on the pins of the Arduino. In my case the draw per segment is only 20mA (and I have resistors on each segment), so as long as I'm only turning one digit on at a time, I shouldn't have a problem?

As I say, my skills are a little rusty, so just need some advice before I'm confident enough to move on with the project.
Regards
Tom

#### Grumpy_Mike

#1
##### Mar 15, 2011, 07:42 pm
Quote
In my case the draw per segment is only 20mA (and I have resistors on each segment), so as long as I'm only turning one digit on at a time, I shouldn't have a problem?

That is right, you seem to be doing well. Cheers.

#### MarkT

#2
##### Mar 16, 2011, 12:02 am
But one digit = 7 segments = 140mA...??
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### tomm

#3
##### Mar 16, 2011, 01:35 amLast Edit: Mar 16, 2011, 01:36 am by tomm Reason: 1

But one digit = 7 segments = 140mA...??

That's what I've seen written in various places around the web.

Correct me if I'm wrong, but with a single common anode digit displaying the number 8 you have your anode pin supplying a maximum of 5V and 40mA to each of the LEDs in the digit (as they are parallel). Each of the LEDs in the digit is wired back to individual pins on the Arduino, supplying a maximum of 5V and 40mA to each pin, as long as you only have one digit on at a time. (In practice a series resistor on each segment reduces these values further.)

As I say, I only have very basic knowledge of this stuff so I may be missing something.

#### Grumpy_Mike

#4
##### Mar 16, 2011, 01:27 pm
The arduino doesn't supply a maximum of 40mA, that is the maximum amount of current you can draw before damaging it. Keeping it down to 20mA is sensible. So yes 7 segments at 20mA = 140mA. This is close to the limit of directly sourcing current through an arduino (200mA total through all the pins).

You MUST put current limiting resistors on each of the cathodes:-

http://www.thebox.myzen.co.uk/Tutorial/LEDs.html

If you want more digits you have to source the current from either the 5V rail or an external supply and control it with an arduino.

#### tomm

#5
##### Mar 16, 2011, 01:50 pmLast Edit: Mar 16, 2011, 01:51 pm by tomm Reason: 1

The arduino doesn't supply a maximum of 40mA, that is the maximum amount of current you can draw before damaging it.

Sorry, that's what I meant when I wrote "supplies a maximum of 40mA", probably should have added "before damaging it", but it was late.

Quote

Keeping it down to 20mA is sensible. So yes 7 segments at 20mA = 140mA. This is close to the limit of directly sourcing current through an arduino (200mA total through all the pins).

As I figured earlier 7 segments at 20mA is fine, as it doesn't exceed each pin limit (of 40mA). I just didn't know that the Arduino has a limit of 200mA total current.

Quote

You MUST put current limiting resistors on each of the cathodes:-

http://www.thebox.myzen.co.uk/Tutorial/LEDs.html

If you want more digits you have to source the current from either the 5V rail or an external supply and control it with an arduino.

I do have resistors on the cathodes otherwise I'd have probably exceeded that total already and blown something up
By more digits, I'm guessing you mean more digits lit simulaneously? Surely I could connect as many digits as I wanted (pins permitting) and continue to turn one on at a time? Obviously if I want more segments, then I'd be close to pushing the 200mA total.

#### Grumpy_Mike

#6
##### Mar 16, 2011, 02:18 pm
Quote
if I want more segments, then I'd be close to pushing the 200mA total.

Only if the all the segments were on at the same time. You can multiplex them, (rapidly turn them on an off) not only to save pins but also to save current. However, multiplexing will make them dimmer and you can have exactly the same effect by dropping the current through the segment. Have you tried seeing how bright they are at 10mA? It won't seem half as bright because the eye has a log response.

#### tomm

#7
##### Mar 16, 2011, 04:14 pm

Quote
if I want more segments, then I'd be close to pushing the 200mA total.

Only if the all the segments were on at the same time. You can multiplex them, (rapidly turn them on an off) not only to save pins but also to save current. However, multiplexing will make them dimmer and you can have exactly the same effect by dropping the current through the segment. Have you tried seeing how bright they are at 10mA? It won't seem half as bright because the eye has a log response.

Yeah, my 4 digit display is multiplexed so i'm already rapidly turning individual digits on and off.

When you mentioned switching down to 10mA you reminded me that all my calculations were done to get 20mA thro each segment, but I didn't have enough resistors near 150ohm, so I ended up using 330ohm resistors instead. So I'm actually drawing nearer 10mA per segment already, and the brightness is fine. So I guess I can run a few more segments (or decimal points) without worrying about the total current draw being exceeded.

Cheers for the advice so far.

Go Up

Please enter a valid email to subscribe