I have a small project I am working on that accepts power from either a 5v DC power source or a USB power source.

Now, I know that both of the power sources are effectively 5v. I have measured the power on both with my meter and can see that the USB supply is at 5.4 and the DC supply is at 5.01v.

I would like to be able to build something that switches over to the USB supply when the cable is connected. However, I have never done this before. I have taken a look around on Google already and have read some things about P Channel MosFETs and PowerPath controllers - but I am a little confused as to whether the two incoming voltages I have are suitable for this?

Would someone be able to give me a little advice on this at all?



  • 1
    You might get a useful response here, but this sounds like something that would be better asked on electronics.stackexchange.com
    – timemage
    Nov 26, 2020 at 14:25
  • Just a side note: 5.4V on a USB supply is outside of specs. It should be 5.25V maximum.
    – StarCat
    Nov 26, 2020 at 16:16

1 Answer 1


Consider copying the Arduino Uno reference design. This is part of that schematic showing the MOSFET used to turn on / off the USB power when the barrel jack power source is active:

enter image description here

  • actually, just the part of picture containing mosfet on the left would suffice. Dec 26, 2020 at 20:47
  • 1
    It's more of a personal preference, but I never liked it when someone post a bit of a schematic and a key net name (in this case "+5V") is missing the source of the signal. That's why when I copied the schematic I included the 5 volt regulator on the right.
    – st2000
    Dec 27, 2020 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.