StressZONE

Made by Grae Prickett, Christian Baca and epeprah

Found in Ambient Affect · UNLISTED (SHOWN IN POOLS)

0

Overview:

StressZONE is an ambient IoT product to help monitor incoming emails in turns to hopefully reduce stress. The StressZONE delivers a spinning light source indicating when you are receiving emails and how many emails you have. If the spinning light is spinning at a rapid pace you have several emails (over 5). It spins rapidly to mirror the emotion of your head spinning out of control under stress. When the spinning light is moving at an amble pace, the amount of emails you have is very little. By being able to see the spinning light in your peripheral vision, you can know when it is time to check your email without constantly wondering how many emails you have, and if you should do the daunting task of opening up your inbox. Once your emails are read, you simply press the button to reset the StressZONE. By inducing stress through rapid light motion, we hope to forward your thinking about checking emails and being up to date so you don't have moments of being overwhelmed. 


Process:

  • Set up the IFTTT for when Elvin receives an email.
  • Used Breath.ino code to get the neopixel ring to breathe when no new emails have been                received.
  • Error: build didn’t produce binary.
  • Only had neopixel.h, not neopixel.cpp in Breath folder.
  • Then were able to get half of the neopixel ring to light up.
  • Used the Colorchase.ino code to get the the neopixel ring to light up and circle when emails          1 – 5 came in.
  • The code was working by going from breathing when no emails were received to the                        colorchase when emails 1 – 5 were received through IFTTT.
  • Add button and wrote code for it to reset the program manually once the user checks their            emails.
  • After several attempts of trying to find errors in our code, it turned out we had two neo                  pixels that had errors of their own. Used a third neo pixel and everything worked out great!


Bill of Materials:

  • 1 Particle Photon
  • 1 Neo-Pixel LED
  • 1 Breadboard
  • 5 Wires
  • Button
  • Foam Core


0
StressZONE Process Video
Grae Prickett - https://www.youtube.com/watch?v=FOccJbHba0M&feature=youtu.be
0
StressZONE Step Back Video
Grae Prickett - https://www.youtube.com/watch?v=Q7CzTSesgWM&feature=youtu.be
0
/*This program will alert the user that there is an increase in incoming emails
through lights and speed of a neopixel, it can be reset by pushing a button*/

#include "neopixel.h"
#include <math.h>

// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIXEL_PIN D0
#define PIXEL_COUNT 24
#define PIXEL_TYPE WS2812B


int status = 0;
int pixel_position = 0;
int btnState = LOW;// initialize the button
int btn = D1;//Led btn

//No new emails, breathe

// IMPORTANT: Set pixel COUNT, PIN and TYPE
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);

void setup() {

  Serial.begin( 9600 );

  strip.begin();
  strip.show(); // Initialize all pixels to 'off'

  pinMode(btn, INPUT_PULLUP);

  Particle.subscribe( "diot_breathe", emailcheck );

}


void loop() {

  TurnOn();

  if(status < 1){
    breathe();
  }

  else if(1<=status<2){
    colorchase();
  }

  else {fastcolorchase();
  }

  delay( 50 );

  Serial.println (status);
}


void emailcheck(const char *event, const char *data){

    status = status+1;
    }


void TurnOn()
    {
     // find out if the button is pushed
     // or not by reading from it.
     int currentButtonState = digitalRead(btn);
     if( currentButtonState == LOW && btnState != currentButtonState ){
         status = 0;
     }
     btnState = currentButtonState;
    }

/* Calc the sin wave for the breathing white led */
float breathe() {

  float val = (exp(sin(millis()/2000.0*M_PI)) - 0.36787944)*108.0;
  Serial.println( val );

  uint16_t i;
  uint32_t c = strip.Color(val, val, val);

  for(i=0; i< strip.numPixels(); i++) {
    strip.setPixelColor(i, c );
  }
  strip.show();

}


int colorchase() {
  for(int i=0; i< strip.numPixels(); i++) {
    uint32_t c;

    if( pixel_position == i ){
      c = strip.Color(50, 255, 10);
    }else{
      c = strip.Color(0, 0, 0);
    }
    strip.setPixelColor(i, c );
  }
  strip.show();

  pixel_position++;
  if( pixel_position >= strip.numPixels() )
  {
    pixel_position = 0;
  }
}


int fastcolorchase() {
for(int i=0; i< strip.numPixels(); i++) {
  uint32_t c;

  if( pixel_position == i ){
    c = strip.Color(255, 0, 0);

  }else{
    c = strip.Color(0, 0, 0);
  }
  strip.setPixelColor(i, c );
}
strip.show();

pixel_position++;
if( pixel_position >= strip.numPixels() )
{
  pixel_position = 0;
}
}

//0 - 5 emails, increases by one dot for each email up to 5

//5+ emails, increase speed/change color

//Check emails, press button to reset*/
Click to Expand
0

Outcome

In the end we ended up being very successful in making our StressZONE prototype come to life. After having two neo pixels fail on us, we were able to figure out it was our code but actually the neo pixels! Figuring out how to coordinate the breathing with the colorhcase was probably the most stressful part of the whole coding process. We were able to hook up the emailing portion quite easily, and had success early on with the colorchase connecting to the emails as well. What stumped us was when we tried to incorporate colors and speed of the colorchase. We enjoyed working on it together as a team, and even during stressful moments we found reasons to laugh. We hope in the end StressZONE will help people be more proactive about checking emails so that anxiety doesn't set in from an overwhelming amount of emails we can all receive sometimes. 

0
Circuit Diagram - Schematic
Screen shot 2017 02 08 at 4.39.36 pm
x
Share this Project

This project is only listed in this pool. Be considerate and think twice before sharing.


Courses

49-713 Designing for the Internet of Things

· 26 members

A hands-on introductory course exploring the Internet of Things and connected product experiences.


About

~

Created

February 6th, 2017