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.
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.
- Download Kinoma Studio
- Kinoma Create
- 16-Channel 12-bit PWM driver (x4)
- General Purpose NPM Transistors (x50)General Purpose NPM Transistors (x50)
- 5mm LEDs (x50)
- DC Barrel Jack Adapter
- 5V power supply
- 100 ohm resistors (x50)
- 1k ohm resistors (x50)
- Breadboard jumper wires
- 28" × 15" × 0.125" translucent white acrylic sheet
- Blue vinyl sticker
- Photo frame
Step 1: Code Snippets
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.
Step 2: Prepare Materials and Tools
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.
Step 3: Wire the LEDs
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.
Step 4: Wrap It Up!
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!
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.