Kris38
Posts: 2
Joined: Mon May 11, 2015 5:19 pm

Do I need an additional transistors for 7 segment display?

Thu Dec 17, 2015 6:42 pm

I've been tinkering with common anode LED 4 digit 7 segment display with success, but one thing bothers me - I know I should use a transistor to drive the common anode pin of the display, because you shouldn't use GPIO pins to drive large current consuming things, but what about using transistor on the individual segment pins, if I use 5V to drive the display?

Here's the simplified version with only one digit:
Image

The GPIO far to the right when switched high, powers the base of the NPN transistor through 10k ohm resistor, which passes through 5V to power the common anode of the display. Then I set low appropriate other GPIOs to turn on respective display segments (connected throught 330 ohm resistor).
But, I read somewhere, that you shouldn't connect 5V to 3.3V GPIO pins. That means, shouldn't I also use transistors to drive the individual segments? And, isn't that too much for the raspberry pi, to sink 72mA if all segments are turned on? (7 segments + dp, 9mA through each, which gives us 8*9mA=72mA). The documentation says that the total current sink/draw from all GPIOs shouldn't exceed 50mA.

And sorry for all stupid mistakes and assumptions I might have done there, I'm newbie at electronics ;]

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12010
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Do I need an additional transistors for 7 segment displa

Thu Dec 17, 2015 7:17 pm

sounds like you are using the NPN transistor as emitter follower, and because you never put more than 3.3V on the base the emitter will never rise above 3.3 - 0.6V = 2,7V, so no 5V will reach the other GPIO's. Still potentially there might go something wrong. To make it somewhat safer you could place a 3V9 zener between the common anode and GND, so the voltage on the common anode can never rise above 3,9Volt..

Return to “Automation, sensing and robotics”