Sparkle Motion: an LED World Map Driven by Global Twitter Traffic Data

by Kinoma in Circuits > LEDs

2888 Views, 53 Favorites, 0 Comments

Sparkle Motion: an LED World Map Driven by Global Twitter Traffic Data

DSC01461.JPG

We built a Twitter light which changes its flicker behavior by monitoring global Twitter traffic. 50 LEDs are embedded behind a large, translucent white acrylic board and form a map of the world with the blue vinyl sticker attached on the board. This map becomes a low-res display for illustrating global Twitter traffic.

Tweets containing specific keyword trigger a ripple on the map based on their geological locations. Also, brightness is used to indicate traffic load, so that the overall brightness of the map indicates the Twitter traffic load and also areas with bigger Twitter traffic are brighter than others. User can type in the keyword using Kinoma Create’s touch screen and tweets containing the keyword are shown on the screen in real time.

Parts List:

The core part list for this project is small. We need PWM driver breakouts to enable Kinoma Create to control 50 LEDs in the PWM manner. Transistors are used to drive the LEDs with separate power supply.

Code Snippets

Screen Shot 2015-07-29 at 11.29.48 AM.png
Screen Shot 2015-07-29 at 11.29.58 AM.png
Screen Shot 2015-07-29 at 11.30.09 AM.png

To poll the tweets stream, we use handler.download() method to set up a socket. Whenever the tweet data is received, the data will be passed as chunks to onReceive() method. Http requests are authorized by the accessTocken we hard code as variables.

This label shown on the top of the screen is for typing in the keyword. Once the label is touched, a keyboard will pop out. Transition is used to switch between the mainScreen and the keyboardScreen.

The onChanged method runs a one-shot BLL call to set all LEDs according to the values of elements stored in the value_array. 0x40, 0x41, 0x42 and 0x43 are the addresses of the chained PWM breakouts. The setPWM function in the BLL library uses I2C communication to update registers in the breakouts in order to change the output and control the brightness of the LEDs.

Prepare Materials and Tools

DSC01292.JPG
DSC01304.JPG
DSC01327.JPG
DSC01351.JPG

The materials we need are a frame, the acrylic sheet and a transparent blue vinyl film. The tools we use are a nicking tool, a bottle of liquid glue, a hot glue gun, and a ruler.

We print the world map and cut the vinyl film according to the map. In this design, we cut the continents out and leave the oceans on the map. After that, we glue the sticker on the acrylic sheet.

Wire the LEDs

wiring-1000w.png
DSC01364.JPG
DSC01369.JPG

Insert all 50 LEDs into the back of the frame and wire them according to the schematic diagram below.

Each PWM driver can control up to 15 LEDs, so we used 4 to cover all 50 (12, 12, 12 and 14). We illustrate how one of the LEDs would be wired on one column of the driver and how you can chain the drivers together. We only show two in the illustration, but note that there are four in our real implementation.

Wrap It Up!

sparkle.JPG

After we finish all the above steps, we assemble all parts together and upload the program to the Kinoma Create. Now, the light is monitoring the entire Twitter world!

Congratulations!
You’ve done it! Or if you got stuck along with way, we’re here to help — come visit us at our forum and let us know how we can help.