Arduino Based PC Ambient Lighting

[royboy] from the Arduino forum has recently made a post showing off his Arduino / PC ambient light system. The system is simple to wire up and easy to use, as long as your video is being sent from a PC, which for many of us that use “home theater pc” systems is very convenient. Using a sparkfun red/green/blue (non addressable) led strip, an ULN2003A, an Arduino, and a short sketch written for processing the project is easy to toss together and very effective too.

The processing sketch continuously takes screen captures and then takes the resulting pictures and averages all the colors together. That average color is fed down to the Arduino over its stock serial connection, where it is output to 3 of the pwm capable outputs. Those outputs are connected to the 2003 Darlington transistor array to switch the 12 volt led strip.

It may seem like it would be slow, as processing is an interpreted Java based language, plus serial communication, plus Arduino overhead, but its actually very responsive and completes its task with little or no lag. Join us after the break for a quick video to see for yourself.

Comments

  1. jim says:

    Looks like it needs the response averaging — it appears to be flickering.

  2. Dreamer says:

    ^ Indeed. The transition could be somewhat smoother.

    Very nice hack though. I can use something like this on my HTPC.

    Does anyone know if this processing-code can be used in X11?

  3. looks cool!
    …i was hoping to see image processing done in Arduino :-)

  4. Craig says:

    Nice! I was a little surprised by what a great effect it has with a movie playing.

  5. MrX says:

    It is lagging, specially visible when they are playing with the sabers. The method he is using for taking screenshots might not be the best.

    In X11 (Linux and maybe other Unixes) there is the shared memory extension which allows realtime captures:
    http://linux.die.net/man/3/xshmcreateimage

    Screen-recording applications for Linux often use this method.

  6. r_d says:

    Probably mentioned this the last time we saw one of these ambient light systems, but I still think it would be simpler and more effective to simply run the analog output values of a VGA or DVI connector through a low-pass filter. Might not work for HDMI, but HDMI is a totally unnecessary standard whose sole purpose is to provide the hardware interface layer for DRM-encumbered video.

  7. ColinB says:

    Cool project! This is like the Philips Ambilight HDTV. I don’t know if the Philips Ambilight is the original invention, but it’s the first one I heard of.

    Interesting links:
    - Philips Ambilight .
    - “Ambilight” for your PC .
    - A simple static ambient lighting solution .

  8. M4CGYV3R says:

    Sometimes I wonder if the editors here just google ‘Arduino’ and post the first thing they find.

  9. alan says:

    @M4CGYV3R

    There is a button that says “Tips” that’s where you contact HaD with links to your project. I’m sure Caleb does a bit of project searching himself – but i’d bet that most of them are tips from people.

  10. raith says:

    its a cool idea, just hope your not epileptic depending on what your watching

  11. Haku says:

    The joke:

    How do you know if someone has an iPhone?
    They tell you.

    Now officially works with the Arduino:

    How do you know if someone uses an Arduino?
    They tell you.

  12. Bob says:

    @MrX
    If you use the XRender extension, you can scale down the root window to a pixmap, then read that out with XShmGetImage, the scaling is done in hardware (at least on nvidia), so you have a lot less pixels to read back to system ram.
    Sadly on nvidia this doesn’t work on fullscreen opengl applications when flippin is enabled, it seems to always grab from the same color buffer, so about half the time you get the backbuffer with only half the things drawn on it.

  13. Jammin0 says:

    Looks just like the amblone project. Maybe an easier way to do the same exact thing if you’re a beginner like myself. I was able to build it and have it up and running in a couple of hours. Cost was less than $50.
    http://amblone.com/

  14. Prof. Geisst says:

    Here´sanother Open Source Ambient Light Project. Page is in german language

    http://www.atmolight.de/atmo.php?l=en

    and another one here:

    http://www.vdr-wiki.de/wiki/index.php/Atmo-plugin

  15. macona says:

    I would love to do this with my mac. I have one of the planar XScreens that I have often thought would be perfect since there is a gap between the glass screen and the bezel that surrounds it.

    I think there was a plugin for PC VLC to do ambient?

  16. ColinB says:

    Cool project! This is like the Philips Ambilight HDTV. I don’t know if the Philips Ambilight is the original invention, but it’s the first one I heard of.

    Interesting links:
    - Philips Ambilight. The one to which everyone seems to refer. The original???
    - DIY Ambilight clone on a PC using an AVR, some ULN2803′s, DirectX, and serial port communication between the device and the PC side. (Russian language.) Translated to English (note! terrible translation). It was interesting to read that he chose to illuminate three sides only because the bottom side interfered with the keyboard, etc. and he thought it looked bad.
    - A simple static ambient lighting solution. Not nearly as cool as the ambient lighting that adapts based on current on-screen scene, however.

  17. ColinB says:

    P.S. sorry my original post earlier lost the links, but these are better links anyway!

    Hackaday really needs a preview button! Or at least remind us to use HTML for links, not plain text. BTW, what other formatting can be put in comments? I don’t see any info on the supported syntax.

  18. error404 says:

    A while ago I started work on a similar project using a USB micro controlling I2C drivers like the TI TLC59116.

    Got some of the I2C code written but moved on to another project before I wrote the USB bridge code and client software. Or built enough modules to implement what I wanted (at least 4 RGB segments, possibly 6).

    Nice work anyway, goes to show that the quick and simple hack that you actually finish is worth more than the proper design you don’t.

  19. mnisjk says:

    I’ve been wanting to do something like this for awhile. It would be nice to use a video decoder chip or something so you could take the video from HDMI or component, and it could work with anything, not just the computer. I haven’t found anything to do this that isn’t surface mount though

  20. Crom says:

    I’ve done this before with my PC minus the Arduino.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s