MOSFET Circuit for voltage selection - Page 1
Forum section: electronics / beginners

author: tzikis
author_rank: Newbie
timestamp: July 05, 2023, 01:55:45 am
content: Hello everyone! I am working on a design (quite the noob tbh 😁), and I'm stumped so I figured someone here might be able to help. I'm creating a voltage output selector but I'm constrained by this cheap SPDT switch that I need to use, that only allows 300ma through it, and I have 1A.I figured I'd build this MOSFET circuit (using DMP2240UDM) to have the switch control the mosfets and the current go through them, but it doesn't work cause when I enable the 5V line, the 3.3V line MOSFET seems to be still "closed" and so I get 4.5v out (and possibly some magic smoke if I keep it running) 😬I believe this is due to the built-in zener diode, since Vds is 1.7V (5-3.3v) so that would forward bias the zener. But1. This circuitlab simulation shows the same problem, even though there's no Zener diode in the MOSFET model2. Nothing I can do about it as far as I can tell, since these diodes are built into the MOSFETs anywaySo, any ideas? 😁 Thanks in advance!

author: fourfathom
author_rank: Super Contributor
timestamp: July 05, 2023, 02:56:56 am
content: If that FET on the 3.3V line is actually passing significant current when "off", then I don't understand that. But make sure you have ay least a light load on the common point (where the voltmeter is connected.) Those FETS will have a leakage of some microamps when off, and your high-impedance voltmeter may be measuring this. Put a 1K Ohm resistor to ground there and see what happens.Also, that FET may require more than 3.3V to turn on -- check the specs.

author: ArdWar
author_rank: Frequent Contributor
timestamp: July 05, 2023, 03:08:38 am
content: Either you put diodes in series with the PMOS, or use back-to-back PMOS to prevent reverse current.Quote from: tzikis on July 05, 2023, 01:55:45 amPick better PMOS. DMP2040 or something similarQuote from: fourfathom on July 05, 2023, 02:56:56 amEh, it's just the body diode conducting.

author: fourfathom
author_rank: Super Contributor
timestamp: July 05, 2023, 03:43:09 am
content: Quote from: fourfathom on July 05, 2023, 02:56:56 amEh, it's just the body diode conducting.I don't think so.I will admit that I sometimes confuse myself with PMOS devices, but that body diode is reverse-biased in this application. Are you claiming that you can't turn off a PMOS switch without adding other stuff? If I'm wrong I sure want to hear about it!

author: ArdWar
author_rank: Frequent Contributor
timestamp: July 05, 2023, 04:24:30 am
content: Quote from: fourfathom on July 05, 2023, 03:43:09 am

author: Kim Christensen
author_rank: Super Contributor
timestamp: July 05, 2023, 04:26:58 am
content: Quote from: fourfathom on July 05, 2023, 03:43:09 amHe is right. Looking at the 1st diagram:When Q1A is on (Switch 2-3 contacts closed) then there is 5V at the output (BUS1_A)This means that Q1B's body diode is forward biased and will feed that 5V (minus the diode drop) into the 3.3V supply.

author: tzikis
author_rank: Newbie
timestamp: July 05, 2023, 04:40:48 am
content: Yeah, I think ArdWar has the right solution there, and the circuitlab.com seems to agree. Even though their symbol doesn't have a body diode, it seems to behave like it has one, and as soon as the output voltage at the Drain start being 0.7V higher than the Source, it starts dropping the voltage. I tested it by changing the 3.3v source to, and as long as it was higher than 4.3, everything was fine, but it started conducting below that.The only difference is, I would need 3 MOSFETS back-to-back instead of 2 for the 1.7V (5V-3.3V) Drain-to-Source voltage differential, and ArdWar's design had it on the right (5V) side, whereas it needs to be on the left (3.3V) side.I'm attaching what seems to work, at least on the simulation.Wow, thanks everyone!

author: Kim Christensen
author_rank: Super Contributor
timestamp: July 05, 2023, 05:27:13 am
content: Try this with M3 drain<-->source flipped from your diagram:

author: tzikis
author_rank: Newbie
timestamp: July 05, 2023, 05:51:46 am
content: Ah, right-o! Interesting! Yeah that seems to work on the simulations.I'm curious though, when the switch is in the 3.3V position, does the current go through the Source-Drain of M3, or through the built-in diode? Cause I thought under normal operation Vsg needs to be positive? So if that's the case and current goes through the diode then it couldn't handle 1A?

author: Kim Christensen
author_rank: Super Contributor
timestamp: July 05, 2023, 05:57:48 am
content: I did a small modification to my diagram. Moved R4 pullup to the +5V rail.When switch is in 3.3V mode, M2 turns on and the diode in M3 conducts raising it's source terminal to 2.6V. But because M3's gate is also grounded via the switch, then M3 also turns fully on raising it's source terminal to near 3.3V.Note: You need different P-FETs for this project. Ones that are spec'd for a lower (3.3V gate source) RDS on than the IRF9530.

author: tzikis
author_rank: Newbie
timestamp: July 05, 2023, 06:03:45 am
content: Ah, I see!In terms of the MOSFETs, you're right. IRF9530 is just what that online thingy uses. My actual schematic on the first post and real-life board uses DMP2240UDM with a Vgs(th) of -1. I'll check out the DMP2040 that ArdWar mentioned tomorrow too

author: fourfathom
author_rank: Super Contributor
timestamp: July 05, 2023, 03:27:31 pm
content: Quote from: ArdWar on July 05, 2023, 04:24:30 amOf course! Yes, you are correct, I wasn't considering the 5V to 3V path.

author: gnuarm
author_rank: Super Contributor
timestamp: July 06, 2023, 01:05:05 am
content: Quote from: Kim Christensen on July 05, 2023, 05:27:13 amI'm pretty sure you need to swap the drain and source of M2 and M3. The two source pins should be connected. The transistor is controlled by the gate to source voltage. So with the sources connected, both FETs will see the same gate-source level and turn on together. With them apart, one will always see 3.3V and the other will see what is on the output. Not remotely optimal.

author: gnuarm
author_rank: Super Contributor
timestamp: July 06, 2023, 01:08:12 am
content: Quote from: tzikis on July 05, 2023, 05:51:46 amIn the 3.3V position, both M2 and M3 will be turned on (after changing the circuit so the two sources are connected). There will be no diode conduction.

author: tzikis
author_rank: Newbie
timestamp: July 06, 2023, 04:06:05 am
content: @gnuarm, could you share a schematic of what you're suggesting? I'm not sure what you mean because I can't visualize it.I do believe that Kim Christensen's suggestion makes sense. When setting the Gate of M2 and M3 to ground, The original Vs of M3 is 2.6-2.7V because of M2 is conducting and M3's body diode is now forward biased, so it drops the Vs voltage of M2 from 3.3V to 2.7-2.6V, and since Vg is 0, Vgs is 2.6V for M3, which makes it conduct, and then Vs becomes 3.3V.

author: gnuarm
author_rank: Super Contributor
timestamp: July 06, 2023, 05:10:58 am
content: Quote from: tzikis on July 06, 2023, 04:06:05 amTo be honest, I'm too lazy to draw a diagram. I'm saying that Kim Christensen's drawing is good, but M2 and M3 need to be turned around. The source and drain need to be swapped, so the two sources are connected in the middle, rather than the two drains.FETs are controlled by Vgs, the voltage between source and gate. In Kim Christensen's drawing, the two drains are connected. The Vgs of each FET depends on the voltage on the sources, which are far apart. If the source and drain of each FET is swapped, the Vgs of each one will be the same, as controlled by R4 and SW1. So they will either be both on, or both off.Is that better? Looking at Kim Christensen's drawing, connect the drain of M2 to 3V3 and the drain of M3 to OUT. Then tie the two sources together.Here, I found an image of the FETs. They are N-channel, but that does not matter.

author: Terry Bites
author_rank: Super Contributor
timestamp: July 06, 2023, 01:47:04 pm
content: ErrataRick C. -- Puerto Rico is not a country... It'sbadly treatedpart of the USA- Get 1,000 miles of free Supercharging- Tesla referral code -https://ts.la/richard11209

author: Peabody
author_rank: Super Contributor
timestamp: July 06, 2023, 03:06:26 pm
content: @gnuarm, the instances I've seen of dual mosfet circuits always have the drains connected together. I always assumed, but never researched it, that with the sources connected their voltage was somehow "undefined" except through the body diodes, and it wasn't clear how you would turn them on. The circuit that comes to mind is the DW01 battery protection circuit, which uses dual N-channel mosfets to control the connection between the battery's negative terminal and ground. In that circuit the drains are connected.

author: gnuarm
author_rank: Super Contributor
timestamp: July 06, 2023, 03:44:17 pm
content: Quote from: Peabody on July 06, 2023, 03:06:26 pmYeah, maybe in the end, it doesn't matter, but I've only seen the sources connected. In the diagram below, but with sources tied, when the gates are pulled low, the body diode of M2 will pull the sources up, so both FETs turn on. There may be no voltage on the drain of M3, but that doesn't matter.With the drains tied, M2 source is high, so it will turn on, and the body diode of M3 will conduct to raise the output, which will then turn on M3. So, both schemes work I suppose.