Switching A Choice Of Supply Voltage: pesky body diodes - Page 1
Forum section: electronics / projects

author: leonerd
author_rank: Regular Contributor
timestamp: December 11, 2016, 07:28:13 pm
content: I'm trying to design a power supply control circuit that can enable either 3.3V or 5V onto an output bus, at currents up to a few hundred mA. My initial approach is to use two p-Channel MOSFETs, so as to avoid the Vce drop associated with a BJT. Having found a nice p-FET with a sufficiently low R and threshold voltage (a DMG2305UX starts to switch at a mere 0.8V) I came up with the attached circuit. But it has a problem...When the EN_3V3 signal is low and EN_5V is high, it turns on Q1 and the output sees 3.3V as required. All good there.When EN_5V is low and EN_3V3 is high, this turns on Q2 and presents 5V on the output line. But this puts 1.7V (5 - 3.3) "backwards" across Q1, and its body diode conducts it backwards, pushing that current backwards into the output of the 3.3V regulator that was creating it. Not cool.What can I do to avoid this?I could use a PNP instead of a p-FET for Q1, but that would incur a ~0.7Vce voltage drop on the output, which is quite a drop from a 3.3V supply. I'd prefer to stick with some sort of FET ideally.Anything cunning I can do with an n-FET instead? Or as well, in series perhaps?(p.s. don't pay attention to the pin numbers in the circuit diagram here; I just picked some random symbol from KiCad and I don't think it's right for my transistor. The actual circuit had them round the right way)

author: Benta
author_rank: Super Contributor
timestamp: December 11, 2016, 07:54:24 pm
content: QuoteThe saturation voltage of a suitable BJT would be below 100 mV.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 11, 2016, 08:25:19 pm
content: If the voltage only ever needs to be +3.3V or +5V, and the +5V supply never needs to be disabled (i.e., so that V(+5V) < V(+3.3V)), then use a pair of N channel (you need high side drivers for both), or P and N, in either case making a half bridge.If you want the output to be able to go to zero as well (or any of the input supplies to go to zero), you need to use a tri-level or multi-level bridge design. To use MOSFETs as switches, you need to connect a pair in anti-series (source to source). The gate drive for an antiseries pair is referenced to the source pins, so you need isolated or floating or bootstrapped gate drive.There used to be "analog switch" type BJTs, which had nearly symmetrical junctions. I don't think they were ever made with much power (like, maybe 200mA max Ic), but the neat thing is, a symmetrical BJT doesn't care which side you call the emitter: if you source current into the base, and sink it out one terminal or the other (which, if that happens naturally because your load can sink it, great; but for analog switch applications, you might want a precision source AND sink to deal with it), the C-E pathway is simply conductive, no matter which direction you measure it in!Still, you might get away with some modern BJTs. "Low Vce(sat)" types, like the ZTXxxx and PBSSxxxx series, have quite useful inverted hFE (i.e., hFE when using the collector as the emitter). The "inverted collector" voltage limit is still low (Veb, about 5V), but would be adequate here.Assuming you can handle a modest base current demand to keep it biased.Tim

author: leonerd
author_rank: Regular Contributor
timestamp: December 11, 2016, 10:53:26 pm
content: Quote from: T3sl4co1l on December 11, 2016, 08:25:19 pmWell, either 3.3V or 5V or off. That's an option too. I suppose switching to N FETs and having a charge pump of some kind for a high driver may be better here.Quote from: T3sl4co1l on December 11, 2016, 08:25:19 pmThe supplies are basically "permanent"; being the system 5V source and the output of a 3.3V regulator chip.The anti-series arrangement doesn't look too bad. E.g. some examples I see onhttp://www.electronic-products-design.com/geek-area/electronics/mosfets/using-mosfets-as-general-switchesandhttp://www.cnblogs.com/shangdawei/p/3279563.htmlThere seems to be two variations here - those connected source-to-source and drain-to-drain. Is there much to distinguish the two in practice? I don't need a "true" bidirectional switch; I know in my case which side has permanent power and which is the switched side. In the source-to-source approach, do I understand correctly that the inherent body diode is providing some voltage to the common rail between the sources, so that's where the gate feed resistor goes, whereas in the drain-to-drain case we can bias the gates from the permanently-supplied source feed?I've adjusted my schematic - the 3.3V side is now switched by source-connected back-to-back pair Q1 and Q2, with Q3 bleeding the gate voltage from it to switch them on when enabled from its active-high input, EN_3V3. This looks like it should probably work, as Q1 will still block the current flow back in when the output is switched to 5V, even though the body diode in Q2 will conduct it.(I can't yet try this circuit out for real on a board, because I've only got 1 breadboard-capable MOSFET currently; my SOT-23 to DIP adapters have yet to arrive in the post)(Edited: remember to actually attach new schematic)

author: leonerd
author_rank: Regular Contributor
timestamp: December 11, 2016, 11:29:27 pm
content: Ah, also a little more hunting around now I have better search terms leads me to this question on electronics.SE:http://electronics.stackexchange.com/questions/150076/select-power-supply-voltage-using-mosfetsAppears to be basically the same situation I'm in, and leads to the same suggested fix, of two back-to-back FETs

author: Benta
author_rank: Super Contributor
timestamp: December 11, 2016, 11:44:00 pm
content: I can only repeat my earlier answer:QuoteDon't complicate things.

author: robertbaruch
author_rank: Regular Contributor
timestamp: December 12, 2016, 12:04:03 am
content: You could use a relay

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 12, 2016, 12:28:01 am
content: You can take some shortcuts on the gate driving, depending on voltages. With nice and low supply voltages, and not much difference between the supplies, you can kinda-sorta treat them as "UP" enough to turn on P-channel FETs. Or, if you create a modest boost supply (say +10V or so), N-channel FETs.Because of the body diodes, the source voltage (for source-to-source transistors) can't be more than a diode drop below the +3.3V (meaning, for the circuit as shown, Vgs(on) won't be smaller than -2.6V or so). Likewise, it can't be more than a diode drop above +5V (say 5.6V), and as long as the pull-up is towards source, or towards the higher of the two voltages (+5V), or more, you're fine.2.6V isn't much for gate drive, but, the supply isn't much, either; you can buy MOSFETs with Vds <= 20V which have comparable drive requirements. They're also available up to many amperes, so -- although you won't be pulling one of these parts out of your junk box, they're no 2N7000 -- you can very easily buy a part that will do as much of the job as you need.If you use drain-to-drain connection, the two gates sit on top of different source voltages (except when on), so you need twice the drive circuitry. This can still happen to be the same voltages, given similar consideration (i.e., if N-channel MOS were used, you could simply drive both gates to +10V and get guaranteed conduction; or to 0V for guaranteed insulation).If the supplies did need to drop out (like the 3.3 and 5V supplies were independently controllable), you could simply use two back-to-back pairs. Also, if the load should be able to go to zero, but it doesn't need to bepulled to zero, then from the half-bridge (or multi-level bridge) basis, you can replace the bottom (to-GND) transistor with the load's own resistance. (Handy, right?)Tim

author: leonerd
author_rank: Regular Contributor
timestamp: December 12, 2016, 01:13:01 pm
content: Quote from: T3sl4co1l on December 12, 2016, 12:28:01 amOh that's fine - I have some DMG2305 p-Channel FETs for this job. My Peak Atlas measures a Vgsof 0.8V to create an Idof 2.5mA. The 2305 calls itself a "logic-level FET", designed for low gate voltages like this. I'm sure at 2.6V it will conduct just fine, at least enough to pull the full 3.3V onto its source, which will help. I'm only switching a few hundred mA (I only have that much available from USB anyway), so the 100mOhm RONshould be fine.Only trouble with it is that it's only a SOT-23, no TTH equivalent available, so I'm still waiting for a breakout board to experiment with it on my breadboard.

author: leonerd
author_rank: Regular Contributor
timestamp: December 12, 2016, 01:15:31 pm
content: Quote from: robertbaruch on December 12, 2016, 12:04:03 amI could. I almost considered it. I also almost considered a low-dropout BJT.While technically fine and workable, I don't feel I'd reallylearnanything from those solutions. They're not as much of a challenge as this new technique of learning how to use a source-to-source FET pair.If this was the sort of project where any boring solution that has to work is fine, then yes I'd be looking at a small relay. But it isn't. It's as much of a learning and experiment project, as it is aiming at getting a useful product at the end.

author: Skashkash
author_rank: Regular Contributor
timestamp: December 12, 2016, 01:49:53 pm
content: It is a boring solution , but there are integrated high side drivers with reverse current protection (and current limiting) that are usually used to switch USB voltages. Lots of choices there. I've used them as general purpose high side switches.Hmmm, looks like they also have p-fets with isolated substrates to allow reverse blocking.http://ww1.microchip.com/downloads/en/DeviceDoc/mic94050.pdfMight be closer to the solution you are looking for.(edit for a typo)

author: leonerd
author_rank: Regular Contributor
timestamp: December 12, 2016, 02:37:19 pm
content: Quote from: Skashkash on December 12, 2016, 01:49:53 pmOoh yes that looks another great component there. The data sheet even has some examples very similar to my use-case, switching between multiple different power supplies at different voltages.I was just thinking that "if only a four-terminal FET with a separate substrate connection was available" - well here one is. And the MIC94051 variant even has the integrated source-gate pullup resistor as well, further reducing my part count.That looks like it could be a winner there.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 12, 2016, 04:11:10 pm
content: Wow, isolated substrate. I wonder how long those'll be around!Tim

author: leonerd
author_rank: Regular Contributor
timestamp: December 12, 2016, 10:17:08 pm
content: Quote from: T3sl4co1l on December 12, 2016, 04:11:10 pmIs that particularly rare then?I don't care for this particular project as it's mostly a one-off - if I find they become unavailable in a few years time I won't be too upset. But useful to know in general...

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 12, 2016, 11:37:16 pm
content: Four-pin MOSFETs -- with much smaller geometries, carrying perhaps 10mA tops -- used to be moderately common, used for RF amp and mixer applications.3N136 I think was a classic? -- This was back in the days when your TO-72 metal-can transistor was shipped in anti-static foam, and with a shorting wire wrapped around the leads, because you were lucky to get a MOSFET at all -- let alone one with any kind of ESD protection. You didn't touch that shorting wire until the transistor was soldered into the board!The substrate connection is useful for some purposes, because it modulates the gate threshold voltage. It acts somewhere between: having a second gate terminal in parallel, or having a JFET* in parallel, or adding the substrate and gate voltages together (i.e., offsetting or biasing or superimposing the voltages together).Or if you forward-bias it (not usually recommended, though, I think?), you get BJT action (because D and S are N or P diffusions, and the substrate acts as the base). "Enhancement" mode, you say? Yes, please.*Because guess what a JFET is? A PN junction alongside an otherwise resistive channel!(Speaking of JFETs and enhancement: supposedly, GaAs FETs can be "super-enhanced" by gently forward biasing the gate. This is actually UJT mode operation -- because a UJT is just a resistive channel with a PN junction stuck into it.)There were also dual-gate MOSFETs, which are more like a pair of MOSFETs in cascode connection, therefore having very little capacitance from G1 to D. Lots of gain available that way. The second gate has a multiplying effect, making an RF mixer with low distortion.I think there are single-digit examples of these remaining. I haven't used (or needed) them myself, but they are quite useful for those few applications where they work best.A big power transistor like this, wouldn't be an effective RF amplifier, but the wide channel maybe suggests low noise (audio frequency?) use.The irony is that, independent-substrate transistors are SOP in monolithic circuits -- hence the pervasive use of transmission gates in CMOS logic and analog switches. They're damn rare to find "naked", though!Tim

author: David Hess
author_rank: Super Contributor
timestamp: December 12, 2016, 11:51:04 pm
content: Quote from: Benta on December 11, 2016, 11:44:00 pmI agree. A cheap PNP designed for low Vce saturation will be significantly below 100mV, cost less than a MOSFET with similar voltage drop, cost even less compared to 2 MOSFETs in series, and has simpler drive requirements than the high side drive required to use n-channel MOSFETs. Why make things more complicated than necessary?MOSFETs would be better if maximum efficiency is required at any cost because of their lower power drive requirements but the difference could be 10% or less depending on the forced beta of the bipolar transistor.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 13, 2016, 12:07:07 am
content: Quote from: David Hess on December 12, 2016, 11:51:04 pmFYI, a low-Vce(sat) transistor typically has quite good inverted hFE (I've measured a PBSS4540 at ~150, IIRC), so a "forward bias" base current (a current draw, base to emitter, where "emitter" is determined by "whichever remaining terminal is higher"!), and is quite fine with a saturated (forced) hFE of 50 or thereabouts.They're really quite impressive, and for switching applications, they feel rather more like very leaky, much-higher-gain MOSFETs, than like BJTs as you know them.For a low current application, it would be desirable to have some sort of anti-saturation circuit, so the base current is only what's needed. Most bipolar LDOs have solved this function -- that is to say, the "ADJ" or "GND" pin current doesn't skyrocket when the LDO goes into dropout (saturation). (But it is, by the way, an important property to look for, when you're shopping for LDOs -- because some still do it!)Unfortunately, solving that with discrete circuitry won't be very simple, so I'd definitely recommend PMOS for a low current application. Especially if size constrained.Tim

author: David Hess
author_rank: Super Contributor
timestamp: December 13, 2016, 05:39:49 am
content: Quote from: T3sl4co1l on December 13, 2016, 12:07:07 amI have not played with low Vce(sat) transistors very much. I am usually more interested in fast saturated switching transistors which are rare beasts these days.That the low Vce(sat) transistors have good inverse hfe does not quite surprise me. They used to make "symmetrical" bipolar transistors for chopping applications before JFETs (and they still have some advantages over FETs in some applications) and they had not only equal forward and inverse hfe but also equal Veb and Vcb breakdown voltages which is to be expected from their symmetrical construction. The best low Vce(sat) transistors have a Vcb breakdown voltage approaching their Veb breakdown voltage so their high reverse hfe makes sense.Motorola MMBT404A PNP Chopper TransistorToshiba 2SC2878 NPN Chopper TransistorMotorola Application Note 470 - Bipolar Chopper Transistors and Circuits

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 13, 2016, 08:16:24 am
content: Low-Vce(sat) typesaren'tsymmetrical, though -- Vebo is in the conventional range (~5V) while Vceo is whatever (say 20 to 100V, depending on type).Symmetry is a natural property of both low Vce(sat), and similar forward vs. inverted hFE:A conventional transistor has a heavier doped emitter junction, which gives good forward hFE, poor reverse hFE, and leaves a built-in potential (on the order of 10s of mV) which adds to Vce(sat). (Note the plot of Vce(sat) vs. Ic never drops below there, with most types.) In inverted operation, that potential subtracts instead, allowing inverted transistors to achieve very low Vce(sat) (and symmetrical transistors, nearly as good). Though not less than zero, for obvious reasons.Not sure what they do to make these things. Could be a doping gradient of some sort, maybe. Optimizing base width is definitely important, especially towards maintaining high hFE. (Early effect doesn't look awful, which suggests the base isn't unusually thin relative to its doping level.)While these types aren't really high frequency or anything (the junctions are too wide: too much capacitance for RF preamp service, too little Pdiss for power amp service), they are still capable of switching usefully fast: they can be used on their own for small switching applications, or gate drive emitter followers, pushing 1MHz.My flashlight uses a PBSS303NX at, I think 200 or 500kHz, something like that:achieving around 67% efficiency from a 1.2V NiMH cell.Tim

author: leonerd
author_rank: Regular Contributor
timestamp: December 13, 2016, 01:57:00 pm
content: Quote from: T3sl4co1l on December 12, 2016, 11:37:16 pmSome exciting history there, but I think that's all mostly RF-shaped? Might explain why such transistors don't appear much any more. Whereas, the one we found yesterday - the MIC9405x (I've ordered myself some of the 51 variant; the one with an integrated gate pullup resistor) seem very much aimed at small device power control. The examples in the data sheet seem heavily intended towards low-power battery switching applications. I can imagine that sort of use-case becoming more prevalent over time - everyone seems to be making battery-powered IoT devices lately.

author: leonerd
author_rank: Regular Contributor
timestamp: December 13, 2016, 02:04:46 pm
content: Quote from: David Hess on December 12, 2016, 11:51:04 pmHow will such a transistor cope in reverse-blocking scenario? The double-pFET or the 4-terminal pFET approaches above are specifically designed for exactly this use-case. Will a low-Vce PNP transistor be happy to find a backwards voltage across C-E?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 13, 2016, 05:05:30 pm
content: Quote from: leonerd on December 13, 2016, 02:04:46 pmWith the C-B junction forward biased, the E-B junction is reversed. You're limited by Vebo, usually around 5V.But hey, that's enough for a 3.3V switch!You'd need a specialty transistor, or a back-to-back configuration, if it were much more. Another nice special-case fit!Tim

author: David Hess
author_rank: Super Contributor
timestamp: December 13, 2016, 05:19:44 pm
content: Quote from: leonerd on December 13, 2016, 01:57:00 pm4 lead MOSFETs with a separate body connection are still used for small signal analog switching. Linear Systems makes the 3N163, 3N164, 3N170, 3N171, and 2N4351 but they are small signal devices with the 3N163 being 50mA and 250 ohms so not suitable.A p-channel JFET could be used in this application but the drain resistance would still be too high; incredibly enough they used to make high voltage and high current JFETs but they are long gone. Performance and cost would be better with a bipolar PNP transistor.A p-channel depletion mode MOSFET has the same body diode problem and would cost more than a PNP anyway.Quote from: leonerd on December 13, 2016, 02:04:46 pmThis will only work up to the Vebo reverse breakdown voltage which while relatively low in general purpose transistors, is fine for a 5 and 3.3 volt circuit. RF and some more specialized transistors have a lower Vebo reverse breakdown voltage and will not work for 5 volts. Some transistors, usually PNP transistors but sometimes NPN transistors, have a high Vebo supporting voltages to 15 volts and above.

author: leonerd
author_rank: Regular Contributor
timestamp: December 15, 2016, 11:32:03 pm
content: Update:I've managed some success at this, using a combination of the DMG2305 (that I was previously using) as the 5V switch plus the MIC94051 as the 3.3V switch. The trick seems to be to pull the latter's substrate and gate up to 5V, though the channel normally only conducts 3.3V when it's turned on. This means that when it is off but the 5V channel is on, the substrate is only at the same potential as one end of the channel, so it doesn't conduct at all.I've tested this in practice and it seems to work fine, at least to switch states between off, 3.3V and 5V into the "OUT" line into a 50ohm load. Admittedly I should probably test it at higher current sometime, but don't yet have a suitable load for it - that'll be my next purchase perhaps. When it's on to 5V, it doesn't appear to conduct anything backwards to the 3.3V supply; I can disconnect that and it reads zero there.Below is the schematic of the actual test circuit I used. I think when I make the final version on a board, I'll adjust the resistor values a bit to reduce the BOM count. Probably no need to have a 2M2 here, just reusing the 1M will be fine. The gate does have to be smaller though, 56k here, because it has to overcome the source/gate pullup in the MIC94051. I foolishly bought that variant (the one with internal pullup resistor) thinking it would simplify things where in fact it makes things more complicated. Oops.

author: Circlotron
author_rank: Super Contributor
timestamp: December 15, 2016, 11:34:28 pm
content: Haven't read the whole thread.Does the 3.3V have to be exact?If not, just use a diode instead of Q1 (original drawing) and increase the voltage above the diode slightly to compensate for it's voltage drop.Edit -> that is, if the 3.3V doesn't need to be switched off.

author: leonerd
author_rank: Regular Contributor
timestamp: December 15, 2016, 11:37:19 pm
content: Quote from: Circlotron on December 15, 2016, 11:34:28 pmEh; probably notexactbut I would like it quite close; it's supposed to be an item of test equipment - this is the power supply part of a multi-purpose bench device. I'd like it quite good.Quote from: Circlotron on December 15, 2016, 11:34:28 pmThat was on my list of things to consider, but trying to compensate for the drop as it varies in current drawn would get annoying. This way feels simpler overall - besides, it was a fun learning experience.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 15, 2016, 11:41:29 pm
content: If it's for testing, it probably isn't important that it be highly efficient, or low leakage. Simply putting a power op-amp out there, with a >= 7V supply, and a DAC driving the input, will get you any voltage 0-5V you want.(If not an op-ampIC, then a similar discrete circuit, like a linear power supply regulator/follower.)Or if it does need to be efficient (say if it's dumping lots of amps), a switching supply can serve the same purpose.Tim

author: leonerd
author_rank: Regular Contributor
timestamp: December 16, 2016, 12:42:02 am
content: Quote from: T3sl4co1l on December 15, 2016, 11:41:29 pmAh, yes that's a thought. Rather than a fixed regulator, maybe I could use a programmable source of some kind. That would be more flexible certainly. I don't have an easy plan to actually control the value of it in this design, but I shall keep that in mind for an improved version certainly.

author: David Hess
author_rank: Super Contributor
timestamp: December 16, 2016, 04:47:54 am
content: I have seen the diode compensation method used but there is not much need for it now.Those Micrel/Microchip 4 lead power MOSFETs are pretty neat but practically impossible to find on Microchip's web site. I prefer parts with at least potential alternate sources.I have designed variable supply regulators for micropower applications before where the supply voltage was lowered to save power at lower clock speeds. Some integrated regulators can handle it with a little help but a discrete or partially discrete version is easy enough. For PICs, this almost always came down to maximum supply voltage for the high frequency oscillator and minimum supply voltage for the 32 kHz oscillator which is one of the things I miss in ARM microcontrollers where it all has to be done externally if it is supported at all.

author: leonerd
author_rank: Regular Contributor
timestamp: December 16, 2016, 11:39:07 am
content: Quote from: David Hess on December 16, 2016, 04:47:54 amYes; I understand the concern there. I had that trouble with some oddly-shaped USB connectors once, ended up redesigning a board instead.This is a one-off project for myself though, and I've now bought myself a strip of 5 transistors. I'll only need one or two, so I have spares. If it turns out I can't get them again, I shalln't worry too much.