Power interruption while switching from DC to battery - Page 1
Forum section: electronics / beginners

author: makedestroyrepeat
author_rank: Newbie
timestamp: April 14, 2020, 07:35:35 am
content: Hey everyone,I have been working on a Raspberry Pi 4 project, which I would like to make portable, but also to be able to be powered from a power socket. At first I just used some 18650 batteries in series and a step-down module to decrease the voltage to 5V that the Rpi4 likes and connected a DC barrel connector in such a way that plugging in the DC jack would cut off the batteries and connect the 5V from the power supply to the Rpi4. However, whenever I would plug the dc jack out, the power would be interrupted for a short while, which makes the Rpi4 restart. Eventually, this could damage the SD card.The next step that I tried was to use a charger module, hoping that it would have some internal circuitry to avoid it. The only charging module with the "boost" function (if I understood right, to be able to charge and use the device at the same time) and sufficient current of around 2.5A that I found was the MP2636:https://www.dfrobot.com/product-1613.htmlYet again, I am experiencing the same problem as before. I could not find an answer online, nor I can probably phrase it right to find one. The only idea that I had was to use a capacitor to discharge during the short time that the device is not receiving power, but having in mind the quite high current I would need a big capacitor, and would probably add some more problems to my system.I would be really grateful for any ideas on how to solve this issue

author: Mp3
author_rank: Frequent Contributor
timestamp: April 14, 2020, 11:23:16 am
content: Couldn't you have a supercapacitor for this purpose

author: Manul
author_rank: Super Contributor
timestamp: April 14, 2020, 02:33:23 pm
content: You can make a simple dual power solution with two low forward voltage drop schottky diodes. Not the best, but simple.

author: Manul
author_rank: Super Contributor
timestamp: April 14, 2020, 02:41:04 pm
content: If you go for this solution, would be good to check how DC/DC converter reacts to voltage transient on the input. Should be ok, but who knows.

author: makedestroyrepeat
author_rank: Newbie
timestamp: April 15, 2020, 07:39:53 am
content: Quote from: Mp3 on April 14, 2020, 11:23:16 amI have never used supercapacitors before, but don't supercapacitors give off only small currents? According to the datasheet:"Working current from μA~10mA,working hours micro seconds to a few months"https://www.tme.eu/Document/dabe3e2be4eef510cdce8afdeda9098e/BCE%20Series%20Data%20Sheet.pdfQuote from: Manul on April 14, 2020, 02:33:23 pmIt's a pity I can not charge my batteries in this way.Anyway, thanks, I'm going to try both solutions and see what comes up

author: Psi
author_rank: Super Contributor
timestamp: April 15, 2020, 08:02:08 am
content: Quote from: makedestroyrepeat on April 15, 2020, 07:39:53 amThere are some supercaps intended for clock battery-backup which have max current in the uA range.Then there are the kind of supercaps intended to provide temporary power for electric city busesI have some here which are 2.5V 2600 Farads and max 600Amps discharge (same as guy had in video below).However, here is something smaller for US$2.9 - 5V 1F supercap that does 1.8A pulse or 700mA continuous. This is probably still overkill for you.https://www.digikey.co.nz/product-detail/en/illinois-capacitor/DGH105Q5R5/1572-1771-ND/7387509

author: Manul
author_rank: Super Contributor
timestamp: April 15, 2020, 10:22:13 am
content: You can add charger to your batteries it is not a problem. The problem is that diode solution looses a littile power, but for hobby use it might be ok.

author: Peabody
author_rank: Super Contributor
timestamp: April 15, 2020, 06:37:28 pm
content: I don't quite understand what the problem is caused by. Does the battery power go through a switch inside the barrel jack - controlled by the position of the plug? If so, then you may just have a break-before-make safety feature in the jack switch. There would be some barrel position at which neither source is supplying power. If that's the situation, you should not route the battery power through such a switch.The attached circuit shows a USB charger and boost converter for a single LIPO battery. The switching to battery power is controlled automatically by the P-channel mosfet, which would not have the voltage drop a diode in the battery line would give you. Note that the orientation of the mosfet has its body diode protecting the battery from the 5V supply. The manual switch shown is just there to permit manually shutting down the entire device.You would need to pick the right mosfet for your power requirements, but this circuit works well, and there should be no power dropout or sagging when the external source is connected or disconnected. But I don't know how it would work for multiple LIPOs in series.

author: wizard69
author_rank: Super Contributor
timestamp: April 16, 2020, 05:25:04 am
content: I suspect that you are on the right track when looking a battery management IC's. At fist I thought something like this:http://ww1.microchip.com/downloads/en/DeviceDoc/21823D.pdfmight do it but apparently you want to be able to completely power the PI from the plug pack. This will likely require something different like the schematic offered up where a blocking diode is used to switch to battery when AC power dies.I seem to remember somebody (a chip manufacture) offering a chip set that should do everything you want as obviously this is a pretty common need these days. Likewise I'm pretty sure someone has a PI board that already does what you want.In any event charge management IC's come in all sorts of capabilities, this one:https://www.ti.com/lit/ds/symlink/bq25306.pdfdoes 3 amps. Now you still have the problem of charging while drawing power. This Maxim circuit:https://datasheets.maximintegrated.com/en/ds/MAX77818.pdfhas just about everything and a data sheet that reads like an overly long novel. Sadly that Maxim circuit appears to be for the wrong battery type, however it gives you an idea of what is on the market.That is just a quick list, there are likely several dozen manufactures of these types of IC's.Quote from: makedestroyrepeat on April 14, 2020, 07:35:35 am

author: Chalcogenide
author_rank: Regular Contributor
timestamp: April 16, 2020, 07:33:49 am
content: What about using a power distribution switch like a TPS2113http://www.ti.com/product/TPS2113? The exact part might not be the one you are looking for, but I have used it to build a sort of "USB UPS" capable of switching over from USB voltage input to battery power with seamless switchover. The site suggest similar parts capable of more current.You could route the DC input to one side of the switch and to the battery charging circuitry, then have an always-on boost converter from the battery to the other input; when DC power is disconnected the IC switches to the boost circuit seamlessly and as power is reapplied it switches back to DC in. A bit of bulk capacitance on the output might be required as the boost converter would be seeing quite a load step and might take few milliseconds to stabilize.