Should i use a diode to protect an IC from transistor passing high voltage

Hi!

Sorry that this question might be a little basic, i'm relatively new playing with these things.

So, yesterday i was hooking up my atmega168 to control a led strip running off 12 volts. To do this i'm using a relatively standard NPN transistor to allow the current from the led strip to pass to ground.

Would you generally use a diode to protect the IC from the possibility that the transistor might short and allow current to pass through the collector back through the base?

I've heard that MOSFETS have the potential of doing this, but considering that the current in that case can be bigger it might be more relevant to protect more than just an IC.

First of all the MCU pins already have diode protection...

Adding a diode would be unusual. If you feel you MUST add some sort protection when using a mosfet then add a low value resistor in the range of 180 to 220 ohms in series with the pin and it will help protect the MCU from out of the ordinary conditions. The base resistor on a BJT scenario is already protecting the pin from excessive current.

If you take the time to understand how a NPN is used to switch the LED strip on and off, you would understand that the 12V from the LED would not reach the base pin. (unless you have some sort of really bogus transistor)

Thanks!

I already have a resistor in series to limit the current to be within the rating of the transistor.

I guess i just thought that transistor short was as pretty common issue. And i was thinking that a 12v load would surely destroy my chip.

It might even be true that the resistor i'm using would actually bring the voltage down to a manageable level, but i can't image how i would calculate the circuit impendence through a pin on the IC. I suppose, as you're saying, it has an internal protection diode, it'll be infinite up to a specific voltage and or current trying to pass backwards into the pin. I'll have to look into the datasheet to see if there are any ratings specified.

Logic level mosfets can drive a reasonable length of common 12volt LED strip to maximum brightness.
A "relatively standard NPN transistor" (whatever that is) might have a high saturation voltage.
Especially darlington transistors. Hot transistors and dim LEDs.

A mosfet should have a pin>gate resistor to limit switch currents. 220ohm is ok.
And a 10k resistor from pin to ground, to prevent floating pin problems during bootup.

Common 12volt LED strips have three LEDs (and a CL resistor) in series.
There will never be more than 3-5volt on the negative terminals, not counting some leakage current.
Leo..

Wawa: yeah, i'm only driving 12 leds (4 strips) with my transistors, one transistor for R,G and B respectively. I made sure to look up the ratings for the transistors and the LED to ensure that the current draw would be within reasonable limits. I remember even measuring the actual current with my multimeter.

I started with a mosfet but decided to downsize as the mosfet appeared to be overkill in the particular case. (price difference is quite noticeable when you're using three)

Thanks for the 1k resistor pull down suggestion. I'll make sure to add that to my circuit to minimize potential problems.

I might post my project when it's finished to have people look at and criticize it.

I'm not sure what you mean with your last paragraph.

autious:
I made sure to look up the ratings for the transistors and the LED to ensure that the current draw would be within reasonable limits.

Staying in the current limit given in the datasheet is one thing. But that doesn't mean the transistor can't get to hot... Or, as told, the suturation voltage might me pretty high and you will have dimmer leds. If the transistor drops a volt the strips only get 11V now...

autious:
I started with a mosfet but decided to downsize as the mosfet appeared to be overkill in the particular case.

When controlling led strips mosfets are rarely overkill... You might used an overkill mosfet but a mosfet is a good choice when controlling multiple leds.

Right of course, you make a good point.

I'll make sure try and stock up some suitably sized mosfet for future projects.

In this case i don't believe a voltage drop by 3-4 volts should be a problem as i've been testing the circuit with 9volts with good results.

AOI514 from digikey works well
http://www.digikey.com/product-search/en?keywords=aoi514
I use 32 of them on this board for things like driving LED strips
Shift in 4 bytes, control 32 high current outputs.

With 9V to a 12V strips there is not much brightness left for the green end blue then. Not to mention that the red will be brighter because of the lower voltage drop of the leds. So with a 3V drop on the transistor you mess up the equalness of the brightness...

Not to mention you're wasting a pretty deal in heat in the mosfet.

That's a really cool board you have there. Makes me curious about its details.

Septilion: Right, gotcha.

I think i might start digging through my boxes to see if i have some mosfets to replace these transistors with.

Make sure the MOSFTETs have Logic Level gates - the parts will turn on fully with 4.5V or less on the gate, vs Standard parts which need 10V to turn on.

I have noticed in datasheets that some parts claim to have Logic Level gates - but only for extremely low current levels, well under a 1mA. The better parts will have low Rds listed at Vgs = 4.5V with high currents.

Example, data for the AOI514:
Static Drain-Source On-Resistance, VGS=4.5V, ID =20A: 8.5 typ 11.9 max mOhm

pwillard:
First of all the MCU pins already have diode protection…

Adding a diode would be unusual. If you feel you MUST add some sort protection when using a mosfet then add a low value resistor in the range of 180 to 220 ohms in series with the pin and it will help protect the MCU from out of the ordinary conditions. The base resistor on a BJT scenario is already protecting the pin from excessive current.

Actually it isn’t - if you have the transistor fail with a base-collector short, you have 7V across 200 ohms, ie 35mA
is available to burn out the protection diode, and burn out it will. (They typically are rated about 1mA sort
of level continuous). You may also be pushing the whole chip towards CMOS latch-up which you really
don’t want.

If you take the time to understand how a NPN is used to switch the LED strip on and off, you would understand that the 12V from the LED would not reach the base pin. (unless you have some sort of really bogus transistor)

If the load isn’t inductive and you have a reasonable ratio between transistor voltage rating and 12V, you’ll be
fine. For 12V a 30V transistor would be good (in fact most have higher ratings). One way that
will easily blow a transistor is taking the base-emitter junction reverse biased by more than a few volts,
but most circuits don’t have that risk.

Scroll down 1/2 way, there are some video clips of the board in action
http://www.crossroadsfencing.com/BobuinoRev17/
and the board schematic.

One has to consider the amount of current that can be back
fed into the arduino.
Just a diode will be of little good as a short to the base to collector
could feed more current onto the arduino board than it normally
uses. This will cause the voltage supplying of the arduino
to go up until something on the board fails, as the power is now
coming from the short, not the on board regulator.
You have to think in terms of current. You must use a resistor of
size enough that if it were powering the processor and such on the arduino
that it would not excess normal VCC voltage.
Hope that is making sense.
Dwight

The diode would be in series with the base resistor, preventing any current flowing backwards.

[ which assumes a BJT of course ]