# Integrating battery and battery charger with my project - I never want to remove batteries from this device for charging, how do I do that?

(I used to design and build electronics - HiFi, automation, digital systems up to and including CPU-based controllers - so I have a good understanding of the basics. I just stopped being involved in the field about 15 years ago, so my knowledge of what's currently available in terms of components is quite foggy.)

The device is a controller for a scientific instrument. Removing batteries for charging every once in a while will be cumbersome. Plus, I want seamless transition between batteries and AC (well, not AC per se, but external DC at a higher voltage).

The battery needs to be 12 V or a bit higher. In terms of how much energy it needs to store, something like a small laptop battery should be enough.

So, basically, I need to integrate the battery charging circuit with the device. The battery will not be (easily) removable. The device will provide a port for an external DC supply for charging. Switching between internal battery and external DC must be seamless. It must handle automatically all the chores related to battery charging (regulate the current, stop charging when fully charged, stop the device when fully discharged and there's no external DC, etc). Indicating the current charge level would be nice.

Any suggestions?

I'm pretty sure I could use an actual laptop battery for this purpose, I just don't know how to connect it.

Could I use 4 x LiPo or 4 x 18650 elements in series? I'd have to use some kind of battery charger/controller, I'm pretty sure such a thing already exists, I just don't know where to start looking for it. I know these elements are finicky.

Any help would be appreciated, thanks.

• Start looking for power management ICs, abbreviated PMIC: here on Digikey. There are quite a few parameters you're missing in the question (like charge time, maximum currents, efficiency, and size) that we'd need to know before we can recommend a solution. Most controllers guarantee a seamless transition between charging and battery power. – Kevin Vermeer Mar 23 '12 at 20:54
• With 4 cells you also have to consider cell ballancing. It can get complicated. – Olin Lathrop Mar 23 '12 at 21:23
• Whoa, that Digikey link is awesome. I'll start digging through it. Maximum currents: 1 A should give plenty of overhead (Arduino + SD card shield, 20x4 LCD, a few temperature sensors, 120mm PC fan w. speed controlled by Arduino). Charge time: 12 hours is okay. Size: smaller is better but it's not critical. Efficiency: as long as it doesn't waste too much battery I don't care. – Florin Andrei Mar 23 '12 at 23:34
• eevblog.com/projects/usupply is an example. He uses two batteries and a boost converter. – joeforker Mar 24 '12 at 11:50

A laptop battery is liable to be a good choice if the Li-ion characteristics suit you. These may have 2 or 3 or 4 cells in series. Some provide access to all cell connection points, some don't. Those that don't may have an internal controller to maintain cell balance.

If this is a one off or low volume application you may want to look at using whatever the related laptop uses. If this is for large volume use then Digikey and others sell a range of suitable ICs. An alternative is to use fewer cells and a boost converter. There are many LiPo single cell batteries available for tablets/phones/pdas/ ... . There are numerous 2 cell batteries available for cameras. These are usually dearer per capacity unless you buy aftermarket batteries. An advantage of a camera battery is that there are usually low cost aftermarket chargers available which target a particular camera battery type and which do a good enough [tm] job of battery charging. The price of such chargers is often low enough that building in a commercial charger into a product may be $attractive. If you want 12V minimum then you will need 4 Li-ion cells - about 12V minimum (you choose) and just under 17V fully charged. A possible alternative are sealed lead acid cells. Cheaper per capacity but lower mass and volume energy densities and lower cycle life in deep discharge use. LiFePO4 (Lithium Ferro phosphate) has lower voltage per cell than LiIon and lower energy density but potentially much greater cycle life. Long term LiFePO4 offers best cost pe cycle but initial price is high. NiMH - not recommended. Added: Florin commented: Since at this stage I don't need a lot of energy stored in the battery, the single Lithium cell + booster circuit idea sounds really appealing, especially since I can easily find a housekeeping module that does the charging while also feeding DC to my device. Of course, now I have to find a suitable booster; ideally something based on an IC with few components around it. Amperage requirements are pretty meager. I need to build two, one for 5V and another for 12V. This IC will provide up to 80 mA AT 18V (100 mA+ AT 12v) or 280 mA at 5V out from a single LiIon or LiFePO4 cell. In stock at Digikey for ~$2/1.

TI / NatSemi LM4510 Synchronous Step-Up DC/DC Converter with True Shutdown Isolation

Efficiency is "OK" across a reasonable load range.

And circuit offers a bearable level of complexity.

An evaluationkit is available - whose PCB gives good pointers to proper layout:

A single Li-ion or LiFePO4 cell will power this well. The latter has lower energy density but has the advantage of longer cycle and better table manners generally. A Li-ion 18650 cell (as used in most laptop battery packs) will give about 7 - 9 Wh when new or say 6 Wh after boost conversion. A LiFePO4 18650 cell will give about 50% of the energy content of a std Li-ion cell. Say 3.5 to 4 Watt hours.

• Since at this stage I don't need a lot of energy stored in the battery, the single Lithium cell + booster circuit idea sounds really appealing, especially since I can easily find a housekeeping module that does the charging while also feeding DC to my device. Of course, now I have to find a suitable booster; ideally something based on an IC with few components around it. Amperage requirements are pretty meager. I need to build two, one for 5V and another for 12V. – Florin Andrei Mar 27 '12 at 3:51
• Russell, that's awesome, thank you. I'll try and find an IC which is the next step up in terms of output amperage, just to be on the safe side. I'd feel a lot better if the supported output is closer to 1A - although, realistically, that should never happen. A PC fan will be sitting on the 12V branch, and it may draw a bit more than 100 mA. – Florin Andrei Mar 27 '12 at 5:13
• I've learned my lesson on those evaluation boards. You will never have a layout like that. It's like the saying, you will only see that in the movies. Yeah, you will only see beautiful layouts like that in eval boards. Something will prevent you, somehow, at least for me :) – abdullah kahraman Mar 27 '12 at 8:42