This Instructable will show you how to set up triggers and make a lamp that lights up and saves money as you meet benchmarks in Hal Higdon's Intermediate Half Marathon Training Schedule. To do this, you'll first want to gather the following materials:
- Soldering iron
- Hot glue gun
- Laser cutter
- 12 Adafruit Neopixel compatible RGB LEDs
- Acrylic Sheets
- Assembled Feather HUZZAH w/ ESP8266 WiFi with Stacking Headers
- Acrylic Glue
- 4-wire strips (intercom wire)
Step 1: Step 1: Sign Up for IFTTT, Strava, Qapital, Adafruit Io, and Google Sheets
I used IFTTT (If This Then That) to create a chain of triggers to light up each of the LEDs. Of the available apps through IFTTT, I chose to use the following
Step 2: Step 2A: Create Strava to Google Spreadsheet Trigger
Once you've signed up for Strava, you'll create a trigger that logs the details of each run you complete on a Google spreadsheet.
Open the spreadsheet, which will be titled Strava Run Log in a folder automatically titled, "IFTTT" in your Google Drive. In it, you'll manually enter in the first 13 lines the data pictured. Maek sure that column J includes formulas as pictured. This makes it so that cells J1-J13 will change as you hit a certain number of total meters over time.
Step 3: Step 2B: Create Feed in Adafruit Io
In Adafruit io, click Feeds on the left column, Actions, and then Create a New Feed with the name of the feed that will collect data each time an applet on IFTTT (to be made in the next step) will send a value to your feed.
Step 4: Step 2C: Create 12 Applets for Each Benchmark
In this step, you'll create 12 separate applets for each time you hit a benchmark in the training schedule each week. In this case, it will be when you've ran the total number of meters each week. We'll track this by seeing if the cells in cells J1-J12 of the Strava Run Log in Google Sheets was updated.
For Week 1, set the trigger to monitor Cell J1 in the Strava Run Log. For Week 2 monitor Cell J2, and so on until Week 12 monitors J12. Set the Adafruit io trigger so that the "Data to save" is the week number (i.e. "1" for week 1, "2" for week 2, etc.). Each time you hit a certain weekly benchmark, the cells in each week will be updated, sending a certain value to your Feather Huzzah.
Step 5: Step 3: Edit Code and Upload!
First, make sure you have followed the instructions for Software set up from Becky Stern's page so your Arduino is ready to load code into your Adafruit Feather HUZZAH ESP8266
Download the file titled "PIGGY_BANK_INSTRUCTABLE_CODE" from this page and edit the rows under "Adafruit IO Configuration" so that they include your Adafruit io username, Adafruit io key, Wifi network (case sensitive), and Wifi password.
You'll also replace "yukorun" with the name of the feed you created on Adafruit io.
Then, upload the code to your Feather Huzzah!
Step 6: Step 4: Laser Cut Acrylic
Laser cut the following layers based on the desired shape of your lamp
- (top layer): 1 piece 1/8" transparent acrylic - in the shape of your piggy bank with etching for the details in your artwork. (Optional: Create a second layer on top in the shape of the features, like the nose)
- 1 piece 1/8" Opaque White acrylic - In the outline of the piggy bank
- 3 pieces 1/4" Opaque White Acrylic - In the outline of the piggy bank, with cutouts for each coin
- 1 piece 1/8" Transparent Yellow Acrylic - The shape of the coins
- 1 piece 1/16" Opaque White Acrylic - In the outline of the piggy bank, with cutouts large enough for the face of each LED
Using acrylic glue, glue each layer together. The yellow pieces from layer 4 should fit right inside the negative space that layer 3 creates. Use clamps to hold the layers together as they dry
**Make sure to use adequate eye protection and gloves when using acrylic glue!**
Step 7: Step 5: Solder Circuit
Now, onto soldering the circuit together!
Link the 12 RGB LEDs together in parallel making sure you solder power to power, ground to ground, and Din to Din. Make sure the beginning of the circuit has the arrow pointing to the 2nd LED in the circuit.
Hot glue the LED circuit to the board as pictured. Then, attach the wires to your feather huzzah board according to the circuit diagram
Your piggy bank lamp is now ready to be used!