SHA2017-badge / Firmware

ESP32 firmware for the SHA2017 badge
https://wiki.sha2017.org/w/Badge
Other
83 stars 36 forks source link

V_bat is measured / displayed with +0.4V Offset #207

Closed geek-solutions closed 6 years ago

geek-solutions commented 7 years ago

The Voltage of the battery is measured and displayed with an offset of +0.4V (values from multimeter: 3.8V badge: 4,2V). Therefore the battery indicator also shows a wrong status for the battery.

Only used one (my) badge for testing

basvs commented 7 years ago

Every badge seems to be a bit different. The only right fix might be to build some kind of calibration for it..

basvs commented 7 years ago

@Roosted7 If I remember correctly, you were trying to find out how we could solve this?

renzenicolai commented 6 years ago

HW bug with bad (software) fixes on top: the analog input used to measure the battery voltage is connected AFTER the fuse. The resistance of the fuse causes a voltage drop which differs from badge to badge and from load to load (with the leds or vibration motor on the voltage drop is higher...). So... only way to fix is to disconnect the ADC pin and connect it to the battery directly.

Roosted7 commented 6 years ago

What renze says is true, but not the biggest cause of the false readings... That is mostly because the ESP32's ADC is not so good :sweat: (Especially in the old IDF's at least)

I tried to 'fix' this by calibrating the voltage readings to the know value of the LiPo charge cutoff voltage 4.2v. When your badge is connected to a charger and the battery is full, it should calibrate the voltage readings to improve offsets.

Please give it a try :)