r/AskElectronics • u/Tornad_pl • 1d ago
Mosfet is partially on when it should be off
Hello I am trying to create a circuit where you turn on device by momentarly pressing button then microcontroller inside tecides, when to turn it off.
I have devices working off of couple voltage levels, so I've decided to control it from negative side. I have decided to use mosftet as it theoretically draws no/very little current when on (as compared to relay). I short mosfet for device to boot up, then microcntoller pulls it's gate high. then to turn off it pulls it to high impedance (pulling it low didn't work, so i added resistor connecting to ground and changed to high impedance)
In the photos I present both simplified and full schematics.
I have noticed that sometimes device turns on partially (lcd backlight turns on and speaker is clicking, but nothing else) so I vent to investigate.
here is what I found. Mosfet when it is supposed to be off is partially on. and when battery is charging or fully charged, voltage behind it is high enough to turn rest partially on.
Here is voltage readings
Turned off:
Battery 7,3V GS 3V GD -0,5V SD -3,5V Regulator High side 3,8V Regulator Low side 1,6V
Turned on:
Battery 7V GS 3,5V GD 3,2V SD -2,8V Regulator High side 6,7V Regulator Low side 5.0V
Charging:
Battery 8,1V GS 3,3V GD -0,45V SD -3,75 Regulator High side 4,7V Regulator Low side 1,9V
Charging, partially on:
Battery 8,3V GS 3,25V GD -0,45V SD 3,7V Regulator High side 4,6V Regulator Low side 3,15V
Now my question is, what is causing it, how should I do this kind of setup properly, can I do it properly with mosfet or i need some form of insulation either by relay or by transoptor?
thank you in advance for any help
12
u/baldengineer 1d ago
You should be using a PFET as a high-side switch for the 5V regulator circuit.
Not switching the low-side of an active circuit.
2
u/Tornad_pl 1d ago
I thought, it would be problematic, because I turn off 7,4V curcuit with 3,3V gpio. Will I have to add voltage amplifier inbetween?
7
u/ccoastmike Power Electronics 1d ago
Use a small logic level NFET to pull down on the gate of the PFET.
3
4
u/quadrapod 1d ago
Right now when the GPIO pulls low you're really just connecting drain to gate so Vds will stabilize somewhere a bit above Vth.
1
u/quadrapod 1d ago edited 1d ago
Here is pretty much what you'd have to do to switch lowside like this. Close the switch to initially power it and set the GPIO inverter input from low to high to simulate the MCU triggering the shut down.
1
u/AutoModerator 1d ago
TV repair or capacitor replacement? Check out these pages first:
https://www.reddit.com/r/AskElectronics/wiki/repair/tv
https://www.reddit.com/r/AskElectronics/wiki/repair#wiki_bad_capacitors
If those pages don't help, let us know here and we'll use the feedback to help improve the wiki. Thanks!
Please note that you may get more precise help by first posting in /r/tvrepair
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/aurummaximum 1d ago
It seems like in every state you have at least 3V on your Vgs. This could easily be enough to turn on your FET.
You need to pull it to 0V. Try that. It should work.
But it’s just about possible you have a race condition. As you drive the FET, you could end up in a strange undefined middle ground state where the micro is turning off and all its pins go undefined state as it shuts down, which could then hold everything on ish at the FET.
1
u/Tornad_pl 1d ago
doesn't the 10k resistor pull it to 0 already? i can;t just short it because it would take high current when gpio is active,
next week i can see what happens when i take microcontroller out of pcb.
If microcontroller were the issue, should I add transoptor?
1
u/nixiebunny 1d ago
Why: The GPIO with its 42 ohm resistor drives the gate to MPU Gnd, which is not the same voltage as FET Gnd because the FET disconnects the Gnds from each other. Solution: don’t switch Gnd.
1
u/Tornad_pl 1d ago
i thought switching ground is needed, because for switching high i would need voltage simmilar to battery voltage and microcontroller is 3,3V.
2
u/aurummaximum 1d ago
You can use a p-channel FET and a buffer transistor switched from the micro to pull down the FET gate.
1
u/ccoastmike Power Electronics 1d ago
How about switching to a LDO that has an enable input you can drive from your micro directly. No need to over complicate things.
1
u/Tornad_pl 1d ago
i need micro to turn off devices both before and after egulator. also I didn;t think of that and had 3 pin regulator laying around,
2
u/ccoastmike Power Electronics 1d ago
In that case, I would go with the PFET NFET approach from the other comment. Or if you want to get fancy, you could use load switch ICs that have logic inputs.
1
1
u/ccoastmike Power Electronics 1d ago
Also, just looked at your schematic. You have a ground issue. Your micro is using the GND net. The source of your FET is connected to GND_BAT.
•
u/AutoModerator 1d ago
Do you have a question involving batteries or cells?
If it's about designing, repairing or modifying an electronic circuit to which batteries are connected, you're in the right place. Everything else should go in /r/batteries:
/r/batteries is for questions about: batteries, cells, UPSs, chargers and management systems; use, type, buying, capacity, setup, parallel/serial configurations etc.
Questions about connecting pre-built modules and batteries to solar panels goes in /r/batteries or /r/solar. Please also check our wiki page on cells and batteries: https://www.reddit.com/r/AskElectronics/wiki/batteries
If you decide to move your post elsewhere, or the wiki answers your question, please delete the one here. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.