Introduction: DIY Garage Gym Timer

I recently finished a DIY garage gym clock powered by an

Arduino micro controller and accessorized with a fire alarm bell for start and stop cueing. So far it’s been working great!

Why? I wanted to build a timer/stopwatch rather than use a smart phone app. #1 for the challenge, and #2 to have a dedicated portable, or, semi-permanent clock.

When I searched online for similar Arduino-based projects, the closest I could find was a project called the “Griz 9000” which looked exactly like what I was looking for, except the display was a little larger than I desired and looked like it required a bit more programming work.

Step 1: Building Steps and Design Goals

Building Steps

These are the high level steps you will generally follow to complete this project. This may vary depending on your experience, parts you have on hand, etc.

  1. Read and understand all the steps.
  2. Acquire the parts and tools.
  3. Build the test circuit. This includes some minor soldering required to assemble the display.
  4. Upload Arduino code to the test circuit.
  5. Test functionality.
  6. Final assembly. Fitting the Arduino, display and everything else into your chosen container.

Design Goals

  • Stopwatch Function
  • Countdown Timer Function
  • Tabata Program Function
  • Buzzer or Bell
  • IR Remote Control

Step 2: Gather Parts

Step 3: Gather Tools

  • Soldering Iron
  • Solder
  • Wire
  • Wire cutters
  • Wire strippers
  • Screwdrivers
  • Drill and bits
  • Jigsaw and metal cutting blade
  • Pliers
  • Hot glue gun and glue sticks
  • Electrical tape

Step 4: Build the Circuit (Breadboard)

Attached is a picture of the circuit diagram. You can see the digital and analog pins I used on the Arduino for each component (really tiny lettering in white). You don’t have to use the exact pins, but if you change them, they must be changed in the Arduino program as well.

I highly recommend first building this using a breadboard and temporary wiring to see if it actually works before committing to final soldering and assembly. If this is your first adventure with Arduino, I recommend starting with something like this Starter Pack from www.adafruit.com to get your hands dirty and get your computer set up to be able to successfully program the Arduino, meaning being able to get code from your computer to the Arduino via a USB cable.

Step 5: Program the Arduino

Just gimme the code and let me try it out: OK, here it is on GitHub (make sure you have dependent libraries installed – see #1 below): https://github.com/wagraeme/garage-gym-timer

For a little more detail, but not too much in the weeds:

I won’t go into too much detail about the code, just try to highlight my thought process, functions used, and things to watch out for. The code is a conglomeration of snippets and pieces built from trial and error, various tutorials, and lots of Googling. I wanted to keep it as simple as possible, extensible in the future, and based on a Finite State Machine (FSM), menu-driven model.

Starting at the top:

  1. There are 4 include statements at the top of the sketch (aka program – “sketch” in the Arduino world). You will need to ensure you have the correct libraries installed referenced by these include statements. Work through the Adafruit tutorial on installing libraries – very helpful!
  2. I defined various ‘states’, ‘actions’, and ‘events’ for my rudimentary ‘menu/settings’ system for the IR remote. By the way, you can use any remote you want, you just need to discover the specific IR codes when buttons are pressed. Start with this guide if you’re curious about this: Using an Infrared Library on Arduino
  3. Define pins used on the Arduino for the IR receiver and solenoid.
  4. Define other global variables like start/stop flags, duration between bell dings, display brightness, etc.
  5. Setup loop. This is a loop run just once when the Arduino first boots up.
  6. Main loop. The main loop runs continuously while the Arduino is powered on. The main loop for this project is a switch statement with about 10 or so case statements mapping to the ‘menu’ system.
  7. Define all the functions used in the case statements in #6 above. For example, the start stopwatch function, stop stopwatch function, start timer, stop timer, etc.

That’s pretty much it for a high-level description. There are some comments in the code where I try to explain the major pieces as well.

Step 6: Testing and Final Assembly

After your circuit works on a breadboard with the code uploaded into the Arduino, it’s time for final soldering, testing, and assembly.

There was a lot of sketching with a pencil and trial and error on the ammo can to see where the final parts would fit, namely the display and the bell. I cut a hole for the display on the far left of the ammo can near the top to leave room on the right side for the bell. I used sprinkler tubing slit lengthwise to cover the exposed metal and provide a border for the display. The metal edges are very sharp – be careful! You should file them down after cutting or drilling to prevent slicing your fingers.

Step 7: Remote Control Menu System

Description of the 'menu' system:

  • Upon initial power on of the timer, a lower case 'm' will display in the left 2 digits of the display.
  • At this point there are three valid inputs from the remote control (press '1', '2', or '3'), then subsequent options below:

  1. Stopwatch function. Displays a number 1 in the right-most digit of the display
    1. press 'back' to return to the main menu
    2. press 'play' to start the stopwatch
      1. press 'stop' to stop the stopwatch
      2. press 'play' to start again
      3. press 'back' to return to the stopwatch menu
  2. Countdown Timer function
    1. press 'up' arrow to increment minutes (up to 99)
    2. press 'down' arrow to decrement minutes (down to 0)
    3. press 'enter' to set the minutes to countdown. 'SET' will be displayed in the display
    4. press 'play' to start the timer
      1. press 'stop' to stop the timer
      2. press 'play' to start again
      3. press 'back' to return to the timer menu
  3. Tabata timer function. This times 20 seconds of work and 10 seconds of rest and keeps track of the round of work/rest
    1. press play to start the tabata timer
    2. press 'stop' to stop the tabata timer
    3. press 'play' to start again press 'back' to return to the tabata timer menu