How to estimate number of hours remaining before battery dies?

calculating remaining battery time accurately is pretty hard.

What you are attempting to do is to calculate the mAH charge remaining in the battery at any given time from when the battery last had a complete charge. To do this accurately requires that one reads the actual real time current consumption continuously and keeps an accumulated mAH consumed. This is then subtracted from the rated full mAH capacity of the battery. It can be done but it requires current sensing/measuring hardware and extra software.

Lefty