Finally finished this board for my 12v led strip light power backup. It works like this: When 12v main power is on, it will charge a 3.7v lithium battery using the TP4056 ic, and when power is out, a relay will turn on to power a dc-dc step up circuit to power the 12 led strip. Everything works fine, except that when testing the power input with 18V, the AMS1117 is overheating and hot to touch (and yes, I use my finger as a testing instrument.). TP4056 can output 1A-130mA, and I am setting it to 580ma using a 2k resistor. according the datasheet of AMS1117, it can output 800ma, so here are my questions regarding this circuit.
1, why it's over-heating? is it because of higher voltage drop?
2, what should be the optimal resistor value (or current) for the tp4056 so that the AMS1117 won't over-heat when powered with 7-15v? (I think max input for AMS1117 is 19v, but I can't find it anywhere in the datasheet I got. It only states input as 15v.)
3, How many watts will be wasted in this AMS1117 if my input is 12v and I am charging a 4000mah 3.7v battery?