Micah's bloggy widget ([info]scanwidget) wrote,
@ 2008-12-01 23:39:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Lego Sky
Over the weekend, I had a chance to finish up a project that I started (and immediately became distracted from) several weeks ago.

In our house, Paul and I have a game room. This is where the video games live, as well as other assorted geekery. We have Magic cards, D&D books, some manga.. it's super nerdy :)

Best of all, Paul has a Lego city on display. We had been looking for an interesting way to add light to the city, so when I saw some RGB LED light strips for sale at Ikea, I knew I had to mod them. In their stock configuration, these light strips can do boring fully-saturated colors, and you switch between them with a boring push-button switch.

After ripping apart the Ikea light and rummaging through my junk drawers, I came up with this:

Touchpad DIODER in action

The Altoids tin has the modified driver circuit: It's the original circuit board with the microcontroller removed, then a homemade Arduino clone to control it. The orange box is an old Cirque PS/2 touchpad, removed from its original case and covered in fabric.

The Arduino sketch (firmware) is a little C++ program that reads the touchpad and uses it to control Hue and Lightness in the HSL color space. The result is a pretty intuitive and unobtrusive control which makes it easy to both pick a color and desaturate it toward white or dim it toward black. You can easily get some really nice sunset and sky colors.

I measured the power consumption of the completed light at between 1 and 6 watts. With Bay Area electric rates, this means you'd pay about 7 cents a month to leave it plugged in with the lights fully off, twice that to constantly backlight your Lego city in a dim orange glow, and a maximum of 50 cents a month to run the light at full brightness continuously.







For many more pictures of the final installation and the build process, check out my Ikea DIODER set on Flickr.



(Post a new comment)

bad ass
(Anonymous)
2008-12-02 09:13 am UTC (link)
I ♥ you

(Reply to this)


[info]malconstant
2008-12-02 07:50 pm UTC (link)
Dang. I just put together my own HSL LED controller, my first significant Arduino sketch. My first attempt uses a trio of potentiometers, but I was hoping to eventually use a touchpad. I guess there really isn't anything new under the sun (or, in this case LEDs).

My implementation has an unpleasant degree of flickering when adjusting hue... since I do a quick-and-dirty oversampling of the potentiometers, I attribute this 'noise' to floating point precision errors. Your HSL/RGB math looks pretty similar to mine (also from Wikipedia)... have you had the same experience?

In any case: bravo!

(Reply to this) (Thread)


[info]scanwidget
2008-12-02 08:48 pm UTC (link)
Thanks! Great minds think alike? ;)

I haven't noticed any flickering per se, though it does suffer from limited resolution near the high and low end of the luminance range. That's probably entirely due to the 8-bit PWM, though. One of the software changes I'd like to make in the future is to improve the PWM resolution. Maybe 12-bit? I have plenty of CPU cycles to burn on an interrupt-driven PWM routine.

--Micah

(Reply to this) (Parent)(Thread)


[info]malconstant
2008-12-02 09:13 pm UTC (link)
A general-purpose, 10b software PWM library would be handy, as it would match the precision of the ADC. A lot of projects seem to use potentiometers to control PWM output in one way or another.

I have yet to look into AVR/Arduino interrupts myself, but it's on the to-do list. I'll also have to check out PS/2 on the Arduino... I used a hacked PS/2 mouse as wheel encoders (and go/stop button) on a little Propeller-based robot and it worked quite well.

(Reply to this) (Parent)(Thread)


[info]scanwidget
2008-12-02 11:38 pm UTC (link)
Cool. I'll definitely post the generic PWM library if I end up writing it. Seems like the kind of thing that a lot of Arduino hackers could use. I'm still getting used to the Arduino culture myself- this is my first Arduino project. I come originally from a PIC background, and more recently I've been using AVRs and the Propeller for most of my projects. I love the Propeller :)

--Micah

(Reply to this) (Parent)

Balu
(Anonymous)
2008-12-02 09:17 pm UTC (link)
Those are common RGB diodes?

I always wondered, because I was not really able to identify the possible color combinations with the auto-switching examples at ikea...

(Reply to this) (Thread)

Re: Balu
(Anonymous)
2008-12-02 09:20 pm UTC (link)
Also what the heck is the buzzer for in the original layout?

(Reply to this) (Parent)(Thread)

Re: Balu
[info]scanwidget
2008-12-02 11:35 pm UTC (link)
Yep, they're common RGB diodes. The light strips themselves are fairly typical 12-volt modules with integrated current limiting resistors. In the standard configuration, the LEDs are normally full-on or full-off (8 colors possible), but even the stock microcontroller does have a mode which uses PWM to fade between colors in a pre-set way. With your own microcontroller, you can do much fancier things with PWM.

The buzzer in the original control box was just used to get audible feedback for the mode you're in. You would press the button to cycle through modes, and it would beep each time to indicate which mode it's in.

--Micah

(Reply to this) (Parent)(Thread)

Re: Balu
(Anonymous)
2008-12-02 11:58 pm UTC (link)
Thanks a lot for the fast reply. Looks like they are perfect for modding :)

(Reply to this) (Parent)


[info]jeffspender
2008-12-03 06:18 am UTC (link)
Man, if I knew this was going to hit the Make blog I would have actually built something cool instead of just throwing some basic sets up there. Caught with my LEGO pants down!

Still, you continue to be the best boyfriend evar. <3

(Reply to this)

Just what I was looking for!!!!
(Anonymous)
2009-02-02 08:09 pm UTC (link)
I have been looking to do the same thing for one of my on going projects. Thanks Dude!!!

Jim (Xbox 360 King)Jackson (”http://www.evilcontrollers.com”)

(Reply to this)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…