# How to drive a 9V common cathode 7 Segment using Arduino and transistors?

I want to make a 4 digit timer with 9V CC 7 segment using arduino. I tried the circuit below to switch the segments.

simulate this circuit – Schematic created using CircuitLab

The segments turns ON with 0V on pnp and 5V on npn transistor, I assumed 5V on PNP would turn the LED off, but it didn't. Is there any way I can switch the segment LED this way?

• 5V at the PNP's input (R1) still means around 7 V across R1, R3 and R4, that is more than enough to keep the PNP on. You would need around 12 V to turn it off completely. – Bimpelrekkie Mar 7 '17 at 14:31
• @FakeMoustache yeah I tried 12V and it made the pnp off. Now How can I change this circuit to work with 5V? – Masoud Mar 7 '17 at 14:34
• Have a look at my answer. – Bimpelrekkie Mar 7 '17 at 14:38

5V at the PNP's input (R1) still means around 7 V across R1, R3 and R4, that is more than enough to keep the PNP on. You would need around 12 V to turn it off completely. –

You need to shift the level for the PNP, like this:

simulate this circuit – Schematic created using CircuitLab

I removed some of the resistors which are not really needed as well.

The base resistors can be a bit higher value as well.

• Use 4.7 k that's a good compromise. 1k is really low, it does not harm anything but the transistors don't need that much base current. 4.7 k with 5 V gives a bit less than 1 mA base current which is more than enough. – Bimpelrekkie Mar 7 '17 at 14:43
• But how is this being extended to drive a four digit 7 segment display? Presumably Q2 will carry the current for all seven segments, in which case 1mA of base current might not be enough for the minimum $h_{FE}$. – Finbarr Mar 7 '17 at 16:14
• It says 30 mA, so beta can be about 30 and Ib will still be enough. I expect beta to be more than 100 for a 2n2222 btw. – Bimpelrekkie Mar 7 '17 at 16:21
• I read that as 30mA per segment, in which case surely there's up to 210mA through Q2? – Finbarr Mar 7 '17 at 16:25
• Yes @Finbarr you are right each segment consumes 30mA so the total current for number 0 would be 210 mA on Q2. – Masoud Mar 7 '17 at 16:40