Driving 2inch 7segment display using pic microcontroller

7segmentdisplay

I want to drive 2 inch 7segment display(common anode) using pic microcontroller.
The forward voltage of segment is around 7v.

The emitter of the pnp transistor is connected to the12v power supply. And collector to the common anode pin of 7segment. Base is connected to the pic output pin via base resistor. The common cathode pins are connected to the serial in parallel out shift register via resistors. I don't have a diagram with me right now, that's why this much explanation.

My question is, can I switch on/off the transistors using 5v out from pic or I need 12v input to make the transistor switch since the emitter is connected to 12v. Because the transistors never goes to cutoff state, always on.

Kindly please give a solution for this…
Thanks

Nikhil.

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

That won't work, in fact it's likely to kill your PIC and maybe other stuff, especially if you don't have a base resistor (as you've shown it). The E-B junction of the transistor will cause the 5V supply to rise to about 11.3V. An older midrange PIC might survive, but I think the newer ones will die for sure.

You need a level-shifting NPN transistor (or MOSFET) as so:

schematic

simulate this circuit – Schematic created using CircuitLab

You could replace Q1 and R1 with a small-signal MOSFET such as a 2N7000 if you like.