Hardware Setup

Hardware

For implementation, you will need four main components:

1. Controllable LED RGB strip,
2. Power supply,
3. Arduino Nano microcontroller PCB,
4. Android Ambilight Application.

First a little theory.

WS2811 is a three-channel controller / driver (chip) for RGB LEDs with one-wire control (addressing to an arbitary LED). The WS2812B is an RGB LED in the SMD 5050 case with WS2811 controller already integrated.

Suitable for the project LED strip here and later we’ll call WS2811 or WS2812B.

WS2812B strip is a LED strip on which the LEDs WS2812B are sequentially placed. The LED strip works with a voltage of 5 V. There are several types of LED stripes with different amount of LEDs per meter. Usually there are 144, 90, 74, 60, 30 per one meter. Also there are different levels of protection. Most common cases are IP20-30 (protection from solid particles), IP65 (protection against dust and water vapor), IP67 (dust protection and protection for partial or short-time immersion in water to a depth of 1 m). The substrate is black and white.

Here is an example of this LED strip:

ws2812b

WS2811 strip is a LED strip on which the WS2811 controller and some kind of RGB LED are sequentially located. They can be designed for both 5 V and 12 V. Density and protection levels are the same.

Here is an example of such a LED strip:

ws2811

Which LED strip should I choose, WS2812B or WS2811?

An important moment is the power of the LED strip, which I’ll talk a little later.

If you have a suitable power supply then choose a LED strip based on the power supply voltage, i.e. 5V – WS2812B, 12V – WS2811. In this case it will simply save money.

An advice: If the total number of LEDs in the system is not greater than 120, then choose WS2812B. If more than 120, then your choice should be WS2811 with a working voltage of 12 V. It will be explained later when it comes to connecting the LED strip to the power supply.

What level of LED strip protection should I choose?

The most suitable is IP65, as on one side it is covered with “silicone” (epoxy), and on the other there is a self-adhesive surface. This LED strip is conveniently mounted on a TV or monitor and dust can be easily wiped of it.

What density of light-emitting diodes to choose?

For the project, LED stripes with a density of 30 to 60 LEDs per meter (of course, you can use also 144). The higher the density, the greater the Ambilight resolution (the number of zones) and the greater the maximum l brightness will be. But notice that the more LEDs are in the project, the more complicated the power scheme will be, and more powerful supply should be needed. The maximum number of LEDs in the project is 300.

Which power supply to choose for a LED strip?

The power supply is selected for power and voltage. For WS2812B – voltage 5 V. For WS2811 – 5 or 12 V. The maximum power consumption of one WS2812B LED is 0.3 Watts. For WS2811 in most cases the same. Then, the power supply should not be less than N * 0.3 W, where N is the number of LEDs in the project.

For example, you have a TV 42 “and you’ve chosen the WS2812B LED strip with 30 LEDs per meter, you need 3 meters of LED strip (all 4 sides of the screen) .You need a power supply with a voltage of 5 V and a maximum power of 5 V / 6 A. If there are less diodes on the lower horizontal of the screen than on the top, it is only about 60 LEDs ,then the power source should be at least 5 V / 4 A.

Example of a power supply for a LED strip:

power supply

Which microcontroller to choose?

Ambilight hardware is an Arduino microcomputer. Arduino Nano on Aliexpress costs about $ 2.5 apiece.

Example of such microcontroller:

arduino

Project costs for a conventional 42 “TV:

12 $ – 3 meters WS2812B (30 LEDs per meter)
4 $ – power supply 5 V / 4 A
$ 2.5 – Arduino Nano
$ 3 – Android Ambilight Application program


Total:  ~ $ 21.5


Arduino Nano:

AliExpress
Banggood
Amazon US
Amazon UK
Amazon DE

WS2812B RGB LED lights:

AliExpress
Banggood
Amazon US
Amazon UK
Amazon DE


Hardware implementation

The most important thing is to properly organize the feeding of the LED strip. According to the LED strip is long, the voltage drops with a large current consumption, especially when using 5 V tape. Most problems that face those who set up Ambilight by themselves occure due to improper LED’s feeding. There is a general rule – you need the separate power supply for every 10 W of maximum power consumed at 5 V and 25 W of power consumption at 12 V. The length of the wiring (from the power supply to the LED strip itself) should be minimal (without reserve), especially at 5 AT.

The general connection scheme is as follows (Arduino is powered from USB, and the LED strip from the PSU):

connection scheme

We make two parallel connections to the both ends of the LED strip. For example, if we install the backlight on all 4 sides, and the LED strip would have 60 LEDs per meter (that is, the maximum power 54W), then our power scheme should be like this:

power connection

There are two contacts to Arduino PCB from the LED strip. 1 – GND, which must be connected to the corresponding contact on Arduino. And 2 – DATA, which must be connected to the sixth digital contact on Arduino through a 470 Ohm resistor. If you do not have a resistor, in most cases everything will work fine, but it is better to get one. The resistor can be bought for a couple of cents in any radio store. The Arduino microcomputer itself can be placed in any convenient box, I used for this purpose a container from “Kinder Surprise”. Arduino PCB should be placed as close as possible to the LED strip, so that the connection from DATA to Arduino was of minimum length.

Soldering the wires to the LED strip is easy. The main rule – the time of contact with the soldering iron should be minimal!

How to bend the tape at right angles?

There are two options. 1 – the LED strip should be cut and connected with short wires (placing it all in a shrink tube). 2 – You can buy special angled connectors for three contacts for LED stripes:

angled connectors

The software part

This is the simplest way.

Download and install Arduino IDE. We load the last available version of the FastLED library, unpack it and put the FastLED folder from the archive into the folder with the Arduino IDE libraries (C:\Program Files (x86)\Arduino\libraries). Start Arduino IDE and close it. The folder Arduino will be created in the Documents folder. There we create a folder AAA and copy there sketch – AAA.ino.

Connect the Arduino microcomputer to USB. The driver (serial interface CH340) will be installed automatically. If this does not happen, then in the folder Arduino IDE there is a folder Drivers with everything you need.

Run Arduino IDE and open the file AAA.ino.

aaa-1en

We change (if necessary) the data transfer rate:

aaa-2en

We change the number of LEDs. The number should be equal to the number of LEDs in your LED strip:

aaa-4en

Tools> Board> Arduino nano
Tools> Port> Select the COM port (there will be the desired option). For the Chinese clone of Arduino use the old bootloader.

Press the button “Upload”:

aaa-3en

The program will inform you when the download is complete (this is literally a couple of seconds).

Done. It is necessary to disconnect Arduino from USB and reconnect. The LED strip will turn on in succession in red, green and blue – Arduino is activated and ready to go.

Now you can connect the Arduino to the TV-box and start setting up the program.