-
Notifications
You must be signed in to change notification settings - Fork 0
Description
The 4-digit 14-segment alphanumeric display lasts 6 hours at full brightness (default). Lowering it to the minimum brightness lets it last 9 hours. These tests were done with a 105mAh battery. Still a 9 hour watch isn't that useful. To save power, only turn on the screen with a user's input.
Ideas
-
Put a switch between the battery and trinket. This was my first idea, but without a real-time clock the "watch" wouldn't be able to keep track of how much time has passed.
-
Turn on the screen for a few seconds when a button is pressed. Even better, because we can control the brightness, I can fade the screen on, pause a few moment, then fade it out. For this idea I would need to unbridge Vcc and Vi2c, leaving Vi2c connected but now connecting Vcc to a pin, say pin 3. There's no reason to ever need to disconnect Vi2c, so leave that connected. Pin 0 and 2 are used for I2C data and clock, so that leaves pins 1, 3 and 4 open. Pins 3 and 4 are used for programming the ATtiny85, but unfortunately we'll have to use one of them. We need two pins: one for [conditionally] powering the display, and one for the button. I wanted to keep these new functions on the other side of the board and noise away from the I2C lines, hence pins 3 and 4, but the trinket pinout page recommends using them for output, if unavoidable. So we'll save pin 1 for the button input and use pin 3 for powering the display. Setting this pin to an
OUTPUTandHIGHshould end up being no different than if we had just connected it to power.
Instead of constantly polling the button, we'll use an interrupt to handle it. This video greatly helped me see how to do this with the trinket. This would be great if we could actually even put the Attiny85 to sleep and use the pin change interrupt to wake it up. This would save even more power. We don't need to worry about only listening for theRISINGorFALLINGedge or debouncing, because (hopefully) this would just make the display stay on for a moment longer before it falls back asleep.
Waking the processor with a pin change interrupt either resumes execution from where it went to sleep or just callsloopagain (need to test it), as seen in the video linked earlier (noteISR (PCINT0_vect)is left empty). So after setting pin 3 to high, we'll probably have to send the.begincommand each time we power on the display. -
Use a switch to turn on the display. Similar to above, but instead of dealing with all of that added complexity, just put a switch between Vcc and 5V on the trinket. Unfortunately, then the trinket wouldn't be able to know when the display gets turned on. If the display doesn't remember the digits it was last displaying, the trinket would need to constantly be sending I2C data. I'm not sure how much power this would take as I have not tested it. I have also not tested if the display remembers its state when it loses and regains Vcc. Vi2c will remain on, if that makes any difference. I also wouldn't be able to fade in the display with this method.
-
Same as the previous idea, but use a button. The display would be on as the push button is held. The advantage is that it's a simple button press, the disadvantage is that you have to hold it. However, you wouldn't have to remember to turn it off like the switch. The button has a reasonable, satisfying click, while the switch is quite firm. I would be concerned of it snapping off.