Can you use an NPN transistor to control a 3.3v curcuit with a 5V control signal?

A place to hang out and chat with other like minded tinkerers

Moderators: phalanx, TS-Tim

Post Reply
jgold
Posts: 4
Joined: Sun May 28, 2017 11:08 am

Can you use an NPN transistor to control a 3.3v curcuit with a 5V control signal?

Post by jgold » Tue Oct 31, 2017 9:55 am

I have a Sparkfun RGB rotary encoder that I'm hooking up to an Arudino Nano. The blue and green LEDs run at 3.3v. The red led runs at 2. I figured I could run the LEDs directly off of the 3.3v line.

Since the LEDs are common anode, I need to switch them on by raising a control pin on the Nano. Basically this would mean I'm using a 5V signal pin hooked to the base of the transistor to control a 3.3V circuit. All the examples I've seen do the opposite. They'll use the lower voltage circuit to control the higher voltage one. Will it work in the other direction?

User avatar
darrellg
Posts: 294
Joined: Fri Oct 17, 2014 10:02 am
Location: Southern California

Re: Can you use an NPN transistor to control a 3.3v curcuit with a 5V control signal?

Post by darrellg » Tue Oct 31, 2017 11:34 am

LEDs always require a current limiting resistor. I suggest you read this Sparkfun tutorial: https://learn.sparkfun.com/tutorials/li ... iodes-leds.

You can connect the LEDs directly to the Nano without a transistor. For the 3.3V LEDs, use a 180ohm resistor in series with the LED. For the 2V LED, use a 330ohm resistor in series with the LED.

jremington
Support Volunteer
Posts: 2107
Joined: Fri Jun 15, 2007 9:41 pm
Location: Eugene, Or

Re: Can you use an NPN transistor to control a 3.3v curcuit with a 5V control signal?

Post by jremington » Sun Nov 05, 2017 8:34 pm

Will it work in the other direction?
Yes, you can apply any positive voltage (greater than 0.7V and within reason) to the base of an NPN transistor, as long as the base resistor is chosen to limit the base current to a safe value. For that safe value, see the transistor data sheet.

Post Reply