A simple fitness timer providing short interval timings for weight and High Intensity Interval Training (HIIT).
Hardware:Arduino UNO
LCD shield with buttons - mine is one of the ones with a faulty backlight [1] so I removed the offending pin (pin 10)
Stackable prototype shield - note the one shown here is a data logging shield, the clock and SD card reader are not used in this project it is simply the case that I already had a sounder soldered in on this board so its use was convenient.
Piezo sounder attached to pin 3
The components just stack together like a cake and the only soldering needed is for the piezo sounder.
Software:The software is based on a loop.
The buttons are debounced using an interrupt routine taken from Jack Ganssle pdf [2]. The method I used does have a quirk in that the button "press" is actually registered on the release of the button (I first used it in a chorded keyboard).
The beeps tones are generated by PWM and delay() handles the timing.
There is a separate function to handle the updating of the display.
Functioning:Turn on unit.
Set work period with up button
Set rest period with down button
Set whether you want the unit to toggle from between work and rest periods using the select button.
Push work (Left) or rest (Right) button to start that interval.
In standard mode the end of an interval is marked by a long beep. In toggle mode the unit cycles between work and rest or rest and work depending on which button was pushed first.
As to why start with a rest interval, it allows you to get yourself and your equipment set rather than rush straight into your workout.
Limitations:I noticed some lag on the buttons especially when the unit has just been turned on, this may be because the analog read needs time to stabilise.
References:[1] LCD shield problem page: https://forum.arduino.cc/index.php?topic=96747.0
[2] Debouncing pdf: https://my.eng.utah.edu/~cs5780/debouncing.pdf
Comments
Please log in or sign up to comment.