-
@Gordon What kind of battery is in the Bangle.js 2? I read that that analog input is supposed to read 1/4 of the battery voltage, which means that a full battery is about 1.25V. That sounds about right for a NiMH battery. A lithium battery would be quite a bit higher (3.7V?)
-
-
I've worked around it for now by editing widbatpc.wid.js on the watch, replacing E.getBattery() with a call to a custom getBattery() function:
function getBattery() { var battery = Math.round((analogRead(D3) - 0.375) / .00106); return battery; }
That should tide me over until @Gordon returns.
-
I've done some experimenting and it looks like my watch maxes out around 0.481 on the D3 when fully charged and shuts down around 0.375. These values are about 1.5x the values used to calculate battery percentage (0.246 and 0.3144). Not sure if my watch was built with the wrong value resistors for the voltage divider that feeds D3 or if the ADC is programmed incorrectly for that input.
analogRead(D3)
Fully charged:
analogRead(D3)
=0.48046875
analogRead(D3)
=0.48120117187
analogRead(D3)
=0.48022460937
analogRead(D3)
=0.48095703125Just prior to shutdown:
0.37524414062
100
0.37451171875
100
0.37377929687
100
0.37548828125 -
-
Here's what I get for a sequence of E.getBattery() and analogRead(D3) calls:
E.getBattery()
=100analogRead(D3)
=0.45239257812
analogRead(D3)
=0.451171875
analogRead(D3)
=0.45263671875
analogRead(D3)
=0.45239257812
analogRead(D3)
=0.45190429687
analogRead(D3)
=0.4521484375
analogRead(D3)
=0.4521484375
E.getBattery()
=100
E.getBattery()
=100
analogRead(D3)
=0.45263671875
analogRead(D3)
=0.453125
analogRead(D3)
=0.45190429687
analogRead(D3)
=0.45288085937
analogRead(D3)
=0.45239257812 -
I received my Bangle.js 2 a couple weeks ago. I was giving it as a Christmas present, so I didn't do much with it other than charge it fully and install the latest software/apps including the newest firmware update. Since yesterday, it has mysteriously shut down several times and would not power back up until connected to the charger. Once on the charger, it will immediately boot up and the battery shows as 100% charged. At that point, if you disconnect it from the charger, it will run for a few minutes and then shut down again. I finally figured out that the indicated battery level always shows as 100% even when it's almost discharged. I charged it for a couple of hours and it has run overnight without shutting down (but the battery still shows 100%). Has anyone else seen this behavior?
@fanoush You're right, only hi should be needed. I'm now experimenting with trying to get getBattery to be more accurate since volts/% is not linear. My daughter noted that her watch was claiming 40% remaining battery shortly before it shut down. Based on a discharge graph shown here https://learn.adafruit.com/li-ion-and-lipoly-batteries/voltages, I've come up with the following: