My wife does interval training exercises in the backyard or the basement. I joined her a couple of times and noticed that she struggled to time her “on” and “off” intervals using the phone. So I saw a fun project opportunity where I get to use an ESP8266 and some salvaged parts like a buzzer and potentiometers.
Using a couple of beefy pots from an old receiver she can easily adjust the “on” and “off” workout periods in ten second increments.
The button starts and stops/resets the timer.
The ADS1115 ADC was needed because the ESP8266 has only one analog input.
To play something more interesting than just a beep I ended up writing a little library to play arbitrary sequences of notes. You can read more about the buzzkill piezo Lua library in this short blog post.
I also added a power saving mode after 15 minutes of inactivity where the display is put into a low power mode and is turned off. However I was disappointed to find out that it only saved a few mAs or a couple of percent. I kept it in there just to, maybe, increase display’s longevity and just because I already went through the trouble of implementing the feature.
The video of it in action, components used, code and schematics are all posted below. Please let me know if you have any comments, questions, suggestions or corrections.
Lua code can be found in init.lua: https://github.com/alexchumak/interval-workout-timer-lua
- Wemos D1 Mini, an ESP8266 dev board
- ADS1115, a 4-channel, 16-bit ADC
- OLED display, 0.96″ 128X64 I2C SSD1306
- Piezo buzzer