Happy Tile

Made by Shaan

Ever had something online bring your mood down? Something so irrelevant that it has nothing to do with you but just reading it brings you down? Well, Happy Tile is a product that can give you a precautionary warning about the already so negative political environment so you don't even have to go online.

Created: March 24th, 2017

0
0
int happyled = D0;
int timer = 0;
long currentTime = 0;
long previousTime = 0;

void setup()
{
  pinMode(happyled, OUTPUT);

  Particle.function("happyfunc", happyfunc);

  Serial.begin(9600);

  digitalWrite(happyled, HIGH);
  delay(2000);
  digitalWrite(happyled, LOW);
  delay(2000);
}

void loop() {
}

int happyfunc(String args) {
  currentTime = millis();
  if(currentTime - previousTime <= 15000) {
    for(int i = 0; i < 10; i++) {
      digitalWrite(happyled, HIGH);
      delay(200);
      digitalWrite(happyled, LOW);
      delay(100);
    }
  }
  else{
    for(int i = 0; i < 5; i++) {
      digitalWrite(happyled, HIGH);
      delay(600);
      digitalWrite(happyled, LOW);
      delay(200);
    }
  }
  previousTime = currentTime;
  return 1;
}
Click to Expand
0

Problem Statement:

Since the start of campaigning, there has been an increase of a lot of negative news. Going online brings negative aspects of the world 'right to your fingertips!'. Many times, we even hesitate to read the news when we are engaged in something else because it will bring us out of the moment and into a gloomy awareness like mood. I wanted to measure the overall positivity of news (political news) by measuring the amount of times the word "bipartisan" and other positive words such as "succeed" and "accomplish" were published on Wikipedia.

Goal:

The goal of this project was to make an ambient device that quietly portrays complex news online into a simple light that is quickly glance-able and readable by the user in the physical world. When there is no usage of the positive key word, the light remains off. If there is a mention within the last 15 seconds on Wikipedia edits, the light blinks slowly. And if there is more than one mention of the positive key word then the light blinks very fast. That way, the tile would show the user whether to even go online or not and the read positive/negative news. 

Process:

The hardware aspect of this project was rather simple, as the only components required were the breadboard, Photon, USB cable, LED light, Resistor, Wire cable, and the 3D printed tile. Connecting the components together into a workable LED light was simple, though the 3D printed tile took a little bit of time since it was designed on Blender. The tile did fail to print the first two times because the boolean function on Blender was essentially 'garbage in, garbage out', so the tile had to be made from only python code. 

The software side of this project was much harder as it got very complicated. The code at first was very over complicated as I used a timer function that used modular to determine whether how many times within an interval the function was called. The code also determined this by using the particle publish function and determining how far apart the events were published from each other by the timer function. Yeah, overcomplicated and not correct. The old function on the code also had a function within a function which would set a timeout and look at the arguments called to determine the rate of data collected. After Jessie's help, the TA, we were able to simply the code substantially to what it is above. The only problem with the code above is that the function previous time = current time, and does not account for the time lost because of how long the light blinks, but this is very very minor and not needed. The coding definitely took a very long time and was very difficult for me, but Jessie helped a lot and was able to teach me and guide me through the psuedo-code  and details. 


Outcome:

The project looks good, and the light blinks bright enough to see from a distance, say from your bed to your bedroom wall. The problem with the product was that the rate of edits on Wikipedia with many of the keywords used to test were not as fast as I had hoped, thus the light would not blink. Maybe this just means that there is a lot more negative news that positive news out there and we should just stay off our phones :-). 


Reflection:

This was one of my first times coding so definitely that was difficult, but just like the last times I learned a lot more than I anticipated. I learned from doing this project that it gets easier and easier as you progress and get more in the hang of things. I wish I had a more appealing interface for the ambient object rather than just the 3D printed tile. Jessie's help was much appreciated and he really helped a lot with many parts of the code. Something I would do different is to include an API for specific news sites rather than wikipedia that filters through specific words. I liked the idea of the Ifttt having you choose simple key words because then the user of the product could change keywords just depending on what she would like to physically see in the moment. I had a lot of fun and was definitely intellectually challenged doing this project. 

x
Share this Project


About

Ever had something online bring your mood down? Something so irrelevant that it has nothing to do with you but just reading it brings you down? Well, Happy Tile is a product that can give you a precautionary warning about the already so negative political environment so you don't even have to go online.