Hi all! I am trying to understand the following circuit, but am not too bright. It is here:
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.
@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, 360, fairly knowledge in PC plus numerous MPU's & 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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@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.
@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, 360, fairly knowledge in PC plus numerous MPU's & 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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@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, 360, fairly knowledge in PC plus numerous MPU's & 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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
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.
@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, 360, fairly knowledge in PC plus numerous MPU's & 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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@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..
if you have more questions.. please ask.. We'll do our best to answer them..
Regards,
LouisR
LouisR
@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, 360, fairly knowledge in PC plus numerous MPU's & 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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
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
@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, 360, fairly knowledge in PC plus numerous MPU's & 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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
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.
@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, 360, fairly knowledge in PC plus numerous MPU's & 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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@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
@inst-tech I tried it, it's File/Export as Link then select short URL
Here is a test
Yep, works perfectly.
You really want the short URL, cuz this is what the long looks like
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, 360, fairly knowledge in PC plus numerous MPU's & 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.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.