Notifications
Clear all

Help with P-Channel MOSFET Circuit

20 Posts
5 Users
10 Likes
527 Views
(@fishbone)
Member
Joined: 1 year ago
Posts: 54
Topic starter  

Hi all!  I am trying to understand the following circuit, but am not too bright.  It is here:

Circuit

This is from an esp32 dev board I am using.  VBUS is from the USB-C connector that is used to charge the LiPo battery (the actual charging circuit is not included).  VBAT is the battery voltage and VIN is the voltage input header on the board, but I never use it.  So looking as the mosfet, VBUS is the Gate, VIN=source (no voltage connected) and VBAT = Drain.  In the case where the USB is not connected, how does the battery voltage get to pin1 of the ME6211C33 voltage regulator?  VBUS will be 0 and since VIN=0, then VGS=0.  But VGSth = -0.4V to -1V so the mosfet should be closed and the voltage at pin 1 of the ME6211C33 should be 0.

Please help a newbie.    


   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6972
 

@fishbone Whenever I am troubleshooting, I try to simplify. I would disconnect the part of the circuit surrounding the U2 component then use your VOM to measure the 3 leads of the Q1 component in the 'OFF' state, then measure in the 'ON' state. If that does not tell you what is wrong, then post those results here where someone else may have an answer.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@fishbone)
Member
Joined: 1 year ago
Posts: 54
Topic starter  

@zander I have seen this same basic circuit used on other dev boards.  Here is an AdaFruit Feather S2.  You can see the mosfet on the top and the voltage regulator on the right.  I don't necessarily have an issue with the circuit, I am trying to understand how it works.

 

AdaFruitFeatherS2

 

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6972
 

@fishbone I guess it depends on what you really mean by 'I am trying to understand how it works.' I can't really answer this question without sounding like a smart alec but it helps if you fill out your profile and disclose your education, training, work experience outlining how many years or hours spent working in a job that is relevant.

Please understand that I am on the autistic spectrum so I may come across differently than what you expect. I often wish I could explain and express myself better. 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6972
 

@fishbone I just took a better look at that last circuit you posted. If you are going to mess with battery charging etc, there are a lot of traps. It is very much an advanced topic. There is a very good video of a fellow modifying a supposed circuit like that and he had to cut traces and add components to make it both safe and work correctly. Messing with the most dangerous batteries we encounter is ill advised for anyone but an expert.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

@fishbone

Have you actually built this circuit? Does it work in practice?
If the VBUS is connected to a positive source then wouldn't that turn off the MOSFET?
If the VBUS is unconnected then the MOSFET base would be pulled to a negative value (ground)?
The gate would be 0Volt relative to the ground but negative relative to the source?
A voltage is always between two points although the ground can be a reference point.

To enlarge an image, right click image and select Open link in new window.

MOSFET CCT

   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6972
 

@robotbuilder @fishbone The circuits are from commercial ESP32 boards, he just wants to understand how they work.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Inst-Tech reacted
ReplyQuote
Inst-Tech
(@inst-tech)
Member
Joined: 2 years ago
Posts: 554
 

@fishbone  I see others have given you some good advice..but it's clear to me that your still in the dark about how the circuit works..Check out the simulation in the following photo..

this should help you to see what @robotbuilder was trying to illustrate..

image

if you have more questions.. please ask.. We'll do our best to answer them..

Regards,

LouisR

LouisR


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6972
 

@inst-tech It might be useful to others (including me) to do an export as a link (create a short URL) and post that link here. That way, we can all follow along with any discussion of the circuit.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Inst-Tech reacted
ReplyQuote
(@fishbone)
Member
Joined: 1 year ago
Posts: 54
Topic starter  

Hey all - thanks for all of the help!  I am an engineer - but not electrical.  I am just interested in MCUs as a hobby and trying to learn.  At any rate, I thought I knew how a mosfet worked, but I did not.  In particular, I didn't understand that you do have a voltage at the source when usb is removed and it is VBAT minus the voltage drop across the body diode (I thought the voltage at the source was 0).  

Again, appreciate all of the help on this one...I really did learn a lot

Fish

@zander @Inst-Tech @robotbuilder

This post was modified 3 months ago by Fishbone

   
Inst-Tech reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6972
 

@fishbone Logic-level MOSFETs are great tools. One of the important things to learn is the difference between N chan and P chan. Strangely, we seem to use N chan more often, so even when you 'master' that, it takes a few minutes to reverse your thinking to figure out the P chan. Bill has a  VIDEO      ARTICLE   that covers the N chan. I keep a small supply of the 

The most comprehensive site I have found on this topic is at HERE  The NORMAL usage is N chan on G side and occasionally P chan on VCC side. The link shows not only the reverse of both those situations but also includes a brief explanation of the depletion type vs the Enhancement type. I have only used Enhancement types; depletion types are a bit of a special case.

Another good resource is at HERE

I keep a small supply of the IRF520 modules on hand for quick setups, but I also build my own for more permanent use. Bill covers both in the video/article.

Good luck.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Inst-Tech reacted
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

@zander

Strangely, we seem to use N chan more often ...

https://circuitjournal.com/which-mosfet-should-you-use-with-arduino

I used complementary pchannel nchannel mosfets in a hbridge to control the speed and direction of the motors in a robot base. I remember using complementary pnp npn transistors in a push pull amplifier circuit project.

To enlarge an image, right click image and choose Open link in new window.

h bridge

   
Inst-Tech reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6972
 

@robotbuilder Yes, that is one place they are a natural fit.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Inst-Tech reacted
ReplyQuote
Inst-Tech
(@inst-tech)
Member
Joined: 2 years ago
Posts: 554
 

@zander , Ron, this was a screen shot from my simulation app.. so it's not possible to create a link.. but I'll keep that in mind if I have other post where I get schematics on the web.

Regards,

LouisR

LouisR


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6972
 

@inst-tech I tried it, it's File/Export as Link then select short URL

Here is a test 

http://tinyurl.com/ys4jns74

Yep, works perfectly.

 

Screenshot 2024 01 20 at 15.32.57
Screenshot 2024 01 20 at 15.33.07

You really want the short URL, cuz this is what the long looks like

https://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWcMBMcUHYMGZIA4UA2ATmIxAUgpABZsKBTAWjDACgAncDQkPK7Hhp8qVMJDYBnEIOH9aNPCKjgQAMwCGAG0kM2Ad2695YHjIQoobAMYyh5y6d7YLKmPEhgkMQtlORCNHFfbBQUCBYJLTs5AXsXSzEQJndIGjoaDDCeDHQwUKsANwUlBJLlUVoqbzdoBE4Yh3KysTg2AHtaEEJhKhpIUmQoWBQay2FsDplu3qrB8WHIUdVLeknOqh6VfsGYP2X3ZctEmTZBaYAxCFFYD2vbz09kiABhDQAHDWsASwAXDQAdtY9OdhFdak8wLAIhAAJIAgAmAFdrP8gSClFRwUlxDCQAAlBiSb6SNHAtgAC1UEzYQA

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Inst-Tech reacted
ReplyQuote
Page 1 / 2