Battery/External power supply automatic switch circuit - Page 1
Forum section: electronics / projects

author: Finndersen
author_rank: Newbie
timestamp: April 14, 2016, 02:08:36 pm
content: Hi,I'm making a portable Rpi 3 project that will be battery operated but switch over to external supply and charge battery when connected.I'm planning on using a USB power bank thing which has a 5V charging input and 5V USB power output, with in-built battery charging circuit etc.I just need a circuit which effectively switches Rpi and external power source from battery output to charge input when external plug is connected.I've got this P-channel MOSFET/diode circuit which would work great, except for the diode voltage drop, since USB power/battery output is 5V and Rpi needs 5V (sorry for horrific sketches):I can also use a DC jack which has a switch to disconnect battery output when plug connected, however the battery ends up being connected to itself normally and would just drain to death...I would like to avoid multiple input power ports/manual switches etc. It would also need to supply at least 2A. Surely there's a way to make this work without diode voltage drops?Thanks for any help

author: Wobbegong
author_rank: Newbie
timestamp: April 14, 2016, 07:55:44 pm
content: http://www.linear.com/product/LTC4413That thing is probably your best bet so that way you can prioritize the actual USB input.Here is the logic:USB to INB, ENBABattery to INAWhen only the battery is connected, USB is low by the internal pull-down so INA is enabledWhen USB is connnected, the USB voltage drives ENBA high which disables INA, and INB is always enabled by virtue of the internal pull-down on ENBB.That said, it looks like the only reason the Rasperry Pi needs 5V is because the supervisor chip they picked has a reset threshold of 4.63V so if you found a diode that dropped less than 0.37V at the max current and min temperature you wanted to operate at, or you changed the supervisor one with a lower threshold (or removed it altogether), then your original idea might work fine.- Steve

author: Ian.M
author_rank: Super Contributor
timestamp: April 14, 2016, 08:51:03 pm
content: http://www.linear.com/product/LTC4415might be a better choice. Its a bit beefier (4A max) so if your Pi 3 has a lot of USB devices plugged into it or any expansion hats, it would be a better choice. Its also available in a 0.5mm pitch MSOP-16 package that can be hand soldered far more easily than a 3mm square leadless DFN-10 package. If you don't have a hot air station or reflow oven, you'll need a pair of 1.6mm PTH holes under it so you can reflow the thermal pad with a heavy duty ordinary iron.

author: Finndersen
author_rank: Newbie
timestamp: April 14, 2016, 11:28:21 pm
content: Ok cool thanks so that basically just has ideal diodes in it (no voltage drop).Why did nothing like that come up when I Google power source switcher circuit etc hahaDo you think there's some kind of breakout or module with this kind of chip? looks like a pain to connect manually since its so smallAlso where can I buy this or something equivalent for cheap... its $50 minimum shipping from the Linear site to Aus for something the size of a fingernail?Edit: found a good source:https://au.rs-online.comI'll let you know how it goes!

author: NiHaoMike
author_rank: Super Contributor
timestamp: April 15, 2016, 03:06:24 am
content: The Pi 3 has a built in "ideal diode". Most USB battery packs are also fine with having an external 5v supply biasing the output.

author: Finndersen
author_rank: Newbie
timestamp: April 15, 2016, 03:19:16 am
content: The diode will be internal right, so the battery will still be connected back to the mosfet on the outside(which is why the diode is there)Since the battery pack will take in usb power 5v+-0.2v or something, same as it outputs, I think it would discharge itself with losses?

author: NiHaoMike
author_rank: Super Contributor
timestamp: April 15, 2016, 05:36:24 am
content: The 5v pins on the header are after the diode.