Smart battery charger

I have a few 12v alarm batteries and i always use them for small projects and never have a proper way to charge them. So i dived in and built my own smart charger controlled by an ATmega328 microcontroller. Simply put the charger starts off with a constant current charge of 250mA depending on the battery size, it is adjustable, then it measures the charging voltage every 10seconds. once the charging voltage becomes 14.1v it switches to constant voltage charge and charges the battery at 14.1v. it then monitors the current going into the battery, once this drops to approximately 10% of the batteries capacity. Once the current drops to this level a relay switches the power to the battery off and it stops charging.

Basically two LM317's are used in series, first a constant current source followed by a constant voltage source. for feedback i have a voltage dividing circuit that is monitored by an analog pin and a 1 ohm resister that is also monitored by an analog pin for current. to switch from constant current to constant voltage i have a transistor that switches on and basically lowers the resistance on the R2 resistor of the constant voltage circuit. another transistor switches the relay on and off.

Here are some pictures, im still going to put it in a nice case and maybe add a fan to cool the heat sink. the heat sink is so huge i dont even think i will need it but i will see.

Thank to everyone that helped me especially CROSSROADS.

Pics? Schematic...

Chopped liver, I guess.

polymorph:
Chopped liver, I guess.

Could you please stop replying to my posts with your snotty comments? I don't appreciate it

Well, it was meant to be humor.

I'll stop replying to your posts at all.

These are people that order a PCB for nothing more than to connect a 328 to a button and a LED.

I'm like you, I build things on perfboard without any copperpads at all.
If it doesn't work or I made some error I change the world by rearranging components.

Then, and only then I'll draw the schematics.

It's all in my head in the first place :slight_smile:

polymorph:
Well, it was meant to be humor.

I'll stop replying to your posts at all.

Exactly what do you mean by Chopped liver?

janost:
These are people that order a PCB for nothing more than to connect a 328 to a button and a LED.

I'm like you, I build things on perfboard without any copperpads at all.
If it doesn't work or I made some error I change the world by rearranging components.

Then, and only then I'll draw the schematics.

It's all in my head in the first place :slight_smile:

Ok so why is everyone ripping on my project? Why? If you don't have anything good to say then don't. Not all people studied electronics and not everyone has the same intellectual capacity. I find it extremely rude what you are saying

Im sorry i interpreted your post incorrectly. i do apologize

janost:

polymorph:
Well, it was meant to be humor.

I'll stop replying to your posts at all.

Exactly what do you mean by Chopped liver?

The old saying "what am I, chopped liver?" as a way to express when one is feeling under-appreciated.

It was a joke, referring to when a lot of other people were telling calvingloster to buy a SLA charger IC, in spite of his continued pleas to use the LM317, because it is what he has. And I told him exactly how to accomplish this with two LM317 ICs, he merely had them in the wrong order. But my post got lost in the noise of other arguments. Eventually, someone else suggested the same thing, and the project got built.

http://www.knowyourphrase.com/phrase-meanings/What-Am-I-Chopped-Liver.html

Yes even though Polymorph and I hate eachother he did suggest that I put the constant current lm317 first. I in return lashed out at him because I felt it was appropriate at the time. I however do not have appropriate skills so my appropriate assumption was incorrect and I should have never lashed out at him as he was only pointing me in the correct direction. Much like a box filled with potatoes that don't get soft even though they have been boiled for an hour. Even that makes no sense. But polymorph I do hate you with all my heart. I hope your arduino shocks you with 20mA:)

I don't hate you, but I'm not going to use my time on someone who hurls abuse at me for the crime of attempting to help.

If you use an ATmega for charge control you could pulse charge the battery with a MOSFET.
No need for LM317s or relays.

But if you charger works then it's ok.