# 7 Segment display driver

I came up with the circuit below to drive a single 7-segment display from an Arduino via a shift register (74LS595). Is the circuit correct/good enough or am I perhaps missing something critical in the design?

• It looks like you are missing the shift register and the Arduino. – Elliot Alderson Oct 6 '18 at 13:10
• Is your 7-segment display common-cathode, common-anode, or single LEDs? – Marcus Müller Oct 6 '18 at 13:22
• Driving only one 7-segment display? Then transistors are overkill. If you shift data into the LS595 fast, the PNP isn't really needed as well (just tie LED anodes to +5V). – glen_geek Oct 6 '18 at 13:53
• The intention is to multiplex four displays using this circuit, selecting the digits using the Arduino and switching the segments via the shift register. It's also about learning transistors and how to use them as switches. – sduplooy Oct 6 '18 at 13:59

It looks good for the most part. It's certainly functional.

There's some things I'd change though, mainly on the pedantic side.

• The 330 Ω between the Arduino & the base could be 2.2 kΩ instead, or even 10 kΩ
• The 330 Ω between the collector and the base could be 2.2 kΩ instead.

This is what I'd do personally because I value efficient/smaller designs:

• All BJT's could be MOSFETs instead, meaning you'll be able to get rid of 8 base-resistors
• Remove all transistors and just use the 74LS595 directly, it can sink 24 mA per pin, which is more than enough an LED needs.

The intention is to multiplex four displays using this circuit, selecting the digits using the Arduino and switching the segments via the shift register. It's also about learning transistors and how to use them as switches.

With this information, I'd do the following:

• Use 4 PMOS so you can select display
• Connect all cathodes of the 4 displays in parallel, so g of display 1 goes to g of display 2 and etc.
• Connect the 7 pins to the 74LS595 with 220 Ω resistors, one per pin.

Or, I'd just get rid of the 4 PMOS and connect the anodes through a 220 Ω resistor to the Arduino and remove the 7 resistors at the cathodes. This however leads to the fact that you will have to cycle through each LED in each 7-segment display. And... maybe I'd just... also remove the 74LS595 and connect it to 7 pins of the Arduino.

To make it crystal clear, this is what I would do:
I'll only show the first 2 LED's. I won't make 4x7=28 LED's.

simulate this circuit – Schematic created using CircuitLab

You select with $$\A_0, A_1, A_2, A_3\$$ and activate one LED at a time with $$\C_0,C_1,C_2,C_3,C_4,C_5,C_6\$$.

• Thank you for the detailed answer and alternatives. I'm curious as to how you calculated 2.2kΩ for the base resistors? – sduplooy Oct 6 '18 at 16:18
• @sduplooy I assume you mean the 2.2 kΩ for your pnp, here's my assumptions: $V_f=2$ V = forward voltage of the LED, current per LED = $\frac{5-2}{220}≃13$ mA. Assuming worst case scenario where you light all 7 LED's up => 95 mA, this is what the pnp will have to source. Assuming a $\beta$ of 200, the base current can be as low as ≃ 500 µA. The $V_{be}=0.7$ is the voltage drop across the base to emitter. So the base resistance can be $\frac{5-0.7}{500µ}=$ 8.6 kΩ. This is with a $\beta$ of 200 though, which might be pushing the limits. But even with 50, you'll be fine with 2.2 kΩ. – Harry Svensson Oct 6 '18 at 17:53
• @sduplooy Just to throw some numbers around, using your two 330 Ω resistors will dissipate $P=\frac{V^2}{R}=2\frac{(5-0.7)^2}{330}≃112$ mW. With 2.2 kΩ instead of the 330 Ω you will dissipate $P=2\frac{(5-0.7)^2}{2200}≃17$ mW. Maybe it's not a big deal to you. But I just don't see any point in wasting energy when it is this useless, it will just heat up your resistors and shorten your battery life, if you power it by a battery. And if you'd go with the schematic I propose, you will be down to around 0-10 mW since you won't be wasting any base current. - But in the end, it's up to you. – Harry Svensson Oct 6 '18 at 18:03

It seems a lot of bother to go to when this chip does probably everything you want: -