E
Posts: 143
Joined: Thu Sep 29, 2011 7:30 pm

12v Li-ion charging circuit?

Sun Oct 20, 2013 2:58 pm

Hi,

I'm working on my first project with a Pi; a semi-portable 12 volt rechargeable wifi speaker. The big problem I'm having is with how to charge Li-ion batteries. From what I've read, they really don't like being charged and drawn from at the same time, so if I use them I'll require some sort of circuit for switching between running off mains power + charging the battery, and running off the battery. Is this something I'd have to make, or can they be bought? It would need to supply about an Amp to the system when plugged in, plus I'd guess 500mA to charge the battery, which would be around 6Ah capacity. I can dust off my old A-level books and probably follow a circuit diagram with a little help from Google, but I don't know anything like enough about electronics to spec one myself. Or is there a good resource that could get me up to speed?

I could use lead acid batteries, which would be simpler, but that would add roughly another Kg in weight for the same Ah, which wouldn't help with the portability aspect!

Many thanks for any suggestions.

hampi
Posts: 223
Joined: Fri May 31, 2013 11:29 am
Contact: Website

Re: 12v Li-ion charging circuit?

Sun Oct 20, 2013 5:13 pm

I do not know but reading the battery university looks like a microcontroller project. See the link

http://batteryuniversity.com/learn/arti ... _batteries

fixitsan
Posts: 58
Joined: Sun Sep 29, 2013 4:28 pm

Re: 12v Li-ion charging circuit?

Wed Oct 23, 2013 5:28 am

A quick look on ebay and yoiu can find 'lithium cell chargers which delivery upto 1A, and switched mode power supplies to output 12V

But now I've said that I realise you haven't mentioned what the configuration of your battery is, it's voltage, and what voltage you have available for charging it.

If you only need 5V for the Pi and you have 12V available for charging then that is very easy to manage using cheap ready made circuits designed for the job. Can you give a bit more detail of all the required circuit voltages and the supply voltage you wish to use.

Chris

E
Posts: 143
Joined: Thu Sep 29, 2011 7:30 pm

Re: 12v Li-ion charging circuit?

Wed Oct 23, 2013 9:46 am

Thanks for the replies.

@hampi
Yes, I wondered if it was a micro controller project, as I know most mobile devices have them for battery management.

@fixitsan The batteries I have been looking at are 12v, and around 6800mhA, as everything else runs off 12 volt apart from the Pi. Something like this pack, which believe has over/under charge protection circuit already built in? It would be recharged by 230v 13Amp standard UK mains.

Thanks for the help!

User avatar
r4049zt
Posts: 113
Joined: Sat Jul 21, 2012 1:36 pm
Contact: Website

Re: 12v Li-ion charging circuit?

Wed Oct 23, 2013 12:24 pm

I don't know the Li batteries but can vouch that eight NiCad AA batteries from Maplin can simultaneously store charge as it arrives off a small solar panel and provide power to a 1Amp rated DC-DC buck regulator set to 5.0V which powers my rPi. NiCad batteries prefer to be kept topped up for most of the time and fully emptied occasionally (or so I've read). Swapping for 6V Pb H2SO4 batteries, those prefer to be kept topped up.

No circuit diagram is really necessary if you are inserting a buck regulator from battery to rPi as their battery input and device output solder tags are labelled. If you are after a circuit to activate recharge whenever battery V is "below full" then try looking up zener diodes and fet transistors. I've never found the most obvious circuit for that, which needs a few resistors too, and it is a nice hobby level task. I have found that a blue LED forward can be used instead of a 2.6V zener (which goes the other way around) for referencing the voltage in a battery charger. I'm not sure about interrupting recharge while the load is on. I wouldn't.

fixitsan
Posts: 58
Joined: Sun Sep 29, 2013 4:28 pm

Re: 12v Li-ion charging circuit?

Wed Oct 23, 2013 1:23 pm

Okay, then yoiu just need a 'step down' power supply. A switched mode step down regulator is better than a linear regulator because it is so much more efficient, wasting much less energy as heat. There are plenty to choose from on eBay, which take upto 30V input and buck it down to 5V. They only cost pennies. EG http://www.ebay.co.uk/itm/LM2596-DC-DC- ... _777wt_932 (Just ebay 'LM2596' in your own country to find something suitable)

Your batteries ought to have a decent charging circuit built in, to manage the three lithium cells wired in series, which should include (hopefully) some form of cell balancing for when they inevitably go out of balance.

As long as they have an internal charge circuit and balancing then there is no problem charging them at the same time yoiu are drawing power - the problem isn't that the cells don't like it, but that the charger may end up being overloaded of it is designed to provide just enough current to charge depleted cells.....when you add a further load in parallel with the cells you may find the charger gets a bit warm !. Without knowing more about the load you intend to apply to the cells at 12V it's difficult to be more specific.

Hope that helps
Chris

E
Posts: 143
Joined: Thu Sep 29, 2011 7:30 pm

Re: 12v Li-ion charging circuit?

Thu Oct 24, 2013 6:33 pm

@r4049zt I'd ruled out NiCad purely due to the cost for the amount of amp hours I'll need. A circuit to activate the recharge only when the battery was below a certain level would be nice - I'll have look into zener diodes and fet transistors and brush up on my electronics!

@fixitsanThanks for all the info, though I'm a little confused about the step down regulator? Having said that, I think it's probably me not being clear in my first post, in that I have a 12 to 5 volt step down for the Pi itself. (well, actually I'm still waiting for it to arrive) http://www.ebay.co.uk/itm/Micro-USB-out ... 3a7fc0ac28

I'm afraid I can't give you the real world load, as I've not got all the parts yet, but the setup is a Pi model B with wifi & DAC usb dongles, and a 12v audio amplifier that should draw around 1.25amps at max.

Many thanks again :)

hampi
Posts: 223
Joined: Fri May 31, 2013 11:29 am
Contact: Website

Re: 12v Li-ion charging circuit?

Thu Oct 24, 2013 8:12 pm

A circuit to activate the recharge only when the battery was below a certain level would be nice - I'll have look into zener diodes and fet transistors and brush up on my electronics!
That is a comparator circuit switching a transistor on/off. In addition to the operational amplifiers you can find comparators from PIC microcontrollers with more digital control.

fixitsan
Posts: 58
Joined: Sun Sep 29, 2013 4:28 pm

Re: 12v Li-ion charging circuit?

Thu Oct 24, 2013 8:29 pm

I didn't notice the dc-dc convertor you were waiting for...it looks ideal, 3A maximum is plenty.

You look like yoiu have a maximum of about 1.5A at 5V. Say 0.75A input to the regulator at 12V
And an estimated 1.25A for the amp is 2A total at 12V

For the battery pack you linked to (6800mAh), that 2A load represents a discharge rate of about 0.3C, which isn't too heavy and you should see about 2.5 - 3 hours of duration (conservatively).

It depends on the charger though as to whether it has enough output capacity to charge the batteries _and_ power your circuit. A typical charger output (not fast charging) is 0.1C, so you would find that the charge circuit might complain a bit, but this is just guesswork without taking measurements.

As for the charger switching automatically, bear in mind that the charger has 2 modes, constant current and constant voltage. ( known as CC and CV). Lithium cells generally need a bulk charge in CC mode (to maybe 80% full) and then topping off with the CV method. Your switching /detection method has to either accomodate the fact that although the voltage will be maximum , the charge is not complete (using a timer would help there), or otherwise have a larger battery and charger, or 2 batteries, where one charges while the other is used.

It might just be easier to add in a 12V mains supply (small 240V 2A/12V supplies are cheap and light, and then when yoiu have a mains supply to hand the amp and Pi is powered from the mains, while the battery is being charged at the highest possible rate (and the charge circuit is working within it's design parameters)


Chris

fixitsan
Posts: 58
Joined: Sun Sep 29, 2013 4:28 pm

Re: 12v Li-ion charging circuit?

Fri Oct 25, 2013 8:13 am

Just taking it to it's logical conclusion...after looking at the battery once again it looks like it uses 12V input, which means that mains 'wall wart' adapter outputs 12V. If the adapter had a larger current capacity it could easily power the amp, Pi and charge the battery.

I might be tempted to replace the mains adapter with a slightly more robust device which outputs 12V. You could easily add a 12V relay in cicruit so that the output side of the battery is disconnected whenever the main 12V charge voltage is present.
Charge1.JPG
Charge1.JPG (20.92 KiB) Viewed 6762 times
Then your device has it's own UPS !

hampi
Posts: 223
Joined: Fri May 31, 2013 11:29 am
Contact: Website

Re: 12v Li-ion charging circuit?

Fri Oct 25, 2013 9:27 am

You could easily add a 12V relay in cicruit so that the output side of the battery is disconnected whenever the main 12V charge voltage is present.
Probably easier to use power diodes for switching. Usually the voltage that is used for charging the battery needs to be higher than the voltage on the battery. This kind of switching is easy to do with lead acid batteries. When the power supply voltage drops the diodes take care that the battery continues to provide power.

fixitsan
Posts: 58
Joined: Sun Sep 29, 2013 4:28 pm

Re: 12v Li-ion charging circuit?

Fri Oct 25, 2013 11:04 am

hampi wrote:
You could easily add a 12V relay in cicruit so that the output side of the battery is disconnected whenever the main 12V charge voltage is present.
Probably easier to use power diodes for switching. Usually the voltage that is used for charging the battery needs to be higher than the voltage on the battery. This kind of switching is easy to do with lead acid batteries. When the power supply voltage drops the diodes take care that the battery continues to provide power.
While I agree that is 'normally' what you could consider, the battery being considered uses a 12V input to the charger and produces upto 12.6V out. I guess the charger is a buck/boost converter.

(For the diagram to be completely correct, replace '12V OUT' with '10.8V -12.6V OUT')

Therefore I didn't consider using diodes in the traditional way, because once the battery voltage exceeds the 12V input voltage the charger output will start being the main voltage source (trying not to overlaod the charger !)

Schottky diodes could be chosen which could negate the 0.6V difference by means of their inherent forward voltage drop, but, then you're wasting power...

E
Posts: 143
Joined: Thu Sep 29, 2011 7:30 pm

Re: 12v Li-ion charging circuit?

Fri Oct 25, 2013 5:50 pm

Many thanks for the replies all, and the diagram fixitsan - that is exactly the functionality I was hoping for :) I think I'll go with the wall wart setup, as it'll mean a bit less weight and heat inside the speaker chassis (not that it's a big issue).

I'm hoping to document my build to some extent, so I'll keep you updated.

Thanks again :)

fixitsan
Posts: 58
Joined: Sun Sep 29, 2013 4:28 pm

Re: 12v Li-ion charging circuit?

Fri Oct 25, 2013 8:48 pm

No problem E, just bear in mind that the circuit demands that the wall wart must be powerful enough to charge the batteries while powering the amp, so you might need 3A.....

Best thing to do is to measure the current properly, to the charger when the batteries are flat and to the amp/pi setup when it is drawinbg maximum current, and then you'll be able to specify the output of the 12V wall wart correctly

Good luck

E
Posts: 143
Joined: Thu Sep 29, 2011 7:30 pm

Re: 12v Li-ion charging circuit?

Sat Oct 26, 2013 5:35 pm

Thanks, will do :)

Return to “Other projects”