Battery -or- USB power

Hey Gang-

A little out of my exposure here.. Normally I have just run with straight battery packs or directly from +5v USB ports (power bricks..etc)

I'm not sure what the answer is.. or what is the best search terms here?

But if I wanted to power a project from a battery pack.. UNTIL a usb cable was plugged in.. how would I go about looking into that?

Initial thoughts:

  • do I use rechargable batteries then? (not sure if I want to just charge, was originally just thinking about an ALT power option/source (no re-charging of anything?)

  • some sort of way to detect the usb cable was connected right? and then somehow use that source instead of the batter pack?

Not sure how to go about detection? Perhaps there is a little board out there that people use for this or something?

I have in the past created projects that use rechargable Li-Ion batteries.. with a recharge port.. but that is also used a kill switch to cut the project and charge the battery packs..

  • you needed your own charger
  • not usb related at all
  • didnt power the project up, was purely to recharge the battery pack installed inside project.

What terms/solutions should i be looking into?


As far as I know, this is the only board that does this.

EDIT - I'm unaware if this can be used with Liion. I assume so as long as the C rating isn't violated.

Nice thanks!

So charges... seems to also power the project (while charging). But has a manual switch to toggle form battery to USB.. hmm.

Not sure if access will be available for that.


1 Like

You can always replace it with an external switch.


I wasnt even thinking of that! (having a brain fart day apparently) LOL :slight_smile:

1 Like

The Arduino UNO R3 has an automatic switch. If the voltage at the Vin pin is greater than 6.6V, the USB power is disconnected. If you disconnect the voltage to Vin, it switches to USB power.

There is a diode between the power jack and the Vin pin so the switchover voltage is more like 7.2V at the power plug.

1 Like