The bottom line is that the BlueFlyVario prototype has a battery life of 17 hours. This is about three or four times the life of most Android devices that will run the app. It think it is enough.
Battery life in real world situations is important. Indications of charge level is something that routinely frustrates me with many devices. I get really annoyed when a device tells me that it goes from 90% charge to 50% charge in a few minutes, then stays there for a while, then all of a sudden goes down to 10% or completely flat. In most cases I think that the algorithm programmers use is screwed up. My aim for the BlueFlyVario is to be able to indicate charge level of the device to the user in a way that makes a lot of sense. Percent charge should mean percent of time remaining from a fully charged device.
Measuring charge level
Battery voltage can be used to give an indication of charge. The BlyFlyVario measures the battery voltage using an AD pin by measuring the voltage across the resistor divider (R6 -- R3). The resistor divider together is about 200k, and at about 4V 'consumes' only about 0.02 mA. It is only on when the switch is on so does not drain the battery when the device is off.
Calibration constants for battery charge level
My approach to battery charge level indication is to have the device spit out the voltage once every ten seconds. To calibrate the voltage requires two constants, one for the voltage from the TC1015 regulator (Vdd), and one for the ratio of the resistor divider network RDratio = R6/(R6+ R3). As each regulator and resistor is slightly different (manufacturing tolerances!) these constants are measured on each device after it is built using a multimeter, and the constants are programmed into the EEPROM of the pic. In practice Vdd is about 3.01 to 3.04, and RDratio is between 0.95 and 1.05. The battery voltage can then be calculated from the voltage measured at the AD pin (Vpin). The formula used for the battery voltage is then:
Vbat = RDradio * Vdd * Vpin/1024
The value 1024 is because it is a 10 bit AD on the PIC.
Run Down Test
The battery voltage for LiIon/LiPO batteries follows a known curve, but it is slightly different for each battery model. I am using a Nokia type BL-5B battery (890 mAh). The graph below shows the battery voltage vs. time. In this test I connected to my PC test program via Bluetooth and let it run. From 'full' charge at about 4.16V it takes about 17 hours to get to 3.6V, which for practical purposes I will use as zero charge. It is possible to squeeze a little more from the battery, but to preserve battery health it makes sense to recharge the battery at that point. In the prototype it will continue to run past that point. I am not yet sure what I will do for production devices (auto shutdown or keep running).
To get charge level from battery voltage I use a piecewise linear function. The pink line on the graph below is the piecewise linear approximation of % charge vs. time. It is just the same data as above with 3.6V equals 0%. The Android app uses this function to give charge level for a particular battery voltage.