Daily Running Tracker
Introduction: Daily Running Tracker
Hi All,
It's been a while since I made an instructable so I'd like to share something fun that I made recently. During lockdown I made my own yearly "everyday calendar" inspired by <PERSON> own idea (no instructable but photo attached for those interested). My better half wanted something similar to track her running (but on a 7 day weekly basis rather than a year). It also had to keep track of how many miles she ran not just a single light indicating a task had been done or not. Additionally, I wanted it to sing and dance and do lots of shiny LED business when she exceeded her target. The idea for the daily running tracker was born, so in summary it must:
* Log miles ran every day of the week
* Compare 'miles ran' against a set goal for that day
* Reward the user with a celebratory song and some flashy lights
* Be small enough to fit on a desk
* Remember everything when the power was turned off (comit everything to non-volatile memory)
Supplies
For this project I used:
1. A 3D printer (for the enclosure designed in FreeCAD)
2. M3 screws, and brass M3 inserts
3. A soldering iron
4. Jumper wires or wires of some kind
5. x9 momentary push buttons
6. x7 WS2812 addressable LED's
7. x7 SSD1306 OLED 128x32 pixel Displays
8. A 4 Ohm speaker
9. The DY-SV8F playback module
10. An Arduino Mega
11. DC barrel input
12. The TCA9548A multiplexer
13. 769
13. Arduino Mega prototyping board
Step 1: Operation
Push buttons
The user does a short push to enter the distance ran (Distance input mode) for the particular button pressed for the day in question (the DAY button), then uses an UP and DOWN button to increment the miles in 0.01 increments. A long push for more than 3 seconds will allow the user to enter the target/goal (target input mode) for that particular day, and UP and DOWN is used again to set the goal in 0.01 mile increments. A short push of the DAY button will confirm the entry of either the goal or target depending on which mode the unit is place in.
A long press of the push button allows the targets to be reset by clearing the EEPROM memory. When pushed for more than 3 seconds the displays will ask if the user if they are sure and display UP = YES, and DOWN = NO, to confirm their entry. A short press on the UP button will write a bunch of 0's to the EEPROM and the display will show "ALL MEMORY ERASED". I think an encoder would of been a nicer idea but I wanted to use up some push buttons I had in stock.
LED's
By default the LED for each day is red until the distance ran for that day exceeds the target set, in which case it turns to green. When the user enters distance input mode the LED turns light blue to indicate the unit is waiting for the user to input the miles, and deep blue when target input mode is selected. For confirmation of a target/distance when the user pushes the DAY button again to exit the input goal/target mode the LED with perform a colour cascade as an acknowledgement it has received the command. Finally when the user reaches the goal it will flash wildy different colours.
Displays
My original idea was to use the I2C bus to string multiple OLED's together, however I found out that the SSD1306 OLED's are typically hard coded with the same I2C address. That is why I had to use the TCA9548A multiplexer to allow separate addressing of individual displays. This displays a little running man and some chevrons to indicate the user is in distance input mode, and a crosshair with chevrons to indicate target input mode. I used the purple one picture above. I have included a fritzing diagram above which illustrates an example of how to connect 4 of these sorts of OLED's to an Arduino UNO, although it is the same for 7 OLED's and the MEGA.
Sound playback
I wanted a module which would handle all the play back of music segments. I wanted it to be simple to use/implement and play at decent quality and volume. The DY-SV8F module pictured above seemed an obvious choice. It plays up to 255 MP3 or WAV files, 10 files which are directly triggered by a logic LOW signal at one of it's input pins. A microSD card was loaded with 7 music MP3 files each about 20 seconds long (cut down and faded in/out using Audacity). 769