My question is, can I use a Arduino as a battery charger timer, I have a 3.7 v 1200 mah lithium battery that I have been charging with a 4.2 450 ma charger for quite some time, I normally just use gator clamps to connect the leads to charge it, but today I was charging it and forgot about it and let it over charge. I don't want to ruin the life of the battery or possible have it blow up, so I got the idea of using my Arduino as a timer so it will shut off when it is done (or close to done). My plan was to connect a transistor to it and have the Arduino running to the base pin to control when it will turn on or off and add a diode for both feedback and voltage droppage. I am aware that I will have to add a resistor/diode, so its not charging at around 6 volts. But I want to know if I can run a program through my Arduino that will have it charge for say 2 hours? If anyone knows if the uno is capable of doing this please let me know. Also will I be able to connect a standard phone charger which I believe is 5 volts 2 amp to power my arduino? Thank you for ur replies, if there is a program please link it P.S. If anyone would like to know more information or would like to me fix any information please just comment and I will have it fixed shortly.
Can you use an Uno to switch something on and off? Yes.
Should you? No.
In this case you are talking about controlling something that if it is not controlled could have serious safety implications. Are you confident enough in you ability to code not to get this wrong? What if the hardware fails, the Uno freezes?
Yes you could do it, but I think you would be better off buying a tried and tested COTS solution.
As others have already said, you could time the charge, but your idea has some major flaws; First, since you can more easily read voltages than you can keep track of time, you should stop the charge once a certain voltage is reached, so you could also charge other batteries or half charged ones.
MORE IMPORTANTLY, Lipos always need fairly complex charging circuits (compared to other rechargeable types). This is an area you should read up on extensively before tinkering, since LoPo's respond explosively to mistakes.
A good starting tutorial; http://learn.adafruit.com/li-ion-and-lipoly-batteries/overview
I would suggest using a commercial charger, so that you are sure to be protected from over charge, over voltages, shorts, and fires, and will stop charging when the battery is charged. This one should also have a connector so you can connect it to your phone charger, and costs 0.90$. http://www.electrodragon.com/product/tp4056-lithium-battery-charging-board-1a/ Please note this is a reference, you should find more economic offerts.