Move38 / Blinks-SDK

Development for Blinks starts here. This codebase includes everything you need to get up and running in the Arduino IDE with Blinks.

Home Page:http://forum.move38.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Low battery indication/warning [Enhancement]

kenj1 opened this issue · comments

Given that a low battery voltage can cause problems; (a) cannot re-program, (b) dim LEDs (esp blue), (c) no visible sign it’s “on” or alive;

Some thoughts;

A “Super long press” (e.g. 10 seconds) and the BlinkOS lights up LEDs to indicate the battery level. Six LEDs (all lit) - full battery. Zero LEDs - dead battery. LED levels 1-5 are battery percentage. Anything below 3 LEDs lit is a low battery condition.

Another thought (perhaps counter intuitive) is to have the BlinkOS (during idle times - no sketch running) periodically flash some patterh to indicate a low battery (< 2.5v). E.g. for a few minutes post playtime (and idle) - flash some sequence every 10 seconds. This handles the case where the user does not initiate the check.

Thanks @kenj1, the way I would like to handle low battery warnings is to simply show a low battery pattern and not allow for gameplay when the battery is in fact low or about to die. The threshold for this would be when the first of the RGB LEDs are no longer able to display a correct brightness level.

In the case that the battery is at this threshold (< 2.5v or similar) the Blink should show a red warning animation for ~10 seconds, send out a force sleep message, and then go to sleep. This would keep players from playing a game with a single low power Blink, and suggests removing it from play. The players can then find a battery for this Blink or play without it for the time being.

I propose having the blink check battery voltage once at power up and then again periodically while running - maybe once every few seconds. The power up one is important because blinks power up with a low speed clock and if you switch to the high speed clock and there is insufficient voltage then the processor can crash or do worse unpredictable things.

If a low voltage is detected, then the blink will show a short "low battery" display and then go to sleep. It will wake on button press (or possibly if the battery is removed for long enough it will power cycle when new battery is inserted) and repeat the voltage test.

I'm not sure I agree with having the low battery sleep be viral. (1) if the battery is already low then sending a bunch of IR pulses will just make it lower, (2) if it is really low then the pulses will potentially be ineffective, (3) I think people will see the low battery display and understand that blink went to sleep and they need to change the battery so having the whole collection of blinks shutdown seems unnecessarily jarring. Keep in mind that the low battery check happens asynchronously so it could happen int he middle of game move, in which case a piece that was in motion would not get the sleep message so it would still be awake while the others were asleep. Same goes for groups of blinks if one does a battery sleep during, say, a fracture move. This is different then, say, a forced sleep which happens under the user's control and therefor will happen at a time he expects it and presumably has the blinks in a stable configuration.

Battery warning is currently too aggressive. Users will notice low battery with the dimming of LEDs, if the battery is truly low, perhaps the Blink shall simply not turn on. which would suggest, by default, that it needs a new battery. The double red flash for low battery frequently interrupts game play when often times gameplay could continue just fine. A non wake-able Blink feels like a Blink that needs a new battery. I realize that this presents a little ambiguity for a broken Blink; however, a broken Blink can be confirmed with a new battery.

We need at least 2.4V to turn on reliably at power up and wake from sleep, so I'd like to leave the check there. At this moment, voltage tends to be high anyway since the battery has very little load on it and has likely been sitting for a while.

It seems like the chip is able to keep running below 2.4V once it has warmed up, so we can probably stop the periodic checking and depend on users to know when battery is getting low.

I would like to leave the red blinks in for the power up/wake check since it does give some feedback that "I know you pushed the button, and that worked, but I can not start now because of low battery". Otherwise it feels like maybe I have to push the button harder or the button is broken or the blink is broken or something else that I do not know what to do.

This sounds good to me. receiving the low battery midgame or in game transmission is the biggest annoyance. I agree with the button feeling broken if nothing happens and a battery is in.

Implemented on new branch...

https://github.com/bigjosh/Move38-Arduino-Platform/tree/no-periodic-voltage-check

COMPLETELY UNTESTED.

Let me know if it even works! :)

Ah, looks like right now it only check for low battery on initial power up (that is, after a battery change). Any low battery after wake would get caught by the (now gone) periodic check to save space. I should put the check on Wake back in and see if it fits...

Nope, the check on wake is there, but it will always be one sample behind for complicated reasons. I can fix this and also simplify the ADC code since now it only has to run at very specific time (power up and wake). Will do tomorrow!

@bigjosh just checking to see if this was something you were still working on. The code at the moment seems to be working well. Either way, i am getting a dev branch and master up to date and about to package another release so it is easy to find and easy to test. Let me know if it is a good time to close this issue or if there was a little more work on it.