Battery Auto Select - Page 1
Forum section: electronics / projects

author: Dubbie
author_rank: Unknown
timestamp: November 26, 2017, 08:28:52 pm
content: Hi,I am designing a device that must work from external power when plugged in, when it is, it must charge the internal battery. When it is unplugged it should run from battery power.I have included a sketch of a design I have come up with. What do you think? Have I missed any better ways to do this? I'm not that excited about the relay, but it seems simple and foolproof.The microcontroller runs from the battery directly so it can turn on and off the peripherals as necessary.Any and all comments are gratefully received.R

author: StillTrying
author_rank: Super Contributor
timestamp: November 27, 2017, 01:48:17 pm
content: "Any and all comments are gratefully received."Your diagram is next to useless ?I don't think the relay would energize very often ?Maybe the load could be connected to the boost conv at all times ?

author: richard.cs
author_rank: Super Contributor
timestamp: November 27, 2017, 02:06:25 pm
content: AdditionallyI don't think your relay is doing what you expect. When do you want it to switch?Related to the above - what's the diode for? did you mean something like this:Does the load care about an interruption of tens of milliseconds?It looks like the boost converter runs all the time, just unloaded when there is external powerWhat's your battery voltage and chemistry? How much current do the loads use? Do you care about power consumption when on the external supply?It's definitely doable without a relay if you want to get rid of it.

author: WillHuang
author_rank: Contributor
timestamp: November 27, 2017, 04:56:20 pm
content: I had to do something similar to this before. I used this APP note (http://ww1.microchip.com/downloads/en/AppNotes/01149c.pdf) as a starting point. It may help you out

author: Dubbie
author_rank: Unknown
timestamp: November 27, 2017, 04:57:44 pm
content: #1 the relay should switch off when the ext12v is removed.#2 the diode was indeed in the wrong place. Noticed that after I posted.#3 the boost converter is switched off with its enable pin. Same as the charger.#4 vbatt/boost is 9v instead of 12. This is intentional to use less power.#5 batt chemistry is LiFePo4 1S running between 2.7v and 3.5v. uC is always connected.#6 don’t care about power usage while plugged in.#7 current requirements range from between 120mA to 2A (yes boost conv is working hard at this extreme)One area of concern for me is how the caps may hold 12v briefly on the boost converter output on switchover.

author: richard.cs
author_rank: Super Contributor
timestamp: November 27, 2017, 05:48:41 pm
content: Based on the information you've given I would expect you to be able to diode-OR the output of the boost converter and the input supply and simply enable/disable the boost converter based on the absence/presence of external power. Similarly if the right battery charger is selected it should be OK to leave connected to the battery all of the time, many are designed to be used that way.

author: Dubbie
author_rank: Unknown
timestamp: November 27, 2017, 06:08:10 pm
content: I think you are right. I can’t remember now why I abandoned that idea earlier.

author: ITman496
author_rank: Regular Contributor
timestamp: November 27, 2017, 10:32:18 pm
content: If the diode drop is too much for you, I've successfully used the LM5050 with some STD12NF06L fets. But of course you can use different ones. This circuit is nice because it has only as much drop when its turned on as the fet does. Which is very very little compared to a diode. I just built it off of the example schematics in the datasheet, has worked for me about 8 times now.

author: Dubbie
author_rank: Unknown
timestamp: November 27, 2017, 11:21:56 pm
content: Thanks ITman! That looks promising for sure