Go Down

Topic: Two seven segment displays (Read 1 time) previous topic - next topic

Ty_Breizh

In another thread, (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1267803389) a member said it would require sixteen pins to interface two seven segment displays to an arduino.

I have two common anode seven segment displays.
If I connect the each display's anode to a digital pin, and connect the cathodes (with current-limiting resistors) of each segment together to another set of seven digital pins, then can I light individual segments by controlling the pinMode and state of the two anode pins (one is HIGH and the other is INPUT) and writing a LOW to a segment pin, so long as I don't exceed the current rating of the two pins?

If I do this fast enough I can multiplex two displays with just nine pins, I think.

I think this will be dim, but possible?

Grumpy_Mike

#1
Apr 01, 2010, 10:21 am Last Edit: Apr 01, 2010, 10:23 am by Grumpy_Mike Reason: 1
Quote
I think this will be dim, but possible?


Yes this is possible. It need not be dim if you make the resistors half the size, LEDs can take more peak current than continuous current. Just make sure you keep within the current limits of the pins.

There is no need to switch the unused connection to an input just put out a logic zero on that pin. Although changing it to an input would work as well.

Ty_Breizh

Wow! Fast answer!

Thank you very much.

Ty_Breizh

Sorry, I have a further question.

If I want to drive all the segments in one display at the same time, can I keep the cathodes connected to output pins of the arduino, but just drive the anode with a transistor (PNP?) rated at least 7 x 20mA = 140mA?
Or do I have to put transistors on the cathodes too?

Grumpy_Mike

Quote
but just drive the anode with a transistor (PNP?) rated at least 7 x 20mA = 140mA?


Yes.

As the individual cathodes only sink 20mA each there is no need to put them through a transistor to keep them within the pin limits.

Ty_Breizh

Thank you so much for your help Grumpy Mike.

I want to eventually build a display with at least 4 digits (maybe 6 or eight), and I worked out that only lighting one segment at a time would mean too much flicker, so I've decided to multiplex the digits.

zink0xide

If you are using individual digit displays (or 2 digit displays) check out SAA1064. It'll do 4 7 segment (to pairs of 2 multiplexed) with an I2C interface. Chip runs about $2-3.

I went with ICM7218A due to having 4 digit 7-segment displays. It's not I2C (so it uses more pins, or a shift register) but it will run 8 digits in any package configuration (assuming segments are multiplexed).

If you're going to skip the chip, the number of pins used will be (No. of Segments) + (No. of Digits). Once (No. of digits) > (No. of Segments) it makes more sense to plex the digits rather than the segments.

By mixing CA and CC displays, I suppose you could charliplex them, further reducing your pins required, but I sure couldn't tell you how to wire something like that up.

Go Up