Fail-safe N-MOS switching - Page 1
Forum section: electronics / beginners

author: DefekC
author_rank: Contributor
timestamp: February 13, 2017, 09:47:49 am
content: This is more of a design question.I need to drive N-MOS "PWM switch" from 3.3V MCU. This MOSFET has Vgs=4.6V (and that is only threshold voltage), so problem should be obvious.Another thing - if MCU or its power supply/regulator fails (MCU_Signal is pulled low or floats),MOSFET should not turn on- this is important!Another thing - I was (kind of) trying to keep possibility of EM emissions as low as possible as all logic stuff will be close to this high power switching part (several of them, actually).This is what I came up with:I am already using 1k, 10k resistors, 22p, 100n and 1u ceramic capacitors, BC847B & BC857B BJTs, PSMN6R0-30YLB and PSMN014-40YS are what I have lying around from other projects (and they are within specs, I guess).So, my question(s):Is this a reasonable design?Is it as safe to use only PNP with pull-up resistor on MCU's I/O (active low) as this PNP-NPN cascade (active high)?

author: danadak
author_rank: Super Contributor
timestamp: February 13, 2017, 11:29:17 am
content: "Is it as safe to use only PNP with pull-up resistor on MCU's I/O (active low) as this PNP-NPN cascade (active high)?"Yes, sort of. If the pullup limits the pin to its injection current max allowed valueit would not hurt the MCU. eg. it has a parasitic diode on its output that wouldturnon at ~ Vdd + Vonparadiode. But the PNP would not turn off as the basewould be clamped at ~ 3.3 + .7 = 4V. So practical answer is NO.To force load switch off when MCU output is tri state, just add a R from base of NPN to ground,one low enough in ohms that leakage x R <= 1 Vbe. But make it high enough so when turnedon by MCU it does not rob much of the current trying to go into base of NPN.To handle case where MCU power out of spec more complicated, in that case I would lookfor an integrated comparator reference kind of part. Or think using a LV zener, that unlessit is biased at a high enough V only leakage flows and cannot turn on a Vbe junction. Not surewhat that would look like, a series Vz from MCU pin to E-B of NPN .....>Lastly you could replace the entire circuit with a intergrated power switch that takes careof all the level translating, and includes thermal protection, short circuit.....Fairchild, Others,http://www.infineon.com/cms/en/product/power/smart-low-side-and-high-side-switches/channel.html?channel=db3a30433dfcb54c013dfda067250219Regards, Dana.

author: Zero999
author_rank: Super Contributor
timestamp: February 13, 2017, 02:05:35 pm
content: This should be better.And please don't use JPG for schematics. It makes them more difficult to edit and the files are larger than necessary.

author: danadak
author_rank: Super Contributor
timestamp: February 13, 2017, 02:40:53 pm
content: Very clever placement of emitter R. Reduces gate drive, but then 7.5V,or there abouts, more than enough to get the MOSFET turned on hard.Still though does not take care of the case Vdd on MCU out of spec.Regards. Dana.

author: DefekC
author_rank: Contributor
timestamp: February 13, 2017, 03:52:19 pm
content: Thanks danadak & Hero999!I will test out proposed schematic changes!Comment on "MCU output spec" and "safety": worst case scenarios on MCU output are brown-out (tri-stated pin) or weekly (few hundreds of k?) pulled-low or pulled-high under normal conditions. Other options (too low, too high voltage or even negative) would mean that device has experienced dramatic general failure I am not concerned about!Basically my concern is more about ensuring clear, very well defined and held MOSFET state under'normal'device operation, including turn-off or restart brown-outs and start-ups, where MCU and/or logic-level power source (3.3V) can be undefined or floating for short moments.danadak gave very clear answer on this one!Hero999:"And please don't use JPG for schematics. It makes them more difficult to edit and the files are larger than necessary."Did not know that. I knew JPEG has'clever'compression algorithms that can result in unnecessary big file sizes, but how it affects editing them? Visuals due to JPEG artifacts (like anti-aliasing and bluriness)? But I'll keep that in mind.Took a look at "smart-switches" and came to conclusion that it is both too expensive and an overkill. My power source will have protection in case of overload/short and it is rated close to consumed power, so I am good there. Temperature protection sounds good though... External component count is not what I am concerned at all.

author: Zero999
author_rank: Super Contributor
timestamp: February 13, 2017, 07:09:28 pm
content: Quote from: danadak on February 13, 2017, 02:40:53 pmThe 100k pull-down resistor, R1, should make sure the MOSFET doesn't turn on, if the MCU's power supply floats.Quote from: DefekC on February 13, 2017, 03:52:19 pmWhat happens if the heater fails to turn off? Is there a risk of fire or someone burning themselves? If so, then there should be some other protection mechanism, as it's possible the MOSFET can fail short circuit or a problem with the MCU making the output high, when it should be low. A thermal fuse could be added for fire protection.QuoteThe problem is the JPEG compression artefacts, which mean that where there should be one solid colour, there are several shades and the lines are slightly blurred.

author: DefekC
author_rank: Contributor
timestamp: February 13, 2017, 09:19:42 pm
content: Quote from: Hero999 on February 13, 2017, 07:09:28 pmYes, there is a possibility of thermal runaway.And yes - thermal fuse is in place.Also heat is constantly measured - if only MOSFET fails (like, because of overheating), MCU can at least warn about situation (piezo-buzzer).There was also one crazy idea I played around in my head: overloading PSU on purpose. Power supply is chosen such that it can handle only one of two heaters on at the same time (there are two different heaters in system, but only one is suppose to work at any given time). By turning on both heaters, PSU trips; after few times (I found that after 3...5 times on average) fuse blows. Really ugly way... and I am still not sure how good idea this is even if it is used as despaired last resort... my intuition says "no", but experiments shows "damn, it works!"Hero999 - I built Your example. Works like a charm!Haven't looked at signals yet (I lend my oscilloscope), but in few days I will be able to do that! I am somewhat worried about emissions & noise that this kind of switching could have on rest of the system...