I need a normally closed nch mosfet with a level shift, better option than this? - Page 1
Forum section: electronics / beginners

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 26, 2024, 04:07:33 pm
content: https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWcMBMcUHYMGZIA4UA2ATmIxAUgpABZsKBTAWjDACgBncGmkFBQn3x8BUMQDMAhgBsODNgDdwxFOAyCwK8GFVUqNKjrF7oCNgCcQ2NNtXXDW-RngW+GO9kGZVBvbWdwrmh4Il7uoWJgLuJWNpp2hCHxseCmULAobDHefHgh9rn5qmBpMJCZSnhUBVURfgZW0PR+MGaWNGAa6rTEXYJUlIEA5laJfCi8niETLWwA7rGGRsmsuvOLbnZxjmwjBb4bHf1Q6wVnNri8kKdjKBOj08LXC1NqgkdvJyMr3SuOXyBajVqp5jOtavwNEZIScFjkDvs4LDDkjznp1jlsKCcig8sicXicaJrkoELi+A0yUluvUBsZ0mYRlSKQNyTD0QsaL1PsywDT1mAeBFVnU2AAjWhIkUIGhFCDXAAeVlI2ggsogrF4vHuABEGAoAJYAY3kStl5BQoIQYGm2GItApFAAamwlShWNx7fxyGAyQ77joXUqokgUMQNda+MQtY7sE7sOKQIRtfd3RBPPbFSAsON6DppkR-bwALZGgCubCAAAt 12V power up, I have a device with an internal 5V pullup that needs to be grounded, until my micro boots up and decides to unground it.However, I won't have 3V3 to my micro until after the 5V needs to be grounded. So simply, I need a normally closed switch to it that my micro can "open". That switch and pullup to the lower mosfet comes from my micro.The most obvious solution to me was a normally closed switch with a normally open switch. I do not need fast switching, anything under 100us is fine I'm sure.My 2x mosfet package is like 1.5x1.5mm and 10 cents or so. I just need to know if I'm making a bad move here. I considered a Pch Nch, but couldn't really figure it out and decided that I already have two Nch packages in the BOM. So... That makes sense to re-use them I think.Am I on a good path?

author: schmitt trigger
author_rank: Super Contributor
timestamp: August 26, 2024, 04:28:20 pm
content: A depletion mode Mosfet will be fully on with zero bias.

author: bson
author_rank: Unknown
timestamp: August 26, 2024, 05:31:45 pm
content: Is it a 5V supply or a 5V enable signal? If it's an enable signal on a logic input you can almost always drive it directly with a 3.3V logic output and don't need to fuss with level shifting. Exceptions usually involve clock inputs on crystal pins, and various other rather "special" cases.For a supply rail, use a 5V regulator with an enable/shutdown input and connect that to the 3.3V logic output.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 26, 2024, 07:43:13 pm
content: Quote from: bson on August 26, 2024, 05:31:45 pmIt needs to be grounded at power up. But I don't have the micro at power up. It's an enable, but only exists for a window for 60us or so, but a hundred miliseconds before my micro boots. So it needs to be normally closed and my micro can open it and reboot the device to check again, now open.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 26, 2024, 08:28:10 pm
content: Quote from: schmitt trigger on August 26, 2024, 04:28:20 pmRight, so I had thought about that, but those are pretty rare and I wasn't able to find one in the right size or cost range.The smallest I was able to find was SOT-23 which is too large. If it saved room of resistors that might be a trade-off, but my inclination is it's too large.

author: BrianHG
author_rank: Super Contributor
timestamp: August 26, 2024, 08:44:43 pm
content: Use a single gate version of an and gate 74ACT/HCT08. A SN74AHCT1G08.https://www.digikey.com/en/products/detail/texas-instruments/SN74AHCT1G08DBVR/276757Tie VCC to 5v.Tie a cap from 1 input of the AND gate to GND with a 100k pullup resistor to 3.3v or 5v.Tie your MCU IO to the other AND gate input.Tie the AND gate output to your destination.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 26, 2024, 10:36:52 pm
content: Quote from: BrianHG on August 26, 2024, 08:44:43 pmI'll look at some gate options, but this isn't it. The 5V is only active for 60us as a test. There is a 3V3 and 5V source available, but neither are available during the the power up phase when this internal 5V needs to be grounded by an external normally closed circuit.If I could ground out the 12V gate enable on the first Nch with my micro it would be fine, but I can't, so that is where there is that second low side switch.

author: Benta
author_rank: Super Contributor
timestamp: August 26, 2024, 10:52:01 pm
content: Just use a MC34064 or MC34164 or any other MCU reset device. Cheap and easy.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 26, 2024, 11:19:18 pm
content: Quote from: Benta on August 26, 2024, 10:52:01 pmThanks, but I don't see how that would work. I have 12V and need to ground a 5V signal before my 3V3 micro spools up.

author: Kim Christensen
author_rank: Super Contributor
timestamp: August 26, 2024, 11:49:03 pm
content: Does the 12V supply feed a regulator that gives you the 5V and then the 3.3V?If so, you could do something like this, which is basically the same as what you had. It would also work with NPN transistors with a few changes:

author: Benta
author_rank: Super Contributor
timestamp: August 27, 2024, 12:24:07 am
content: Quote from: NaDobraNich on August 26, 2024, 11:19:18 pmLike this, perhaps? It'll pull down your 5 V device until the MCU outputs 3 V. Dunno why you keep on about 12 V, I see no connection to the issue at hand.

author: ArdWar
author_rank: Frequent Contributor
timestamp: August 27, 2024, 01:48:11 am
content: For most purposes MC34164 should suffice. Assuming you aren't doing something weird with your supply power up sequencing.If you really need it to be completely glitch free you need something depletion mode. MAX16162 also usable here but as usual with them it's neither cheap nor jellybean.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 27, 2024, 05:06:28 am
content: Quote from: Benta on August 27, 2024, 12:24:07 amOk, makes sense on those reset controllers.I am talking about 12V, because and this is the reason I do nothing those reset controllers will work is that at this point in power up, I do not have 3V3 or 5V. At all. Neither. I have 12V. That’s all. I wouldn’t mention it over and over if I had 5V available.The 5V signal I have is a 5V 5K pull-up from inside a device. It is internally regulated and I don’t have access to a 5V source. This is before my regulator is active.Usually this signal is held to ground with a jumper. But for me, that will mess me up later when I want it unjumped as a decision at the micro.

author: magic
author_rank: Super Contributor
timestamp: August 27, 2024, 06:43:22 am
content: Your circuit should be OK provided that the second FET turns on before the 5V device does. The 1K doesn't even seem necessary.It may also work with NPNs.Depletion N-ch FETs require negative gate voltage to turn them off (and keep them that way), it would be tricky and maybe not worth it.editWhat's the logic threshold of this enable input, how low is low enough to keep the device from starting?

author: ledtester
author_rank: Super Contributor
timestamp: August 27, 2024, 08:22:15 am
content: Will the MC34164 work even when the MCU_Out pin is Hi-Z?The OP said something about not having 3V3 to the micro until after the 5V needs to be grounded.

author: Benta
author_rank: Super Contributor
timestamp: August 27, 2024, 10:38:42 am
content: Quote from: ledtester on August 27, 2024, 08:22:15 amJust place a pull-down.The other option is to connect the MC34164 to 3.3 V instead the MCU output.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 27, 2024, 04:31:58 pm
content: Quote from: Benta on August 27, 2024, 10:38:42 amI'm sorry, have I been unclear? I can't figure out how to explain this any differently... THE 3V3 SOURCE DOES NOT EXIST AT THIS TIME IN THE CIRCUIT. THERE IS NO 3V3 OR 5V0 WHEN THE DEVICE'S 5V PULLUP NEEDS TO BE GROUNDED. I feel like I've had to explain this at least three times now.I'm not being a jerk, I just thought it was clear but many people didn't get it.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 27, 2024, 04:34:47 pm
content: Quote from: ledtester on August 27, 2024, 08:22:15 amRight, that was my concern. This is why I picked a discrete solution at first.

author: Kim Christensen
author_rank: Super Contributor
timestamp: August 27, 2024, 04:41:02 pm
content: I think your original idea, with two MOSFETS, will work OK since the 12V supply powers everything. (5V and 3.3V are derived from the 12V)Use logic level MOSFETs that'll turn on before the 12V rises more than 2-3V and before the 5V & 3.3V regulators, that are internal to the mystery device, output any voltages at all.

author: MK14
author_rank: Super Contributor
timestamp: August 27, 2024, 05:32:20 pm
content: What about this circuit?https://tinyurl.com/2yyqmtj2

author: BrianHG
author_rank: Super Contributor
timestamp: August 27, 2024, 06:24:38 pm
content: What's wrong with a 10uf cap to GND?Powers up shorted to GND.Can later be driven high or low, albeit at a reduced rate.

author: MK14
author_rank: Super Contributor
timestamp: August 27, 2024, 06:48:09 pm
content: Quote from: BrianHG on August 27, 2024, 06:24:38 pmNot necessarily, if the power is rapidly cycled quickly, off and on. The (unspecified) device, may stay enabled, if the lone capacitor, doesn't have a quick discharge route.Without knowing what the (unspecified) device is, it is difficult to judge how much that matters.

author: bson
author_rank: Unknown
timestamp: August 27, 2024, 07:13:08 pm
content: Quote from: NaDobraNich on August 26, 2024, 07:43:13 pmSo a pull-down?It would help to actually see a schematic here...

author: BrianHG
author_rank: Super Contributor
timestamp: August 27, 2024, 08:03:06 pm
content: Quote from: MK14 on August 27, 2024, 06:48:09 pmAdd a Schottky diode from supply to the cap's output. The cap will drain on power loss or even a transistor with a series cap to it's base with diode designed to short the cap to GND if the power supply sees a tiny ripple drop of 0.7v. Basically a brown-out detect.

author: MK14
author_rank: Super Contributor
timestamp: August 27, 2024, 08:33:41 pm
content: Quote from: BrianHG on August 27, 2024, 08:03:06 pmIf you just have the Schottky diode, and the 12 volt supply, leisurely drops to perhaps 3 volts (possibly held up by capacitors, which may be on the supply rails), as the power turns back on, it would probably stay enabled.If you put in extra circuitry to detect and handle brown-outs, then you might as well use one of the other solutions, in this thread, which does away with that capacitor, in the first place, and perhaps needs less components, and less cost, overall, maybe?.But, you could do it your way.

author: MK14
author_rank: Super Contributor
timestamp: August 27, 2024, 08:40:16 pm
content: Quote from: bson on August 27, 2024, 07:13:08 pmIf I understand things correctly, so far, that wouldn't work. Because the MCU only has 3.3 Volts to pull it back up to the original (internal to the unknown sensor?), 5 Volt supply, shown on the original diagram in the OP.But, 3.3V could be enough, since we are unsure of what the (Unknown) things specifications are.

author: Benta
author_rank: Super Contributor
timestamp: August 27, 2024, 08:59:30 pm
content: Quote from: NaDobraNich on August 27, 2024, 04:31:58 pmYou haven't been unclear, but you also don't understand the MC34164 (or other reset devices).If you connect the input to the 3.3 V supply, its output will be grounded until that supply comes up. Result: the 5 V circuit is connected to ground through the diode.When the 5 V supply comes up, this will still be the case.Only when the 3.3 V supply rises to over 3 V will the grounding be turned off.

author: Kim Christensen
author_rank: Super Contributor
timestamp: August 27, 2024, 10:49:00 pm
content: Quote from: Benta on August 27, 2024, 08:59:30 pmI don't thinkthat'llwork Benta:EDIT: Maybe it'll work because of the MC34164's internal diode between reset and Vin... Hmmm... Depends on the other circuitry loading the 3.3V rail and how much current the reset pin must sink via that internal diode.

author: Benta
author_rank: Super Contributor
timestamp: August 27, 2024, 11:04:58 pm
content: Quote from: Kim Christensen on August 27, 2024, 10:49:00 pmThe diode has to sink ~1 mA according to the OP's schematic (5 kohm), which is no problem.But if the OP insists on absolute 0 V instead of 0.5 V, well...The MC34164 and other reset circuits still seem to be a mystery.Hint: they're all designed to keep an ouput low (reset) until power is available.

author: Kim Christensen
author_rank: Super Contributor
timestamp: August 27, 2024, 11:52:09 pm
content: Quote from: Benta on August 27, 2024, 11:04:58 pmNo real mystery to me. They are essentially a comparator with built in voltage reference and have an open collector output.The problem arises when we don't power the comparator+reference and expect the open collector transistor to be turned on at the same time. This is not a typical use case for these devices.It may or may not work as intended in that configuration.

author: BrianHG
author_rank: Super Contributor
timestamp: August 28, 2024, 01:21:27 am
content: Why not a simple NPN 2N3904 transistor with it's base tied to the +12v through a 10k resistor.Emitter to GND.Collector output - the 5v pullup IO pin.At powerup, there will be a tiny 0.5v glitch while the 12v power supply is still below 1v. That glitch can only be there is if his pin with the 5v pullup already at least 1v across it's power supply. However I sincerely doubt it since it's 5v regulator hasn't supplied any power out yet unless it is a 0v dropout regulator. (Damn, I wish one of those actually existed...)For the MCU' control, feed that output through a 10k resistor to the base of a second 2N3904.Emitter to GND.Collector to the base of the first transistor.Done, 2x 1cent NPN transistors + 2 resistors, total, 2.2cents solution.Cheap and small.

author: MK14
author_rank: Super Contributor
timestamp: August 28, 2024, 01:48:43 am
content: Quote from: BrianHG on August 28, 2024, 01:21:27 amAs already suggested, many posts before, here:https://www.eevblog.com/forum/beginners/i-need-a-normally-closed-nch-mosfet-with-a-level-shift-better-option-than-this/msg5620373/#msg5620373

author: Benta
author_rank: Super Contributor
timestamp: August 28, 2024, 10:41:11 am
content: Quote from: Kim Christensen on August 27, 2024, 11:52:09 pmThat's why the diode is there, and it's exactly what the device is made for.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 28, 2024, 03:42:22 pm
content: Quote from: MK14 on August 27, 2024, 05:32:20 pmSo... I know, I'm very dumb. HOWEVER... Please help me explain how that isn't a bad idea. How would that not backfeed a pulled up 12V0 in to my 3V3 supply via the micro. A double bad idea as it looks to me.

author: MK14
author_rank: Super Contributor
timestamp: August 28, 2024, 03:48:19 pm
content: Quote from: NaDobraNich on August 28, 2024, 03:42:22 pmThe idea is that the grounded transistors emitter/base junction diode, will firmly hold the MCU's I/O pin, between ground and around 0.7 volts, with the available current into that diode, limited by the 47k Ohm resistor (possibly needs to be a modest amount lower), which won't pass much current, at 12 Volts.Also, the 47k Ohm resistor, even if the transistor's EB junction diode was open-circuit, would limit the current to quite small amounts, so that in theory, the MCUs own protection diodes, may be able to intervene.But you are right, and better protection, may be needed, depending on your application, which doesn't seem to be mentioned, so far.EDIT:On further reflection, you are right.I agree, you shouldn't do it that way.As the (unspecified) MCU, is likely to have a datasheet I/O max input (when its supply = 0 Volts), of around 300millvolts to 500 millivolts, on many MCUs.So, the 0.7 Volts, would be too high.It could be probably resolved by using more components, such as a second transistor, or something.

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 28, 2024, 03:54:52 pm
content: Quote from: MK14 on August 28, 2024, 03:48:19 pmOk, that's kind of what I thought (giving myself too much credit). I wouldn't want to rely on the mcu's protection. Also, maybe I've overly sensitive, but I'm not sure I want to design specifically for a circuit that a bad part destroys other parts. I know that is unavoidable sometimes, like, "oh, you NEED this diode here!!" but I'm not sure I want to go in with this intention.Thanks for explaining that!

author: Kim Christensen
author_rank: Super Contributor
timestamp: August 28, 2024, 03:56:20 pm
content: Quote from: Benta on August 28, 2024, 10:41:11 amAccording tothe datasheet:Quote

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 28, 2024, 03:58:36 pm
content: Quote from: Benta on August 28, 2024, 10:41:11 amOK! Took me a little while to get there and I was following Kim Christensen. I see what you're saying. Ultimately I don't think this is the route I want to go. Aside from the cost of a reset controller, I wasn't able to find one that isn't EOL, cheap, fit my space limitations, and was available with at least one pin compatible part alternative.However... I will say, this is an application I knew nothing about and must give you credit for applying a reset controller to a non-reset circuit. I'm not sure I want the RESET/OUTPUT to follow the voltage of the input, but maybe it wouldn't, IDK. Doesn't matter now.But I appreciate your posts about it.

author: MK14
author_rank: Super Contributor
timestamp: August 28, 2024, 03:59:15 pm
content: Quote from: NaDobraNich on August 28, 2024, 03:54:52 pmSorry, in the mean time, I changed my mind:Quote

author: NaDobraNich
author_rank: Regular Contributor
timestamp: August 28, 2024, 04:06:50 pm
content: ALL: I'm a moron!So... TURNS OUT... My 5V0 and 3V3 outputs as confirmed with a scope are actually coming upbeforemy device trigger's it's internal 5V pullup test. I thought otherwise because I have a separate issue. HOWEVER... I still can not rely on the micro because I might hold that in reset, or not have firmware loaded on it, or be in a different state than one that can control this pin needed. So my good scenario here is only a side effect of something else, and while I can rely on it here (I have a 1-4 millisecond window I'm OK with) this might not have been the case and I would need at least a double low side switch like I posted or any of the other probably better options you guys have mentioned.Practically, I still need a normally connected switch to hold the 5V pullup line low, and the MCU can defeat that later. In this case, a 3V3 gate pullup on my single mosfet gate seems to work.I'm having a separate issue and after exhausting my own reasoning I might make a post about that.I still learned a bunch here, so thanks!

author: MK14
author_rank: Super Contributor
timestamp: August 28, 2024, 04:14:05 pm
content: Ideally/hopefully, there is some kind of resistance value (possibly specified in the datasheet for the device), that will 100% reliably disable (pull it low, as already mentioned, by at least one other poster), such as a 1 k Ohm resistor, to ground (higher would be even easier to overcome, such as 10k Ohm), that enable line.I.e. A pull-down resistor (to ground), so it always defaults to disabled, until the MCU is ready to enable it, if it wants to.Then all you have to worry about, is a simple mechanism, for allowing the MCU to enable it, at some future point. Which can be done in a way, to minimize risk of the MCU seeing voltages outside its voltage supply pins.Trying to actively pull it low with active stuff, when you are uncertain about the state of the various supply voltages, would be a much harder problem to solve.

author: bson
author_rank: Unknown
timestamp: August 30, 2024, 07:46:13 pm
content: Quote from: NaDobraNich on August 28, 2024, 03:42:22 pmUse the MC34164-3, which is a 3.3V supervisor.Connect its RESET# output to the MCU RESET# input without anything else, no RC delay circuits or other cruft. A 3.3V logic output can be connected directly to a 5V logic input.If you need a reset hold, put it on the input pin of the supervisor. Or if it's controlled by a 3.3V MCU have that MCU control it, in which case you need a weak pull-down on the supervisor input pin.