Paired with a sensor, your "mood cube" can change color based on any number of outside stimuli

Mood Cube - Arduino + BlinkM An Arduino & BlinkM installed inside a photo frame cube. Dave Prochnow

Ambient technology is the current rage for presenting information in a unobtrusive and, sometimes, sublime manner. Information suited for an ambient format ranges from complex number-laden data streams to simple one- or two-digit numbers. The idea here is that you can glean the same information by simply looking at the color of a cube, rather than consulting a sensor's text output.

While this project doesn’t directly take advantage of ambient technology, it does show you a great method for generating a simple color-changing LED that can be integrated into any number of projects. By combining the open-source Arduino microcontroller circuit board with a “smart” LED called BlinkM, you can build a simple mood cube that randomly generates a spectrum of sumptuous colors.

By pairing a sensor with this Arduino-based mood cube to input data, you can create a more ambient-like experience:

  • Ambient Mood Cube - Install an ultrasonic motion detector and have the cube change its color due to your personal proximity. Kinda like a colorful greeting for a close encounter.
  • Interactive Ambient Art Cube - Add an accelerometer and create a cube that changes its color based on X-Y-Z orientation. Play with it, toss it around; the color changes due to your movements.
  • Weather Cube - Connect a barometric pressure sensor to the Arduino and program specific color changes for different barometric pressure readings. For example, make high pressure green, low pressure red, rising pressure, blue, and falling pressure yellow.

Time: 1 hour
Difficulty: Easy
Cost: $73.86 [Battery-Powered Version]

Parts

Power Options

Steps

1. Cut six 2 ¾-inch squares of self-stick matte paper. Apply each square to one window of the photo frame cube.

2. Plug the BlinkM LED into the analog pins 2-5 of the Arduino USB board.

Mood Cube - Power Supply: A DIY 9V power supply for the Arduino-based Mood Cube.  Dave Prochnow

3. Determine which power option you would like to use. If you select the battery option, solder the 9V battery snap connector to the 5.5/2.1 Coax plug. Alternatively, you can power your color mood cube through the USB port of your PC.

4. Program the Arduino board with our sketch code. This code will occupy approximately 4584 bytes of Arduino’s flash program space.

5. Plug the 9V battery into the Arduino board. Move the Arduino power supply selection jumper to the EXT position. Install the board inside the cube. Bask in the vibrant glow of your continually changing color cube.

Mood Cube - showing its colors: An approximately 2-minute run of a "random" color sequence from the Mood Cube.  Dave Prochnow

Arduino Sketch Code:

Here is the program used to generate random colors for the BlinkM LED.

/*======================= * le Color Cube * 26 Feb 08 * Derived from BlinkM code * @ http://thingm.com/products/blinkm.html * BlinkM * Arduino Diecimila *======================= */ // BlinkM connections to Arduino // PWR - -- gnd -- black -- Analog Out 2 // PWR + -- +5V -- red -- Analog Out 3 // I2C d -- SDA -- green -- Analog In 4 // I2C c -- SCK -- blue -- Analog In 5 // Note: This sketch resets the I2C address of the BlinkM. #include "Wire.h" #include "BlinkM_funcs.h" #define BLINKM_ARDUINO_POWERED 1 //New BlinkM address int blinkm_addr = 0x10; //Color variables; red, green, & blue, will be assign a random value long red = 0; long green = 0; long blue = 0; void setup() { //Random noise on Analog Pin 0 will set a random number seed randomSeed(analogRead(0)); //Setup BlinkM: pins, address, script halt, fade speed BlinkM_beginWithPower(); BlinkM_setAddress(blinkm_addr); BlinkM_stopScript(blinkm_addr); BlinkM_setFadeSpeed(blinkm_addr,2); } void loop() { //Seed red with a random value red = random(257); BlinkM_fadeToRGB(blinkm_addr, red, green, blue); delay(5000); //Seed green with a random value green = random(257); BlinkM_fadeToRGB(blinkm_addr, red, green, blue); delay(3000); //Seed blue with a random value blue = random(257); BlinkM_fadeToRGB(blinkm_addr, red, green, blue); delay(5000); }
Want to read more articles like this, plus tips and tricks, home hacks, DIY projects, and more? Subscribe to Popular Science today, for less than $1 per issue!

7 Comments

That's very interesting. It's like a mood ring only more expensive and bigger.

Would it be possible to integrate the Motion Detection Module - MSP430F2013 from SparkFun Electronics into the cube somehow? I think that motion detection would add a nice affect to this in some way. The cube itself is a great first time project, and has a lot of expandability.

I'm not an electronic whiz I tried to put this together for my son's Science project but it's not working the Blink M is not turning on. Help!!!!

Your sketch worked great for a while, then I started getting this error message at:

"// Note: This sketch resets the I2C address of the BlinkM."

26:error: BlinkM_funcs.h: No such file or directory

maybe someone can help.

Hello,

I'm looking to use a Pressure Sensor with the Arduino. Which barometric pressure sensor did you use for this project?

Thanks!

if i run this program 24/7 with a 9v battery how long will it last for? any idea?

Hi Dave! I Love your article! I decided to try it myself, but the Arduino Decimilia was discontinued. Will this program work on the Uno? Write me back please - Thanks, Max

Popular Tags

Regular Features


140 years of Popular Science at your fingertips.



Popular Science+ For iPad

Each issue has been completely reimagined for your iPad. See our amazing new vision for magazines that goes far beyond the printed page



Download Our App

Stay up to date on the latest news of the future of science and technology from your iPhone or Android phone with full articles, images and offline viewing



Follow Us On Twitter

Featuring every article from the magazine and website, plus links from around the Web. Also see our PopSci DIY feed


February 2013: How To Build A Hero

Engineers are racing to build robots that can take the place of rescuers. That story, plus a city that storms can't break and how having fun could lead to breakthrough science.

Also! A leech detective, the solution to America's train-crash problems, the world's fastest baby carriage, and more.



Online Content Director: Suzanne LaBarre | Email
Senior Editor: Paul Adams | Email
Associate Editor: Dan Nosowitz | Email

Contributing Writers:
Clay Dillow | Email
Rebecca Boyle | Email
Colin Lecher | Email
Emily Elert | Email

Intern:
Shaunacy Ferro | Email

circ-top-header.gif
circ-cover.gif
bmxmag-ps