Switching 12v lights with 3.3v

I'm looking to switch a set of LEDs (think vehicle tail lamps) from a 3.3v pin on an XBee or perhaps later an Atmega (also at 3.3v). Each of the LED lamps should be under an amp @ 12v. Logic level mosfets seem to be popular, like the IRLZ24, but even these seem to require 5v to get full saturation.

I'm looking to independently switch on and off 4 different sets of lights. Right now my project already has 3.3v and 12v power available. Which would make more sense? - 3.3v to a mosfet that is fully operated by 3.3v. (exist?) - 3.3v to a small transistor to switch 12v to a mosfet to switch the lights. (most parts, but seems most likely) - 3.3v to a transistor that can switch the lights directly. (possible?) - 3.3v to 5v via single direction level shifter, to logic level mosfet. (would require adding 5v regulator just for the shifter, but could handle all 4 in one chip)

They will all work apart from the first one. I don't know of a 3V3 mosfet. I would go for:-

3.3v to a small transistor to switch 12v to a mosfet to switch the lights.

On the grounds:- a) it is a mosfet so minimum heating on the power switch. b) if you have to shift the gate signal why not do it so you can user cheaper mosfets.

So, something like this?

Assume all grounds are connected. Assume LED assembly already contains resistors, etc.

Which transistor would work? Would a 2N2222 be ok? Which mosfet would work? Would an IRF510 be ok?

Edit: Doing some more reading, this looks wrong. Emitter follower and all that. I'll see if I can figure this out.

Edit 2: After looking through the forums, I found a circuit like this:

This circuit should accomplish what I want, except I'll have to hold the output pins high to have the lights off. I imagine this is fine, except in my head it "feels" wrong. Like I'm wasting power or wearing out outputs since these lights will be off 99% of the time.

Yes that last circuit is right.

except I'll have to hold the output pins high to have the lights off.

Yes you do that's the way electronics works.

This circuit should accomplish what I want, except I'll have to hold the output pins high to have the lights off. I imagine this is fine, except in my head it "feels" wrong. Like I'm wasting power or wearing out outputs since these lights will be off 99% of the time.

If you only want the LED to be on when the arduino output pin is high, then try a modification on the first circuit. Delete the 100 ohm resistor, and try a 5-10k resistor in the second resistor position. The 2N2222 transistor should be ok. The IRF510 may only be rated low on current depending on how much the LEDs draw. Note, I haven't tried this setup, but I'd give it a shot to see if it works. Also make sure the grounds are common

5.6A, 100V, 0.540 Ohm, N-Channel Power MOSFET

If you only want the LED to be on when the arduino output pin is high,

Absolutely no point, you are not wasting electricity it is the way it works.

then try a modification on the first circuit.

No matter what you do with the first circuit you will never be able to switch 12V with it because it is an emitter follower and so the voltage on the emitter can never be greater than 3V3 - 0.7 = 2.6V. This is not enough to turn a FET on.

The IRF510 may only be rated low on current depending on how much the LEDs draw.

That sentence makes no sense at all.

Thanks for the verification, I’ve set up the circuit today and it works as expected. I tested with a RBBB running 3.3v instead of my XBee, since I fried one the other day and I don’t know why. I won’t be using them when moving/testing/rearranging my circuits until everything else is proven.

Also, I read that mosfets can be ran in parallel. If I find myself needing to switch a little more than my mosfet can handle, could I connect each gate, drain, and source, or is this bad? Everything is well under my mosfet’s limit, but I was curious. I’ve heard people ask about running voltage regulators and such like that, but it usually doesn’t work the way you’d expect.

Absolutely no point, you are not wasting electricity it is the way it works.

Well, if his arduino loses power or resets, his LEDs may well fail to the "on" condition. Not sure if this would be important to him or not. Not exactly "fail safe". Edit: Make that xbee or what ever is suplying the 3.3v

No matter what you do with the first circuit you will never be able to switch 12V with it because it is an emitter follower and so the voltage on the emitter can never be greater than 3V3 - 0.7 = 2.6V. This is not enough to turn a FET on.

When the NPN is turned on, it should provide a flow path for the 12v to the gate, possibly charging it to ~11v. Bottom line, either it will work or not. ;)

That sentence makes no sense at all.

It is probably poorly phrased, with the intent to make the point that the MOSFET is only rated at ~5a, which may be marginal for use with automotive lighting setups. As to your not understanding the statement, well you met my expectations on that point. :)

When the NPN is turned on, it should provide a flow path for the 12v to the gate, possibly charging it to ~11v.

No do some research into how things work.

As to your not understanding the statement, well you met my expectations on that point.

Sure I am well known for not understanding things. :P

could I connect each gate, drain, and source, or is this bad?

Yes this is fine, FETs will happy share current, transistors will not.

Ok, I have a new problem. When I designed this, I was only thinking about using discrete lights. It looks like I'll need to use some light assemblies that have a couple different lights in them (running lights and brake lights, running lights and blinker) but they are all common cathode. Since I'm switching the grounds with my mosfet, this won't work.

Can I just replace my N-channel mosfet with a P-channel and move the light assembly to between the drain and ground?

Can I just replace my N-channel mosfet with a P-channel and move the light assembly to between the drain and ground

You can but then you need to supply the FET with a gate voltage that is the same as the source to turn it off. As this is up at 12V and the arduino will only give 5V you need a transistor to generate a 0 to 12V output to then feed to the FET.

I see. So something like this, but replace T2 with my P-Channel mosfet?

(image taken from http://www.winpicprog.co.uk/pic_tutorial_extras.htm)

Yes that sort of thing. You don't need R3 if the gate / source rating is over the 12V. In fact with this arrangement (without R3) you have no need to use a logic level FET and a normal gate turn on voltage device will work.

Thanks! I'll give that a go and see how it works for me.

Got the parts in and tested, works as expected. Thanks Grumpy Mike. I wish I could go to the UK just so I could shake your hand (or buy you a beer).

(or buy you a beer)

Let's ope you make it some day ;)

Grumpy_Mike:

You noted in a previous posting that you can parallel MOSFETs (ie, connect the gate, drains, and sources together) to achieve a higher current rating, and everything would be find - but that you couldn’t do this with transistors.

What, exactly, would happen? Why would this be a bad practice?

For instance, if you took two 2n2222 NPNs, and paralleled their base, emitter, and collector leads - where does the problem lie? Does it have something to do with some kind of load/impedance imbalance or something; perhaps causing oscillation or some other kind of failure mode…?

I have always thought you could do this, but I’ve honestly have never tried, and I would like to learn why (because I know I have recommended it a few times, both here on this forum and elsewhere) so that I don’t repeat the mistake and lead others astray.

Thank you.

:slight_smile:

What, exactly, would happen? Why would this be a bad practice?

Transistor have a negative thermal characteristic, that is the hotter they get the lower the resistance is. Therefore if you have two transistors sharing the current in a load one is going to take ever so slightly more than the other (normal manufacturing fluctuations). However that means that one transistor gets hotter which causes its resistance to drop which causes it to take more current which makes it hotter and so on. You get a situation known as thermal runaway where one transistor is taking all the current and thus blows.

On a FET you have a positive thermal characteristic, the hotter it gets the higher the resistance is. This then cuts back on the current it takes and so cools off. In this way the two FETs effectively balance the current load between themselves.