Motif: the Motivational Clock

1,377

4

Introduction: Motif: the Motivational Clock

Ever feel like you're lagging throughout the day? Or maybe you worry that your friends and loved ones are feeling down or unmotivated? This DIY motivational clock is built to help solve both of those concerns! With a few tools and materials you can build your own Motif that will not only motivate you and your loved ones, but also look pretty snazzy on a shelf or table.

The clock has three major functions:

1. Tell the time

2. Send you motivation throughout your day via messaging or email

3. Send motivation to your selected contact(s) at the push of a button

Supplies:

Before we get started, here's what you'll need:

Hardware

  • ¼” Acrylic Sheet (Any Color)
  • Acrylic Glue or Adhesive
  • Arduino Feather Huzzah (https://www.adafruit.com/product/3213)
  • 7 Segment Display w/ Featherwing Backpack (https://www.adafruit.com/product/3106)
  • Push Button
  • Connecting Wires
  • Adhesive Wood Veneer

Software

  • Arduino Software (Free to download from their site https://www.arduino.cc/en/main/software)
  • An Adafruit IO Account (Sign up for IO here https://io.adafruit.com/)
  • An If This Then That Account (Sign up for IFTTT here https://ifttt.com/)

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Making the Clock Structure

  • Prepare a vector file with the design for your clock shape. I did a basic box (link for the downloadable Illustrator file here), but you could make it any shape you want, as long as all the electronics fit inside. I set up my design so that pressing down on the box will press a button that is hidden underneath, but you could also build the button into the exterior of the clock (or exclude it all together if you don’t want the “Send motivation” feature)
  • Acquire your acrylic sheet and load it into your laser cutter (make sure that your chosen sheet fits in the bed of your laser cutter in order to avoid extra work). I used a 24” x 36” sheet of ¼” thick acrylic so that I could cut all of my casing pieces from one sheet.
  • Once you have your acrylic pieces, use any acrylic adhesive that you have on hand to glue the pieces together. If you plan to wrap the clock with wood veneer as shown in this instruction, then you don’t have to worry too much about how the seams of your case look visually since they will be covered, but make sure that they are smooth to avoid a headache when you start applying your veneer.
  • From here you can either jump to the veneer portion of the process (Step 4), or you can continue to the next step of starting the electronics

Step 2: Building Your Circuit

  • Let’s start building the Arduino! First, gather your Arduino materials and make sure that your Featherwing backpack is properly soldered together and attached to your 7 Segment display (instructions on how to do this here)
  • Once you have that done, plug your 7 Segment display assembly directly into the top of your Feather Huzzah board by lining up the pins and pressing down evenly.
  • Once you have your 7 Segment display connected, you can install the necessary libraries per the instructions here, and run the test code to make sure your 7 segment display is working correctly.

Note: For the next step, I would recommend using a breadboard to test your button before soldering anything together (as shown in the circuit picture) so that you know it is functional before assembling your final circuit.

  • Wire the button between the pin labelled "SDA/4" on your Feather Huzzah and the common ground, as shown in the circuit diagram

Step 3: Programming Your Clock

  • Next is the code! Start by making sure that you have all the appropriate libraries and drivers installed (as described above)
  • I would recommend using the Internet of Things Class to practice the code and internet connections that are used here. It is extremely helpful for understanding how each of the components interact with each other.
  • First you'll need to set up a "Command" feed on your Adafruit IO channel. This will act as the communication point between your IFTTT actions and your Arduino actions.
  • Next, go into your IFTTT account and create three applets:
    • 1: If Adafruit -> Monitor a Feed on Adafruit IO -> Set "Relationship" to equal to and "Value" to 1, then Choose an emailing or messaging service of your choice and enter the motivational message you would like to send when the button is pressed (see list below for suggestions)
    • 2: If Date & Time -> Choose an interval, then Adafruit -> Send data to Adafruit IO -> Set "Data to Save" as 2
    • 3: If Adafruit -> Monitor a Feed on Adafruit IO -> Set "Relationship" to equal to and "Value" to 2, then Choose an emailing or messaging service of your choice and enter the motivational message you would like to receive at your chosen time interval
    • Note: In order to receive different messages throughout the day, you would have to duplicate applets 2 & 3 using a unique integer (3+, since 1 & 2 have already been used), and enter unique motivational messages for each set of applets
  • Once those are ready, copy and paste the code below or download it here.
  • That’s it, you’re ready to roll! Have fun being motivated all day!!
// Instructables Internet of Things Class sample code
// Circuit Triggers Internet Action
// A button press is detected and stored in a feed
// An LED is used as confirmation feedback
//
// Modified by Becky Stern 2017
// based on the Adafruit IO Digital Input Example
// Tutorial Link: https://learn.adafruit.com/adafruit-io-basics-digital-input
//
// Adafruit invests time and resources providing this open source code.
// Please support Adafruit and open source hardware by purchasing
// products from Adafruit!
//
// Written by Todd Treece for Adafruit Industries
// Copyright (c) 2016 Adafruit Industries
// Licensed under the MIT license.
//
// All text above must be included in any redistribution.

/************************ Adafruit IO Configuration *******************************/

// visit io.adafruit.com if you need to create an account,
// or if you need your Adafruit IO key.
#define IO_USERNAME    "PokeyPanda"
#define IO_KEY         "10323cf00be649f4a097ff455ae67b9c"

/******************************* WIFI Configuration **************************************/

#define WIFI_SSID       "Routers of the Lost Ark"
#define WIFI_PASS       "6ua_pp9GQ)"

#include "AdafruitIO_WiFi.h"
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
#include "Adafruit_LEDBackpack.h"

/************************ Main Program Starts Here *******************************/
#include 
#include 
#include 
#include 
#include 

Adafruit_7segment matrix = Adafruit_7segment();

#define BUTTON_PIN 4
#define LED_PIN 13

// button state
int current = 0;
int last = 0;

// set up the 'command' feed
AdafruitIO_Feed *command = io.feed("command");

void setup() {

//Sends manual readout to clock face
  boolean drawDots = true;
  matrix.writeDigitNum(0, 1);
  matrix.writeDigitNum(1, 0);
  matrix.drawColon(drawDots);
  matrix.writeDigitNum(3, 0);
  matrix.writeDigitNum(4, 3);
  matrix.writeDisplay();
  delay(500);

  // set button pin as an input
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  pinMode(LED_PIN, OUTPUT);

  // start the serial connection
  Serial.begin(115200);

  // connect to io.adafruit.com
  Serial.print("Connecting to Adafruit IO");
  io.connect();
  
  // set up a message handler for the 'command' feed.
  // the handleMessage function (defined below)
  // will be called whenever a message is
  // received from adafruit io.
  command->onMessage(handleMessage);

  // wait for a connection
  while(io.status() < AIO_CONNECTED) {
    Serial.print(".");
    delay(500);
  }

  // we are connected
  Serial.println();
  Serial.println(io.statusText());

}

void loop() {

  // io.run(); is required for all sketches.
  // it should always be present at the top of your loop
  // function. it keeps the client connected to
  // io.adafruit.com, and processes any incoming data.
  io.run();

  // grab the current state of the button.
  // we have to flip the logic because we are
  // using INPUT_PULLUP.
  if(digitalRead(BUTTON_PIN) == LOW)
    current = 1;
  else
    current = 0;

  // return if the value hasn't changed
  if(current == last)
    return;

  // save the current state to the 'command' feed on adafruit io
  Serial.print("sending button -> ");
  Serial.println(current);
  command->save(current);

  // store last button state
  last = current;

}

// this function is called whenever a 'command' message
// is received from Adafruit IO. it was attached to
// the command feed in the setup() function above.
void handleMessage(AdafruitIO_Data *data) {

  int command = data->toInt();

  if (command == 1){ //light up the LED
    Serial.print("received <- ");
    Serial.println(command);
     digitalWrite(LED_PIN, HIGH);
     delay(500);
     digitalWrite(LED_PIN, LOW);
  } else {
    Serial.print("received <- ");
    Serial.println(command);
  }
}

Step 4: Adding Veneer to Your Clock

  • The first thing you want to do is trace the shape that you'll need to cover your clock. In my case this was pretty simple because my shape was a basic cube, so I used a process similar to measuring wrapping paper for gifts. If your shape is more complex, this step might require a bit more strategy.
  • Before cutting out your shape, make sure to add an allowance of half an inch to an inch around the perimeter. This way you have extra if your edges drift at all and for covering corners, and you can always trim the extra as you're going using a sharp blade or scissors.
  • If you are able to, it is helpful to cut the backing (without cutting the veneer) at the corner seams so that it is easier to peel off as you're laying the veneer down.
  • Once the veneer is cut and prepped, choose a side to start from on your clock, peel the backing off the first couple inches of that side and line up the edge the veneer (Not including allowance!) with the edge of the clock structure. Carefully flatten the veneer out against the side of the clock, peeling the backing away as you progress. If you start to see air bubbles, stop and peel that section back up carefully to let the air out.
  • When you get to the far edge, press down more thoroughly and carefully starting from the middle of the seam and pressing out towards the corners. If you are not careful on the corners, they can trap some air and look wrinkled and sloppy.
  • Continue this strategy around the entire object, trimming excess veneer as necessary (but being careful not to trim too much before you know where your seams are going to land).
  • If your veneer is thin enough, you can leave it covering the LED display to have a clean unbroken surface when the clock is off, and the LEDs from the display with shine through when the clock is on. The veneer I used for this clock example was too thick to let light through, so I cut the veneer out using the laser cut hole in the clock face as a guide.
  • That's all there is to it! Now you have a simple, elegant object to keep in your apartment, house, or office that doubles as a tool for motivation.

Be the First to Share

    Recommendations

    • Magnets Challenge

      Magnets Challenge
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest

    Discussions