Author Topic: MOSFET Circuit for voltage selection  (Read 1241 times)

0 Members and 1 Guest are viewing this topic.

Offline tzikisTopic starter

  • Newbie
  • Posts: 5
  • Country: us
MOSFET Circuit for voltage selection
« on: July 05, 2023, 01:55:45 am »
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. But
1. This circuitlab simulation shows the same problem, even though there's no Zener diode in the MOSFET model
2. Nothing I can do about it as far as I can tell, since these diodes are built into the MOSFETs anyway

So, any ideas? 😁 Thanks in advance!
 
The following users thanked this post: DarkMode

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 1889
  • Country: us
Re: MOSFET Circuit for voltage selection
« Reply #1 on: July 05, 2023, 02:56:56 am »
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.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 
The following users thanked this post: tzikis

Online ArdWar

  • Frequent Contributor
  • **
  • Posts: 374
  • Country: sc
Re: MOSFET Circuit for voltage selection
« Reply #2 on: July 05, 2023, 03:08:38 am »
Either you put diodes in series with the PMOS, or use back-to-back PMOS to prevent reverse current.

...I have 1A.

I figured I'd build this MOSFET circuit (using DMP2240UDM)
Pick better PMOS. DMP2040 or something similar

If that FET on the 3.3V line is actually passing significant current when "off", then I don't understand that.
Eh, it's just the body diode conducting.
 
The following users thanked this post: tzikis

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 1889
  • Country: us
Re: MOSFET Circuit for voltage selection
« Reply #3 on: July 05, 2023, 03:43:09 am »
If that FET on the 3.3V line is actually passing significant current when "off", then I don't understand that.
Eh, it's just the body diode conducting.
[/quote]

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!
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 
The following users thanked this post: tzikis

Online ArdWar

  • Frequent Contributor
  • **
  • Posts: 374
  • Country: sc
Re: MOSFET Circuit for voltage selection
« Reply #4 on: July 05, 2023, 04:24:30 am »
I will admit that I sometimes confuse myself with PMOS devices, but that body diode is reverse-biased in this application.
 
The following users thanked this post: DarkMode, tzikis

Offline Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1359
  • Country: ca
Re: MOSFET Circuit for voltage selection
« Reply #5 on: July 05, 2023, 04:26:58 am »
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!

He 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.
 
The following users thanked this post: tzikis

Offline tzikisTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: MOSFET Circuit for voltage selection
« Reply #6 on: July 05, 2023, 04:40:48 am »
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!
 

Offline Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1359
  • Country: ca
Re: MOSFET Circuit for voltage selection
« Reply #7 on: July 05, 2023, 05:27:13 am »
Try this with M3 drain<-->source flipped from your diagram:
« Last Edit: July 05, 2023, 05:51:48 am by Kim Christensen »
 
The following users thanked this post: tzikis

Offline tzikisTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: MOSFET Circuit for voltage selection
« Reply #8 on: July 05, 2023, 05:51:46 am »
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?
 

Offline Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1359
  • Country: ca
Re: MOSFET Circuit for voltage selection
« Reply #9 on: July 05, 2023, 05:57:48 am »
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.

« Last Edit: July 05, 2023, 03:12:07 pm by Kim Christensen »
 

Offline tzikisTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: MOSFET Circuit for voltage selection
« Reply #10 on: July 05, 2023, 06:03:45 am »
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
 

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 1889
  • Country: us
Re: MOSFET Circuit for voltage selection
« Reply #11 on: July 05, 2023, 03:27:31 pm »
[a diagram showing the current path]
Of course!  Yes, you are correct, I wasn't considering the 5V to 3V path.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2227
  • Country: pr
Re: MOSFET Circuit for voltage selection
« Reply #12 on: July 06, 2023, 01:05:05 am »
Try this with M3 drain<-->source flipped from your diagram:

I'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. 
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2227
  • Country: pr
Re: MOSFET Circuit for voltage selection
« Reply #13 on: July 06, 2023, 01:08:12 am »
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?

In 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. 
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline tzikisTopic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: MOSFET Circuit for voltage selection
« Reply #14 on: July 06, 2023, 04:06:05 am »
@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.
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2227
  • Country: pr
Re: MOSFET Circuit for voltage selection
« Reply #15 on: July 06, 2023, 05:10:58 am »
@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.

To 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. 
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2413
  • Country: gb
  • Recovering Electrical Engineer
Re: MOSFET Circuit for voltage selection
« Reply #16 on: July 06, 2023, 01:47:04 pm »
Errata
Rick C.  --  Puerto Rico is not a country... It's badly treated part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2027
  • Country: us
Re: MOSFET Circuit for voltage selection
« Reply #17 on: July 06, 2023, 03:06:26 pm »
@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.
 

Offline gnuarm

  • Super Contributor
  • ***
  • Posts: 2227
  • Country: pr
Re: MOSFET Circuit for voltage selection
« Reply #18 on: July 06, 2023, 03:44:17 pm »
@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.

Yeah, 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. 
Rick C.  --  Puerto Rico is not a country... It's part of the USA
  - Get 1,000 miles of free Supercharging
  - Tesla referral code - https://ts.la/richard11209
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf