How can I build an RGB LED Ambilight clone with 9 meters of LEDs?

Hi there,

I'd like to build an Ambilight clone where the colour of my LED strip lights change to match the main colour shown on my screen. However, instead of using a few inches of LED strip around the screen like most tutorials show, I have about 9 meters around the ceiling. I'm pretty new to Arduino, so want to get it right, but have not been able to find a tutorial with exactly what I need. I'm hoping someone brainy out there can help me out with adapting one.

Here's a video similar to what I'm aiming for:

And the tutorial showing how to achieve it:

There are three differences between the above example and what I'm trying to do:

  • The LED strip on my ceiling is not programmable. It's just a simple RGB colour changing one where all the LEDs have to be the same colour at the same time. This means that the Ambilight will need to be a single colour - a colour to match the main colour shown on screen.
  • I have 9 meters of LED strip lights rather than a few inches. These are positioned on the ceiling rather than behind the screen and are all linked together in one long 9-meter strip.
  • I play videos through a PC using XBMC rather than through a TV. Ideally, I'd also like this to work when using the XBOX if possible!

Components already bought

What other components do I need?
My first challenge (I think?!) is to plan and buy the correct hardware! I've used this example Jerome Bernard: RGB Led Strip controlled by an Arduino to figure out what I need and I'd be grateful if you could check whether I'm about to order the correct/best things:

  • Arduino Uno
  • Three N-Channel MOSFETs (one per colour - R, G, B)
  • Three resistors (one per MOSFET)

If this is correct, what type of MOSFET would I need, based on the details I've provided above, and how is this calculated?
Also, what size resistors would I need?

Many, many thanks for your help! I'm very excited about getting this to work :smiley: If you need any other info, please let me know.


Personally, I think you learn a lot just replicating the project as-is. Then, with multimeter in hand, you can see how much voltage and current is passing through various points, and determine whether it is possible to scale that up to your larger requirements. That is, is you power supply capable of powering 9 meters of LEDs? Are your transistors sufficient to control the extra current?

Thanks for your reply.

My 9 meters of LEDs have been set up for months with the power supply specified in my previous post, so I know that part works. Just need to add my arduino to make it more cool!

I’ve just tested the current with my multimeter and it draws 2.29 Amps with the LEDs set to white and at full brightness. What does this mean when it comes to selecting the right MOSFET?

Many thanks,


It’s a bit late but here we go :slight_smile:

 /* Ambilight Clone Variation Using boblight and 1 Red, 1 Green, 1 Blue Strips. 

Circuit is set up in a similar way to the image on this page.

Created 17 Feb 2014
By Chris O.
Ver. 0.50

// constants won't change. Used here to set the PWM pin numbers / ONLY USE PWM~ PINS:
/* // Arduino Uno has 6 PWM pins.
const int Red_PWM_Pin =  3;      // RED 
const int Green_PWM_Pin =  5;    // GREEN
const int Blue_PWM_Pin =  6;     // BLUE 
const int Red_PWM_Pin =  9;      // RED 
const int Green_PWM_Pin =  10;    // GREEN
const int Blue_PWM_Pin =  11;     // BLUE

// Set Serial Baud Rate here and in boblight.conf file.
// Use one of these rates: 9600, 14400, 19200, 28800, 38400, 57600, or 115200.
#define Baud_Rate 57600 

// Variables will change:
byte RedValue = 0x00; //HEX
byte GreenValue = 0;
byte BlueValue = 0;

// ***********************************************************************************************************
// *
// *                            Power Up Init.
// *
// *
// ***********************************************************************************************************
void setup() { 

  /* Test led strips on Power Up */ 
  analogWrite(Red_PWM_Pin, 127); //DEC / Set the pin to 50% (0~255)
  analogWrite(Green_PWM_Pin, 0x7F); //HEX
  analogWrite(Blue_PWM_Pin, 127); //DEC
  delay(1000);               // wait for a second
  analogWrite(Red_PWM_Pin, 0); //DEC
  analogWrite(Green_PWM_Pin, 0x00); //HEX
  analogWrite(Blue_PWM_Pin, 0); //DEC

  Serial.begin(Baud_Rate); //Serial.begin(115200);


// ***********************************************************************************************************
// *
// *                            Main Loop 
// *
// *
// ***********************************************************************************************************
void loop() 
  if (Serial.available()>=4){ // if Serial Hardware Buffer has 4 or more bytes
    byte prefix1 =; // 1st prefix (HEX 0xFF) (DEC 255)
   // byte prefix2 =; // 2nd prefix (HEX 0x8F) (DEC 143)

    if (prefix1 == 0xFF){// && prefix2 == 0x8F){ // Do this only if we find the prefix 

      RedValue =; //read 2nd byte
      analogWrite(Red_PWM_Pin, RedValue);

      GreenValue =; //read 3rd byte
      analogWrite(Green_PWM_Pin, GreenValue);

      BlueValue =; //read 4th byte
      analogWrite(Blue_PWM_Pin, BlueValue);
    else { // if no prefix found lets dump 1 byte of serial HW Buffer.
      byte dump =; 
      /* debug led */
      // Pin 13 has an LED connected on most Arduino boards, On Leonardo its PWM~ pin, on Uno it will go high if dump value is over 127
      // Pin 11 has the LED on Teensy 2.0
      // Pin 6  has the LED on Teensy++ 2.0
      // Pin 13 has the LED on Teensy 3.0
       analogWrite(13, dump); //debug led

// ***********************************************************************************************************
// *                             Copy This in to boblight.conf file 
// *                              for windows boblight 1.3 beta1
// *                            
// *             for windows boblight 1.3 beta1 go to The LiveLight Project
// *   
// ***********************************************************************************************************

timeout     20

#interface   not in use here
port            19333
# interpolation off   # on or off
# proportional  7.0
# saturation    5.0
# value     10.0
# valuerange    0.0 1.0
# use           no
# method        average
# threshold     20

name            arduino_ambilight
type            momo 
output          "com11"    # <-- set youre arduino port
rate            57600 # Use one of these rates: 9600, 14400, 19200, 28800, 38400, 57600, or 115200.
channels        3
prefix          FF # NOTE: this FF 8F prefix will not work in Win Boblight beta1.3 
# postfix       not in use here, will not work in Win Boblight beta1.3 
interval        40000 
# allowsync     on   not in use here
debug           off 
delayafteropen  20000000

name            red
rgb             FE0000

name            green
rgb             00FE00

name            blue
rgb             0000FE

name            main
color           red     arduino_ambilight 1
color           green   arduino_ambilight 2
color           blue    arduino_ambilight 3
hscan           0 100
vscan           0 100