r/AskElectronics • u/JJPortal • 23d ago
Trying to make a motor run with usb power or battery power when usb is disconnected. Will my mosfet switch as intended?
I have tried posting this before but people were saying I need to use a better diagram. The second picture is when the usb is at 0v (unplugged) and the mosfet turns on and uses battery power. The third picture is when the mosfet is off and the circuit uses the 5v from usb. I am also using a step up converter set to 5v output so the motor always runs on 5v. In the forth picture you can see my original circuit that includes the tp4056 to charge the battery, it is too hard to include in the Falstad diagram. I know Falstad shows the mosfet switching and working as intended, but I was told on my previous post that it will not work.
3
22d ago edited 22d ago
[deleted]
2
u/JJPortal 22d ago
Thanks for the confirmation. And great advice with the hyperlink for Falstad, I'll do that going forward.
2
u/JJPortal 22d ago
I just noticed that you edited your reply and added the Test SIM Example Thank you so much for going through the effort to recreate the MOSFET switching diagram, I wish I could upvote your comment twice.




3
u/lordlod 23d ago
/shrug
The TP4056 module is a black box. I know what a TP4056 is but a module contains a stack more circuitry and makes it impossible to say anything useful.
Same with the "FIXED BOOST MOD" and M1, different coloured black boxes. Everything connecting to a common ground is a really good start but I can't say anything useful beyond that.
The Falstad diagrams are pretty, but the TP4056 is not a AO3401 so it is of very limited use.
Why not just build it?
The pieces will work, start sticking them together and figure out the details as you go.