7-segment display - why NPN for CC and PNP for CA - Page 1
Forum section: electronics / beginners

author: Saimoun
author_rank: Frequent Contributor
timestamp: August 04, 2020, 10:21:13 am
content: HiI am running a 7-segment display from an MCU directly, it is a common anode. The whole thing is running at 3.3V and I am using 10k resistors on the base of the PNP/NPN transistors, and 100 Ohm resistors on each segment.I keep seeing online that you should use NPN for common cathode and PNP for common anode. Is the only reason that with PNP then all pins are active low?Because I tried both PNP and NPN with my common anode and they both work fine (as long as invert emitter and collector, and that my MCU changes from active low to active high on the base pin).Though it seems that with the PNP the display is a little brighter, and I can see a current increase of about 15mA.Does someone knows why and could someone explain the idea behind the PNP for CA and NPN for CC?Thank you!!CheersSimon

author: wraper
author_rank: Unknown
timestamp: August 04, 2020, 10:24:13 am
content: If you use transistor as emitter follower, then you have much higher voltage drop across it.

author: Saimoun
author_rank: Frequent Contributor
timestamp: August 04, 2020, 10:37:51 am
content: Thanks for the reply - so as I understood you are saying that the difference between using PNP and NPN is expected? Can you explain a bit more?

author: wraper
author_rank: Unknown
timestamp: August 04, 2020, 10:56:16 am
content: Quote from: simonlasnier on August 04, 2020, 10:37:51 amUnless you can pull base voltage above positive rail (NPN) or below GND (PNP), you won't be able to fully saturate transistor when used in common collector (emitter follower) topology.Quote

author: Peabody
author_rank: Super Contributor
timestamp: August 04, 2020, 02:22:44 pm
content: As wraper's drawing shows, the base of an NPN has to be .7V higher than the emitter before any current flows. That means the highest voltage you could supply to the LEDs is 2.6V if you use an NPN on the high side. But if you uses a PNP there, you turn it on fully by bringing the base voltage low with respect to the emitter, and the collector voltage is essentially the same as the emitter voltage, or 3.3V. So generally you use PNP transistors, or P-channel mosfets, on the high side, and NPN, or N-channel mosfets, on the low side. It's easy to bring the base low with respect to the positive rail, or bring it high with respect to ground, and fully saturate the transistor. It's not easy to bring the base above 3.3 or below ground.

author: Saimoun
author_rank: Frequent Contributor
timestamp: August 05, 2020, 09:01:49 am
content: Thanks guys that helps a lot! I have been watching a few videos about transistors trying to understand the idea.I also did a few tests with simualtion software.So as I understood:with an NPN in common collector because of the voltage drop of 0.6V I get maximum 3.3-0.6=2.7V at the LED, which gives a current of 0.7V/100R = 7mA (with a 2V forward voltage LED)with a PNP in common emitter the transistor can be fully saturated so I get 3.3V at the LED, which gives a current of 1.3V/100R = 13mAThough I can see in the simulation software that there is always a small drop, even with the PNP in common emitter. That drop seems to get lower if I change the base resistor from 10k to 1k - which I do not understand...My thinking is:-> let's say beta=hfe is 100, then the base current is 3.3V/10k=0.33mA-> this gives a collector current of 0.33*hfe=33mA, which is a lot larger than the 13mA calculated, so that should be enough to drive the transistor to saturation, no? Can someone explain? Thank you!!Just FYI the schematics:* NPN common collector:* PNP in common emitter:

author: SmokedComponent
author_rank: Regular Contributor
timestamp: August 05, 2020, 01:20:39 pm
content: Gain in BJT datasheets is more like a ballpark value and varies quite a bit (assume it is always a bit smaller).Small voltage drop from emitter to collector in PNPs is always there. Pumping base current hard will decrease it a bit, but small drops like 0.1, 0.2 V can't be avoided. In case of driving individual or a few LEDs I don't think this is problematic and you don't have to use, for example, a P-channel power MOSFET.

author: Saimoun
author_rank: Frequent Contributor
timestamp: August 05, 2020, 03:36:21 pm
content: Ok nice to know thanks - and no it's not problematic at all, I was just wondering