I used the following:
pinMode(PWR, INPUT);
pinMode(CHG, INPUT);
charge = (digitalRead(PWR) && !digitalRead(CHG)); // 0 = Not Charging
onBatteryPower = (!digitalRead(PWR)); // 0 = Not on Battery Power
Notes:
- If a Solar Xenon’s charge cycle is interrupted, it wont resume charging until the Li-Po drops below 4.05V.
- If both charge and onBatteryPower are “0”, the Panel is providing the operating current for the Xenon.
-
voltage = analogRead(BATT) * 0.0011224;
will be incorrect under certain conditions. - This Thread has more details at the time (and firmware version) of my testing.