pimoroni / badger2040

Examples and firmware for Badger 2040 and Badger 2040 W
MIT License
149 stars 50 forks source link

Better Approach To Keepalive #9

Open Gadgetoid opened 1 year ago

Gadgetoid commented 1 year ago

In order to conserve battery, both Badger 2040 and Badger 2040 W cut the power immediately after refreshing the display in most examples. This is great for battery life, but not so great for user experience and we haven't really considered what the right balance should be here. It has also led to bugs like #7 where user-interaction causes the power to cut abruptly and unexpectedly.

I propose a major rethink of this pattern with some key goals:

  1. Try to avoid the user having to think about battery and when to power off
  2. Allow the system to remain powered on while the user is interacting- this would make apps like List as snappy as they are on USB power
  3. Allow the system to go to sleep/power off after a period of inactivity, whereupon a new button press turns it on and reloads the last app as normal

It feels like all of the user-facing buttons should be polled somehow in the background (we could attach an interrupt for this perhaps) and any button press should ensure the 3V3_ENABLE pin is turned back on to keep power running.

Rather than having a halt in the main loop, we should probably find some means of checking if the system is busy, and cut power when it has been "idle" for a (configurable?) timeout.

I don't know quite how any of this will work but I think it's worth thinking about.

Arthur-Philip-Dent commented 11 months ago

Exactly this is the reason, I was recently ordering a Badger 2040 (without WiFi) to see, if it gives a better user experience. The "radio" module really consumes a lot and batteries (alkalines...) below 3V total voltage, seem to be a fragile thing. So also ordered LiPos to pimp my 2040 W.

Another question is, why this battery box for the alkalines was added anyways? Shouldn't there be a LiPo-charger onboard, so we wouldn't have to detach even the LiPo battery?

There is much headroom for improvement...