# Multiplex two I2C ICs into four 7 Segment displays

I currently have two PCF8574AN I2C 8-bit IO expander ICs. Is there a way I could have two seven segments be driven off one IC (So i could run four seven segments displays off the two ICs that I have). I have thought of wiring an extra pin to a transistor which enables and displays each, in turn.

Is there a better way to accomplish this? I could just simply buy two more ICs to run the four seven segment displays(different addresses).

• Something like SAA1064 is a better component for driving 7-seg LED characters. – Nick Alexeev May 7 '13 at 16:11
• @ Nick Alexeev Yes, that would work a lot better but i was trying to figure out a way off using the components I had without buying any new ones. Thanks for letting me know this existed though. – Marmstrong May 7 '13 at 16:15
• Which 7 Segment displays do you have? And you could the segment of all four off one PCF while the other PCF is used to select which digit is used. – Passerby May 7 '13 at 20:01
• @Passerby I have 0.56" common anode seven seg displays. This is probably the best way forward as I could get 8 displays multiplexed together. I would need 8 PNP transistors to switch them though. – Marmstrong May 7 '13 at 20:55

Yes, there is a way to control four 7-segment displays with two PCF8574AN chips.

Nearly all multi-digit 7-segment displays use some kind of multiplexed display. If you have common anode 7-segment displays, you could use something similar to the circuit in Figure 2 of Atmel appnote AVR242:

One PCF8574AN drives the particular segments to light up. perhaps P0 through a resistor to segment a, P1 through a resistor to segment b, ... P6 through a resistor to segment g, and P7 connected through a resistor to the decimal point. (Every "segment a" pin of every 7-segment modules would be connected together, etc). It appears that the PCF8574AN can sink IOL = 10 mA per output pin, so it can directly pull down the low side of those LEDs.

Another PCF8574AN selects the current digit to light up by turning on a transistor connected to the common anode of the selected digit, and turning off all the other digits. It appears that the PCF8574AN cannot source much current IOH, so it needs a transistor to pull up the high side of those LEDs. It looks like almost any logic-level pFET such as VP2106N3-G, a ZVP3306A, TP0610, or BS250P or almost any PNP transistor would work. If for some reason you only had nFETs or you only had NPNs, you could probably figure out how to get that to work.

Those 2 chips could control up to 8 digits. The tricky bit is scanning through the digits rapidly enough to maintain the illusion that all the digits are glowing "at the same time", while also taking care of whatever else your project needs to do.

If you really only need 7 segments (and no decimal point or such), then you could have each PCF8574AN drive a pair of 7 segment displays, one common cathode, and one common anode (some manufacturers build both variants). You could then use e.g. pin 7 as the cathode/anode pin: If it’s 0, an 1 in the other bits will light the corresponding segment of the common cathode display. If it’s 1, a 0 in the other bits will light the corresponding segment of the common anode display.

edit: Hmm, now I think about it, I’m not sure the cathode/anode pin would remain within the current limits allowed by the PCF8574AN, so this method may not actually be safe.

• Adding a pair of emitter followers (one NPN and one PNP) should make it possible for the pin to control the common anode/cathode pin without having to source or sink too much current itself. Alternatively, one could wire an NPN and PNP transistor to operate in saturation mode off the pin. Both transistors will be partially on when the pin is floating, so the PNP should connect only to the common anode, and the NPN only to the common cathode. – supercat May 7 '13 at 17:37