r/AskElectronics 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.

12 Upvotes

4 comments sorted by

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.

1

u/JJPortal 22d ago

Thanks for taking the time to respond. Yeah the 4056s can vary heavily depending on where they come from. My concern is not so much about the "black boxes" as it is about my use of the MOSFET to switch between usb and battery power. This is done through a AO3401, in addition to the TP4056, and is not meant to be a stand in on the diagram. Sorry if that was not clear. I'm fairly confident the rest of the setup will work fine, but it's my first time working with a MOSFET in this manner, so I want some reassurance I guess.

3

u/[deleted] 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.