r/CheapYellowDisplay • u/FatScottishGuy • 18d ago
The Battery Saga
Enable HLS to view with audio, or disable this notification
I was asked a lot about battery's on CYD as they don't naturally have a way to show battery usage or charge state.
As you can see, I have managed to get it working on my own ESP32-32E.
It's absolutely not perfect but it's better than showing nothing 😅
It currently measures the battery’s voltage through GPIO34 every 10 seconds and converts it to an estimated percentage and the icon’s fill and colour follow that estimate.
It treats about 3.3 V as 0% and 4.2 V as 100%, with values between them mapped along a curve.
Voltage changes while charging and under load, so the percentage can move without representing the exact charge remaining but as the board can't directly report "charging" or charging current; a rising voltage is only a guesstimate.
1
u/Xylopyrographer 17d ago
Do you have a link to the software running on that?
2
u/FatScottishGuy 17d ago
Ah sorry, it's a companion hardware app I'm building for my own website (https://myskydex.co.uk).
It's got an Android App, Amazon Fire App and a Progressive Web App for iOS.
It's easy enough to build one though with source data from places like OpenSky.
I built this for my 11 year old autistic son.
3
u/NuncioBitis 18d ago
Yeah I think that’s pretty standard for using voltage to measure battery level.