image

LightZ

A homemade Philips Ambilight for less than $50.

Browse source code

LightZ

This is one of my small gadgets. Called LightZ, it is in fact a homemade connected LED strip based on Arduino. Inspired by Philips Ambilight, it can render the light from a computer's screen and sound. This project is a prototype and is not designed to target the general users, however, the source code are available under WTFPL if you want to explore and use them.

Sound rendering.

Connected to a computer under Windows with Bluetooth, LightZ listen to the sound card and reproduce the bass sound spectrum in stereo. In the video : Deluxe - Shoes

Behind the stage.

LightZ is composed from a set of LED strips, an Arduino, a Bluetooth antenna and a Windows app. In the video : Daft Punk - Da Funk

Why and how?

  • Why
    Why

    I am a music lover, I can't work without, and also like to chill with a movie and popcorn, while being plunged in the dark, like at the theater.

    For this reason, after discovered Philips Ambilight, I wanted to make my own system to get a nice ambiance while watching a movie, listening to music, working.

  • Approach
    Approach

    I wanted 3 main features : rendering the colors of the screen borders of a PC under Windows, rendering the sound spectrum while listening to music, and being able to choose myself a color.

    After a few research and reading the article of Sebastien WARIN about his own Ambilight, I realized that I did not had a lot of material and did not wanted to spend a lot of money in this project. So I turned to a solution using an Arduino Uno-like motherboard connected to my laptop with Bluetooth.

    The advantage of the Arduino Uno is that it is esay to use, well documented, and can be found for cheap. The choice of the Bluetooth is linked to the configuration of my apartment and my desk : I already have too many wires and did not wanted to add a new one to connect the Arduino to my laptop or to the external monitor. Also, using a local internet connection was interesting but a bit "too much" for the goal of the project. Furthermore, the local internet connection (no ethernet, poor Wi-Fi signal) was not ideal at this period for this project. The Bluetooth was a cheap, wireless and easy way to do.

  • Material
    Material

    As I wanted to minimize the price of the needed material and avoid to pay a lot for a material that I can potentially break easily as I would experiment with, I did not hesiate to buy the required supplies on AliExpress, the Chinese version of Amazon. The advantage is that you can find small electronic components for very cheap. The disadvantages are that it takes around 3 weeks to be shipped to Europe and North America and that the quality of some products can be poor. I personnaly not recommend to buy a tablet on this website, but for wires, small plastic components, cheap Arduino Uno-like, it is enough.

    Below, the list of material I needed to make LightZ :

    • Arduino Uno-like (I inist on the "like" as it is not the official Arduino Uno. It is a clone of the board, and it is legal.).
    • Bluetooth antenna HC-06
    • Wires
    • LED strip WS2801-like (the current source code on GitHub also supports the LPD8806).
    • Power supply (attention to the voltage depending of the LED strip you choose).
    • Various electrical adapters.
    • Some LEGO to make a box to protect the electronic from the dust.
    • Various tools like soldering iron, ruler...
  • Software
    Software

    A WPF application is there to determines which LED must be turned on.

    For rendering the screen borders, the program uses DirectX with a library called SlimDX to regularly get a byte array that represents the color of each pixel (basically, a screenshot). The choice of DirectX face to the .Net or Windows API is the performance. DirectX use much less memory and CPU for this action.
    A data of 4 bytes is sent for each LED to turn on : the first byte is equal to the LED id, the second is equal to the quantity of red, the third, to the quantity of green, and the fourth, blue.

    For rendering the sound spectrum, the program listens to the computer's sound card thanks to a library called BASS.NET. It makes an average of the bass in stereo and send the intensity of the volume to the board by Bluetooth.
    A data of 4 bytes is sent every 20ms : the first is a special value that tells to the board that we are displaying the sound spectrum. The second is the average of bass on left, the third, on right. The last byte is a unused constant.