Close

Battery and small screen testing

A project log for Uvee Py

An non-straightforward journey to build a wearable UVI indicator.

paulius-jPaulius J. 08/03/2022 at 08:560 Comments

No new prototype case this time around, I've parked my 3D printer for the time being while I set up OctoPi. :) What I did make progress on though, is some battery magic. Or well, battery experimentation...


The Qt Py Charger BFF outputs the battery voltage (well, half the voltage) on pin A2, so I've been trying to map this to some form of a battery indicator. After some initial testing, I managed to detect charging state and draw a basic battery indicator on the screen, you can see the preview below (I replaced the human-readable UVI value with voltage for the time being).

The only "easy" way of testing the accuracy of the indicator that I could come up with, without additional equipment I don't have, was to set up a time lapse video... Needless to say it ran longer than expected with just under 20 hours of on-time. I didn't want to lose track of the timing so I turned it off and paused the time lapse when I went to sleep. It was a very dodgy setup with an old GoPro resting on a speedcube and video is blurry, but you can see it function:

Overall I was concerned about the linear mapping of voltage to battery level being very inaccurate, however it's not noticeably terrible so I'll likely keep the code as is. I had the "cutoff" when the battery dies set to 3.2V in my code, however it seems like it died just as it dipped below 3.29V, I assume the battery protection circuit shut things off at that point so I might adjust the code with the new cutoff of 3.28, but again - it's not super noticeable. The code is currently on a separate branch as I was doing a lot of experimentation, but you can see it here: https://github.com/ripexz/uvee-py/tree/batt

In other news, I've been experimenting with smaller components - I've found a tiny 0.49" 64x32 OLED screen and hooked it up to a spare Arduino Uno laying around to check if it works and if I can show everything on the screen I want clearly. Overall, I'd say the experiment has been a success:

That's all for this update, looks like it's time to work on that low-power/sleep code that I've been procrastinating on! Although I do have another (analog) UV sensor I'd like to try out... :)

Discussions