Home > BlinkM, DIY > Under cabinet lights with BlinkM MaxM

Under cabinet lights with BlinkM MaxM

The lights in my kitchen are somehow inconvenient. There are two entrances and the light switch is only at one of them, on the outside wall. Whenever I walk in from the living room and want to do something quickly I have to walk around to turn on the light. To solve this, I got an idea to build a under-cabinet light controlled by a motion sensor.

My first idea was to get an LED strip (like this one) and build a controller with ATTiny, PIR sensor, and a transistor to drive the LED’s. But one day I saw a BlinkM MaxM. It can drive RGB LED’s (12V, 2A) and can be programmed with color sequences. It also has 4 inputs so connecting PIR sensor is possible. It is perfect for my kitchen lights, except that it’s RGB. So I got:

I used 20 sections of the LED strip (60 RGB LED’s). Each color draws 1.2A which is below the maximum MaxM can drive. PIR sensor is powered from the MaxM board and the data pin is connected to input number 3.
I programmed BlinkM with an Arduino. Here is the BlinkM script:
// set fade speed
{0, {'f', 2, 0, 0}},
// go to white when movement detected
{0, {'I', 3, 50, 4}},
// loop black
{60, {'n', 0, 0, 0}},
{0, {'j', -1, 0, 0}},
// fade to white and stay on
{60, {'c', 0xff, 0xff, 0xff}},
// 1 minute (7 * 255 * 0.03333ms)
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
// 1 minute
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
// 1 minute
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
{255, {'n', 0xff, 0xff, 0xff}},
// loop black
{60, {'c', 0, 0, 0}},
{0, {'j', -1, 0, 0}},

 

The light fades in when I walk in and fades out after 3 minutes of inactivity in the kitchen. When I keep moving in the kitchen, PIR sensor keeps triggering and the 3 minutes renew, so the light stays on as long as I’m in the kitchen.

001-20120114

There are a few problems with the setup, which I’ll have to address:

  • RGB strip produces a reddish color. To get a warm white I’ll have to experiment with different settings.
  • BlinkM fades are not linear. I might re-write the script in assembly and re-programm the BlinkM.
Update, Jan 27, 2012:
I just changed the power supply from 9V to 12V. The red is gone and I have a bright cool white color, that is much better.
Categories: BlinkM, DIY Tags:
  1. No comments yet.
  1. No trackbacks yet.
*