Arduino Ambilight


Finally completed my Ambilight project have been dragging this for a long time. This was one of the early projects. I always liked the way Ambilight looks and wanted one for myself, but the kits available online were expensive and also not available locally.

On doing some research i found that there are lot of information available on internet for making Ambilight. Some of the really good Ambilight projects i had found work on Raspberry Pi, Being a Windows guy Linux makes me nervous so i thought of making my own.

Arduino Ambilight Project
30 LED Arduino Ambilight Setup

Arduino was my first choice since it can be programmed and controlled from windows easily. The downside to this approach is that i have to do all the image processing on PC (windows) and then pass the information to Arduino as Arduino is not powerful enough to do image processing. I have tried it on my 24" monitor before moving to my 40" TV as it will require far less number of LED to cover the small screen.
With addressable LED strips available in market it becomes very simple to drive and control the LED.
I am using WS2812B LED strip which can be controlled with a single I/O pin from Arduino. It also makes it very easy to scale the project size as you do not have to do additional wiring when adding more LED, just connect the additional LED strip at the end of the existing strip.

Arduino Ambilight ProjectFor this project i have used a 1 meter 30 LED WS2812B strip. I have divided the LED asynchronously with top edge getting the maximum 17 LED bottom 5 LED and both left and right side getting 4 LEDs each. This arrangement gives good result. Since i am using only 30 LED i do not need external power source and LED work fine with from 5V output of Arduino.
I have also added 3 push buttons to control the LED strip. By using the buttons i can switch between the Ambilight mode or set some predefined colour pattern. This helps as to set a solid colour when i am not using Ambilight. I have also created a night Light mode in which a single LED is lit at a time. To drive the LED from Arduino i am using FastLED Library.

Arduino Ambilight Project
Wiring Diagram
I have written a application in C# which does all the image processing work and sends the LED color information to Arduino over serial port. It can be configured to support different LED strip sizes. Problem that i am facing rite now is to boost the capture FPS speed. I am using SlimDX library but still i am only getting around 15FPS.

Arduino Ambilight Project
Ambilight Windows Application

I have uploaded all the code on Google Drive. You will have to build the visual studio project. The code might have some bugs and you might have to debug it for your particular setup.

Downloade Code

Share on Google Plus

About apoorv chaudhary

    Blogger Comment

5 comments :

  1. thanks for the code, i used your project it's almost perfect, replaced the directx capturing with the driver and classes from
    http://www.demoforge.com/sdk/MirrSharp.zip
    it's much faster with almost 0 performance impact along with full screen support
    also putting the code in a thread rather than a timer is also better for performance.

    ReplyDelete
    Replies
    1. Thanks for the code. Will test it soon

      Delete
    2. i've made this http://www.instructables.com/id/Ambilight-DFMirage-super-Fast-Screen-Capture-and-P/
      hope it helps you .. :)

      Delete