Tech & Stock News

Made by James Katungyi

Alert on important NYT tech news and SP500 technology stock indices

Created: February 17th, 2017

1

Intention

Write about the big ideas behind your project? What are the goals? Why did you make it? What are your motivations?

In the face of news avalanches and our own curiosity, one could spend hours reading useless information and regreting the wasted time. The Tech&Stock News ambient display alerts about select news items by subject and popularity on one hand and about trends in Technology Stock indices on the other hand. 

Tech&Stock News assumes that any worthwhile Tech news will be published in the New York Times, Technology section. It monitors major Tech stock indices on the S&P500. Significant index changes are likely to be caused by important news. And so, if Tech&Stock News is brightly lit on both the news and stock displays, there is important news in the Technology sector. If the display is dark, one need not bother with news sites - there is nothing about Technology worth reading at the moment.

0

Context

Describe what informed your ideas and your outcome? How does your outcome relate to other work in the field? What are the precedent projects?

The idea behind 'Tech&Stock News at a glance' is how to use ambient displays to ensure that one never misses important news when it happens and yet does not waste hours monitoring news sites.

We are not aware of similar ambient works. While other news alerts (like flashing notifications on computer screens) may use filters for select items, the Tech&Stock News display filters by two criteria and does not display the details, thereby allowing one to ignore it when convenient.

0

Process

Outline your approach to the project? What ideas did you generate and how did you refine or reject them? What did you research and explore? what were the design choices? What challenges were encountered and how did you resolve them?

The approach was two fold: 1) filtering news and 2) filtering stocks.

Filtering news was the easy part. Using IFTTT's New York Times applet, we selected the publication of a popular Tech article as a trigger that would activate an output pin on the particle photon. The output pin would in turn light up LEDs on the news section of the display. The light brightness  values range from 0 to 255. Every trigger raises the LEDs light values by 10 for 2 seconds, then values start falling by 5 till 0.

Filtering stock indices was the demanding part. The SP500 stock indices were scrapped from the yahoo Finance website using python. The index values were relayed to the Maker IFTTT applet as the trigger. When the stock index falls, the applet activates a pin to red LED lights. When the stock index rises, the applet activates a pin to the green LED lights. Each trigger moves the increase the LED light values by 10 for 1 second, after which it starts falling by 5 until 0.

The main challenge in the project was scrapping the index values.

0

Product

Detail what you created. What methods or techniques did you use? What tools and technologies were involved? Include images, code or video.

The Tech&Stock News at a glance device is a 6" long by 3" wide by 2" deep black box with a micro-chip shaped front face. The front face has two back lit icons set against the white background of the middle plate - one each for news and stocks. LED lights connected to the particle Photon are fixed below the white middle plate such that when they light up, the diffused colors are visible through icons. The red and green LEDs light up the stock icon while the yellow LEDs light up the news icon. The assembly was designed in Illustrator and laser cut out of 1/8" acrylic. The photon is powered through a micro USB cable to a USB power source like a laptop.

When first connected, all LEDs light up for 1 second. Then it goes dark. Whenever a tech news item is published, yellow lights increase in brightness by 10 for 1 second then start to decay by 5 for every second thereafter. An increase in stock indices lights up the green LEDs by 10 for 1 second after which they decay by 5. A decrease in stock indices lights up the red LEDs in the same way.


0

Reflection

Reflect on the process of making this project. What did you learn? What would you do differently?

In our overloaded information age, making one's own ambient display is a discovery of the subtle yet powerful possibilities of filtering what one wants to see and when one wants to see it. The ambient display need not be only functional, it can be art. Arguably, the aesthetic potential alone largely justifies such a device.

For our device, the sleek-black-microchip-shaped front face serves as a necessary frame for the interior lights but also as a decorative device that one could place next to such things as indoor flowers and family photographs. The changing lights make the device alive distinguishing it from the other inert decorations.

We learnt to use scrapped data to trigger secondary actions as alerts and to use applets in ifttt. At a more basic level, laser printing for the first time was a revelation too. The process of putting the physical device together had its lessons too - mainly that prototypes of both code and design, need to be made at several stages before the final product is satisfactory.

In hind sight and with more time, we could have enclosed the device entirely in black to make the front display prominent. We could have used more lights and distributed them more evenly to create a more diffuse and glowing light effect. We could also have monitored it more to see the simultaneous effect of both the news and stocks triggers. As it is, there is no stock action on Saturday and Sunday which is when we monitored it.

0
int stock;
int greenled;
int redled;
int stockgreenled = D2;
int stockredled = D1;
int newsled = D0;
int newsbrightness = 0;

void stockdata(const char *event, const char *data){
  if(data){
    int stock = atoi(data);
    Serial.println(stock);
    if(stock>0){
      greenled = map(stock, 0, 500, 0, 255);
      analogWrite(stockredled, 0);
      analogWrite(stockgreenled, greenled);
      newsbrightnesscontrol();
      Serial.println(greenled);
    }if(stock<0){
      redled = map(stock, -500, 0, 255, 0);
      analogWrite(stockgreenled, 0);
      analogWrite(stockredled, greenled);
      newsbrightnesscontrol();
      Serial.println(redled);
    }if(stock == 0){
      greenled = 0;
      redled = 0;
      analogWrite(stockredled, redled);
      analogWrite(stockgreenled, greenled);
      newsbrightnesscontrol();
    }else{}
  }else{
    newsbrightnesscontrol();
  }
}

void setup(){
  Serial.begin(9600);
  pinMode(newsled, OUTPUT);
  pinMode(stockredled, OUTPUT);
  pinMode(stockgreenled, OUTPUT);
  Particle.function ("WhatsNew", nytMostPopular);
  Particle.subscribe("stock", stockdata);
  analogWrite(newsled, 255);
  analogWrite(stockredled, 255);
  analogWrite(stockgreenled, 255);
  delay(1000);
  analogWrite(newsled, 0);
  analogWrite(stockredled, 0);
  analogWrite(stockgreenled, 0);
}

void loop(){
  newsbrightnesscontrol();
}

int nytMostPopular(String WhatsNew){
  newsbrightness = newsbrightness + 10;
  if(newsbrightness>255){
    newsbrightness = 255;
  }
}

void newsbrightnesscontrol(){
  analogWrite(newsled, newsbrightness);
  delay (2000);
  if (newsbrightness >= 5){
  newsbrightness = newsbrightness - 5;
  }else{
    newsbrightness = 0;
  }
}
Click to Expand
x
Share this Project


About

Alert on important NYT tech news and SP500 technology stock indices