To clarify: the body diode behaves a s described above primarily in discrete 3 terminal mosfets:
https://en.m.wikipedia.org/wiki/Power_MOSFET
The behaviour of mosfets in ICs is modified by the voltage applied to the substrate connection. In discrete devices the substrate is always connected to the source terminal.
"What am I missing here?"
The simple answer to your question is that you have swapped the source and drain pin connections.
:)
@andyfierman
Thanks! Yes, it was flipped. ~~One ~~ Two more questions if you don't mind. I am trying to understand the voltage drop over M1. Also trying to understand the whole simulation thing :) I know this is calculated using the RDsON value of MOSFETs and the source voltage. I am using the AO3400 and 3401A as a voltage switch (what I am calling it) but would like to simulate this with their values vs the generic BSS123. Is this possible? How does one add a new part for simulation?
Oh, and do you see any issues with my Voltage Switch circuit? I have simulated this and it works as expected (minus the voltage drop values). The goal of this circuit is to switch on the battery when 5v is not active. Thanks for your help, Andy!
@rileyporter,
Answer to your second question first: have you read the Simulation Tutorial (3) in (2) in:
https://easyeda.com/forum/topic/How-to-ask-for-help-and-get-an-answer-71b17a40d15442349eaecbfae083e46a
Finding and adding models is covered in there.
Answer to your first question: M1 is connected not as a switch but as what is called a Source Follower which automatically inserts a voltage drop roughly euqal to the (somewhat unpredictable) Vgs_th (gate-source threshold voltage). In this case, that voltage is responsible for the approximately 3V i.e. (5-2.121)V, drop across M1.
To use an N channel MOSFET as what is called a high-side switch, you need a gate-source voltage that is a few volts more than the Vgs_th, above the source voltage.
Try it in simulation.
:)
This configuration is also referred to as a Common Drain connection. It is functionally equivalent to the Common Collector or Emitter Follower configuration of Bipolar Transistors (BJT) which may be a sightly easier point to start from to understand what is going on because the base emitter drop of a BJTis more tightly controlled then the gate-source threshold voltage of a fet.
https://en.wikipedia.org/wiki/Common_drain
https://en.wikipedia.org/wiki/Common_collector
For more, see:
https://easyeda.com/forum/topic/Useful-learning-resources-78a07f9ed4104ce9b15fc7584ac67003
"...do you see any issues with my Voltage Switch circuit?"
The short answer is that no: for the reason described below, your circuit will not do what you require. You need two P channel MOSFETs and some sort of inverter circuit between the two gate drives. This is easy enough to do discretely and there are some low power integrated N and P channel pair devices to implement a high side switch. I think they are made by Nexperia but I can't find the part numbers for them at the moment.
This might help though:
https://assets.nexperia.com/documents/application-note/AN11304.pdf
You also have to consider that happens if the input voltage sources are either removed (go open circuit) or are shorted to ground for any reason. And, depending on your application, what if the load sides are shorted to ground?
@andyfierman
Answer to your second question first: have you read the Simulation Tutorial (3) in (2) in:
https://easyeda.com/forum/topic/How-to-ask-for-help-and-get-an-answer-71b17a40d15442349eaecbfae083e46a
I did not see this in the link you provided. Is this the right link? I searched I promise!
I think I can remove the 2nd MOSFET all together. Just using a P-Type by detecting the presence of the 5v input and switching off the 3.7v battery current flow by putting the base at 5V. I am midly worried about why there is .045v on the MOSFET when it shoud be switched off if there is 5v on the base and 3.7v on the source. No were near a negative voltage.
And with the 5V Open (or in the real circuit not present)
Which adjusts my circuit to the following.
You also have to consider that happens if the input voltage sources are either removed (go open circuit) or are shorted to ground for any reason. And, depending on your application, what if the load sides are shorted to ground?
The circuit I am designing is based around the 5v signal turning on and off. Its an electric cart that will be "started" and the 5v signal will be present then. The lipo is there to power the low power nordic uC.
I have thought about adding a diode of some sort for "just in case" circumstances the 5v would not go back into the 3.7v battery. However I think if I do this the voltage drop over the battery would be not great for the application.
If they are both or either shorted to ground then the whole thing will blow up I suspect. Not sure there is much to be done about that? Perhaps add some fuses around the LIPO and 5v sections? I have a fuse on the buck converter (48v to 5v) but not the output of the 5v anywhere.
NXP MOSFETS:
I found these:
https://www.lcsc.com/product-detail/MOSFETs_Nexperia-NX3008PBKS-115_C295452.html
and read about them. They seem like they would would but I would still need an inverting circuit to get them to work independently. Also they are sold out on lscs which I am going to have build our prototype boards eventually.
Anyways I know this is a long rely and I am truly grateful for your support. Thanks!
Riley
PS I realized that the MOSFET on my schematic was flipped. Fixed here.
"...I did not see this in the link you provided. Is this the right link?"
Yes.
You need to read the topic:
https://easyeda.com/forum/topic/How-to-ask-for-help-and-get-an-answer-71b17a40d15442349eaecbfae083e46a
and follow the instructions in it rather than just skim though it looking for links.
" I am midly worried about why there is .045v on the MOSFET when it shoud be switched off if there is 5v on the base and 3.7v on the source."
Measure the drain current of M1.
Then think about the voltage drop that generates across a forward biased diode remembering that the V vs I of a diode is a logarithmic relationship.
:)
Mosfets have a parasitic "body" or substrate diode in parallel with their source and drain pins. The diode is such that under normal operating conditions of the mosfet device, it is reverse biased. That is, for an n channel, with the drain more positive than the source and, for a p channel, with the drain more negative than the source.
The P channel mosfet is passing current though the LED through the forward biased body diode.
If you study the literature about the structure and operation of the P channel mosfet (or redraw your circuit with an n channel mosfet and read about them), then you will understand why this is happening.