Hyperion Ambilight is an adaptive TV backlight. Dynamic monitor backlight on Arduino Adaptive TV backlight

What is Hyperion Ambilight
TV backlight technology that was invented and patented by Philips Electronics.

It is a backlight that, by analyzing the color picture of the frame on the TV screen, reproduces diffused light around the perimeter of the TV. Due to this, the surface of the wall behind the TV cabinet is dynamically illuminated, thereby complementing the intensity of the image on the screen with a halo and visually increasing the size of the image.

1. Basic iron

Since the technology is patented, we haven't seen it on non-Philips TVs for many years. By the way, I had such a TV with three-sided backlighting, but it was so slow that I sold it 6 days after purchase. Well, we'll have to do it ourselves ... For this we need:

  • Raspberry Pi 3 link ($ 42)- just take the most latest version raspberries, if you plan to use it as a media server, then I advise you to take something more powerful, for example Asus Tinker Board ... If the Raspberry Pi 2 is lying around, then everything will work fine on it, without any delays.
  • APA102 LED strip link (8 $ / meter)- there are only two options, either take the original APA102, or its analogue SK9822, which is cheaper, but works the same way. I am using analog. I advise you to take Black IP67 30 / meter. IP67 comes in silicone protection that does not turn yellow over time, protects against dust and interference. As for the number of diodes, 30 per meter is quite enough, and the power supply can be found in a "laptop" version. Take on all 4 sides of the TV, even if it is on a stand. A 48-inch TV takes exactly 3 meters of tape. I recommend taking all the necessary tape at once from one seller and in one order, since different batches of tape can have different shades, this will cut the eye. Never believe that a system can be built on top of ws28 *, just take a look at the specs:

I had an extremely sad experience with the ws2801 tape: firstly, it frankly slows down, it lacks the refresh rate, secondly, white is not white, you need to adjust, thirdly, constantly random blinking of diodes, fourthly, they corny fall off chips from this tape, fifthly, must be soldered.

  • Power supply 5V 8A link (11 $)- the choice of the block depends on the configuration of the tape, I will just give my example of calculation: a tape of 30 diodes / meter consumes 9W per 1 meter (in cases when white is turned on, in reality it is much less), we count at the maximum: 9W * 3 (number of meters) + 20% reserve = 32.4W, the power supply unit produces 5 * 8 = 40W is quite suitable, and it will be possible to power all other devices from it.
  • Connectors- NS Let's not say why complicate things, let's take and order some connectors:

2. Assembly of iron

Putting it together according to the following scheme. It is important to energize the beginning and end of the tape so that the glow is uniform. Be sure to connect the power of the tape to the raspberry common ground. To avoid possible signal interference, you can use ferrite beads but I did without them, no problems were found.

Trying on, trimming, joining with corners, gluing.

The LED strip comes with a standard sticky base - the strip does not stick on it, it will fall off quickly. I bought, in a construction hypermarket, foam tape for attaching mirrors. Be sure to degrease the TV surface. The TV case can be rounded, it becomes possible to stick the tape at an angle so that the diodes shine more on the sides, but I do not recommend doing this. It is worth sticking the tape strictly perpendicular to the wall. The ideal distance from the wall is 15cm-20cm. In my case, it turned out to be 24cm, due to the shape of the TV stand.

The raspberry can also be glued to the back of the TV. I glued the clothes on with Velcro so that I could take it off.

I read that this scart adapter does not work on all TVs, but I advise you to try it, it's cheap. The adapter must be set to OUT mode.

TVs with dynamic backlighting around the display frame are one of the proprietary chips of Philips. And unlike many others, it works. Everything comes at a price, however, and TVs with Ambilight and immersive presence are more expensive than many other models.

Russian developers have proposed a method that will equip monitors of any manufacturer with dynamic backlighting. To do this, you don't even have to carry the device to service center: it only takes a little time and perseverance.

In general, such a backlight can be purchased as radio components and configured independently. But, as practice shows, this is almost comparable to the ready-made options from PaintPack.

There are two main models available: a monitor version (30 LEDs) and a TV version (60 LEDs). There is also a very simple one - for 10 LEDs, but it is suitable only for the smallest monitors.

The TV version is equipped with an external power supply. Also, a larger number of LEDs speaks in its favor, which gives a larger illumination area (it will shine wider and higher, in other words). If such options are not suitable for any reason, you can contact the developers: for a small surcharge, they will offer a modified version.

mindrunway.ru

PaintPack, in fact, is a small case, to which removable LED strips are connected from both sides. The box with the filling carries indicators and a power connector, as well as microUSB for connecting to a PC. There is also a master connector (proprietary) for daisy chaining two devices.

The device body is located on the back of the TV or monitor. Then LED strips are laid in accordance with the instructions, power is connected and witchcraft begins. When connecting PaintPack to a computer via USB, it is necessary to install drivers and configure the device in the bundled program.


mysku.ru

The setting is done using the AmbiBox package. It is necessary to go to the "Intelligent backlight" menu, select a screen capture method and one of the operating modes offered in the program:

  1. Static background - any color can be set, LED glow is regulated.
  2. Color music - the backlight will flash in time with the sound of the music. The backlight color is set to green-yellow.
  3. Dynamic background - smooth flow of one color into another.
  4. Screen capture is the main mode of operation.

In this mode, it is possible to capture color from the movies and games being watched. The backlight color will change according to the image on the screen, divided into top, bottom and side zones (each separately).

PaintPack is a little slower than the official Philips counterpart. But taking into account the difference in cost and the possibility of upgrading any device, the choice is obvious.

Good afternoon.

For my first article, I chose one of my most successful handicrafts: HDMI-passthrough analogue of Ambilight from Philips, hereinafter I will call this composition "Atmosvet".

Introduction
On the Internet, it is not very difficult to find ready-made / open-source solutions and articles on how to make Ambilight for a monitor / TV, if you display a picture from a PC. But in my multimedia system, displaying a picture on a TV from a PC takes only 5% of the time of use, I play more time from game consoles, which means I had to come up with something of my own.
Initial data:
  • 60 "Plasma TV
  • HTPC based on Asrock Vision 3D 137B
  • Xbox 360
Most devices use HDCP to play content even while playing.
Requirement:
It is necessary to provide centralized support for Atmosvet for all devices connected to the TV.
Implementation
I will not tell you how I attached 4.5m LED strip to the TV and what needs to be done with the Arduino, you can use it as a base.

The only caveat:
I noticed that there are strange flickers at the bottom of the screen, at first I made a mistake on the signal, re-picked the defliker, changed the resizing of the picture and dug up a lot of things, it got better, but the flicker did not help. I began to observe. It turned out that the flicker was only at the end of the tape, and then in bright scenes. Taking a multimeter, I measured the voltage at the beginning, middle and end of the tape and guessed with the cause of the flickering: at the beginning of the tape it was 4.9V (yes, the Chinese power supply unit gives a voltage with a deviation, this is not important), in the middle 4.5 at the end of 4.22 - The voltage drop is too significant , I had to solve the problem simply - to the middle of the tape I brought the power from the power supply unit, put the wire behind the TV. It helped instantly, any flickering stopped altogether.

Capturing a picture with a webcam
The first test version for running the idea and its visualization was chosen by capturing an image through a webcam) it looked something like this:

Low color rendering and high latency showed that this implementation cannot be used in any way.

Capturing a picture via HDMI

In the process of researching possible options, the following scheme was chosen, as the most reliable and budgetary:

  • Signal from all devices is fed to a 5in-1out HDMI switch that supports HDCP
  • The output signal is fed to a 1in-2out HDMI splitter, which not only supports HDCP, so also turn it off at the output (thank the Chinese).
  • One of the output signals goes to the TV
  • Another output signal goes to HDMI to AV converter
  • S-Video signal goes to the capture box from ICONBIT
  • The capture box connects to the always running HTCP over USB, which is connected to the Arduino tape controller on the TV.

Initially it looks wild and like crutches, but:

  • It works.
  • Summarizing the whole thing, ordering from China, it cost me 3-4 thousand rubles.

Why didn't I use a HDMI capture board? It's simple: the cheapest and most affordable option is the Blackmagic Intensity Shuttle, but it cannot work with 1080p / 60fps signals, only 1080p / 30fps - which is not acceptable, because I didn't want to lower the frame rate so that I could capture the picture. + this business cost about 10 thousand. rubles. - which is not cheap if the result is unknown.

The loss on converting HDMI to S-video is insignificant for capturing color in 46x26 LED backlight resolution.

Initially, for capturing S-video, I tried using EasyCap (it has many Chinese variations), but the bottom line is that the chip used there is extremely poor, and you cannot work with it using openCV.

The only drawback is that the S-Video output signal contained black bands at the edges, cutting off real content (about 2-5%), I cropped the output image from the capture card to remove these bands, the very loss of the image in those areas did not affect the result in practice.

Software
This was the most interesting part for me, because I don’t really like poking around with pieces of iron.

To capture the image, I used openCV and in particular its .NET wrapper emgu CV.

I also decided to apply a few different image post-processing and image preparation techniques before sending the list of colors to the controller.

Frame processing
1. Receiving a captured frame
2. Crop the frame to exclude black bars
Everything is simple here:
frame.ROI = new Rectangle (8, 8, frame.Width - 8, frame.Height - 18 - 8);
Crop 8 pixels from the top, 8 from the right and 18 from the bottom. (No stripe on the left)
3. Resize the frame to the backlight resolution, there is no need for us to carry a healthy picture with us
Nothing complicated either, we do it using openCV tools:
frame.Resize (LedWidth - 2 * LedSideOverEdge,
LedHeight - LedBottomOverEdge - LedTopOverEdge,
INTER.CV_INTER_LINEAR);
The attentive reader will notice the abundance of variables. The fact is that my TV frame is large enough, occupying 1 LED on the sides, 1 on top and 3 on the bottom, so the resize is done on the LEDs that are directly opposite the display, and we already supplement the corners later. When resizing, we just get the average colors that the pixels of the LEDs should have.
4. We carry out mapping of LEDs from the cut frame
Well, here, too, everything is simple, we stupidly go through each side and sequentially fill an array of 136 values ​​with the color of the LEDs. It so happened that at the moment, all other operations are easier to perform with an array of LEDs than with a frame, which is more difficult to process. Also for the future, I added a "depth" parameter of capture (the number of pixels from the border of the screen, to average the color of the LED), but in the final setup, it turned out better without it.
5. Perform color correction (white balance / color balance)
The walls behind the TV are made of timber, the timber is yellow, so you need to compensate for the yellowness.
var blue = 255.0f / (255.0f + blueLevelFloat) * pixelBuffer [k];
var green = 255.0f / (255.0f + greenLevelFloat) * pixelBuffer;
var red = 255.0f / (255.0f + redLevelFloat) * pixelBuffer;
In general, I initially took the color balance from the source code of some open source editor, but it did not change white (white remained white), I changed the formulas a little, sealed myself, and got what I needed straight out: if the level of the color component is negative (I will explain how - this color is missing), then we add its intensity and vice versa. For my walls it worked out: RGB (-30.5.85).

In color correction, I also perform black leveling (black comes around 13,13,13 in RGB) by simply subtracting 13 from each component.

6. Perform desaturation (reduce the saturation of the image)
In the final setup, I don't use desaturation, but maybe in a certain moment needed, in fact it makes the colors more "pastel", like the Philips ambilight. I will not give the code, we just convert from RGB -> HSL, reduce the Saturation component and return back to RGB.
7. Deflicker
It just so happens that the input image "jitters" - this is a consequence of the conversion to an analog signal, as I suppose. At first I tried to solve it in my own way, then I looked into the source code of the Defliker filter used in VirtualDub, rewrote it in C # (it was in C ++), I realized that it does not work, because it is such an impression that it fights with flickering between frames, in the end I combined my solution and this defliker got something strange, but it works better than expected. The initial defliker worked only with the intensity of the entire frame, I need each LED separately. The original defliker compared the change in intensity as a sum, I like the comparison of the length of the color vector more, The original defliker compared the delta of the change in intensity compared to the previous frame, this does not fit, and I redid it to the average value of the intensity within the window of the previous frames. And many other little things, as a result of which little is left of the initial deflector.
The main idea: based on the average intensity of previous frames, modify the current frame if its intensity is not higher than a certain threshold (I have this threshold in the final setup of 25), if the threshold is exceeded, then the window is reset, without modification.
Slightly modified (for readability out of context) my deflicker code:
Array.Copy (_leds, _ledsOld, _leds.Length); for (var i = 0; i< _leds.Length; i++) { double lumSum = 0; // Calculate the luminance of the current led. lumSum += _leds[i].R*_leds[i].R; lumSum += _leds[i].G*_leds[i].G; lumSum += _leds[i].B*_leds[i].B; lumSum = Math.Sqrt(lumSum); // Do led processing var avgLum = 0.0; for (var j = 0; j < LedLumWindow; j++) { avgLum += _lumData; } var avg = avgLum/LedLumWindow; var ledChange = false; if (_strengthcutoff < 256 && _lumData != 256 && Math.Abs((int) lumSum - avg) >= _strengthcutoff) (_lumData = 256; ledChange = true;) // Calculate the adjustment factor for the current led. var scale = 1.0; int r, g, b; if (ledChange) (for (var j = 0; j< LedLumWindow; j++) { _lumData = (int) lumSum; } } else { for (var j = 0; j < LedLumWindow - 1; j++) { _lumData = _lumData; } _lumData = (int) lumSum; if (lumSum >0) (scale = 1.0f / ((avg + lumSum) / 2); var filt = 0.0f; for (var j = 0; j< LedLumWindow; j++) { filt += (float) _lumData/LedLumWindow; } scale *= filt; } // Adjust the current Led. r = _leds[i].R; g = _leds[i].G; b = _leds[i].B; // save source values var sr = r; var sg = g; var sb = b; var max = r; if (g >max) max = g; if (b> max) max = b; double s; if (scale * max> 255) s = 255.0 / max; else s = scale; r = (int) (s * r); g = (int) (s * g); b = (int) (s * b); // keep highlight double k; if (sr> _lv) (k = (sr - _lv) / (double) (255 - _lv); r = (int) ((k * sr) + ((1.0 - k) * r));) if ( sg> _lv) (k = (sg - _lv) / (double) (255 - _lv); g = (int) ((k * sg) + ((1.0 - k) * g));) if (sb> _lv) (k = (sb - _lv) / (double) (255 - _lv); b = (int) ((k * sb) + ((1.0 - k) * b));) _leds [i] = Color .FromArgb (r, g, b); ) / * Temporal softening phase. * / if (ledChange || _softening == 0) continue; var diffR = Math.Abs ​​(_leds [i] .R - _ledsOld [i] .R); var diffG = Math.Abs ​​(_leds [i] .G - _ledsOld [i] .G); var diffB = Math.Abs ​​(_leds [i] .B - _ledsOld [i] .B); r = _leds [i]. R; g = _leds [i] .G; b = _leds [i] .B; int sum; if (diffR< _softening) { if (diffR >(_softening >> 1)) (sum = _leds [i] .R + _leds [i] .R + _ledsOld [i] .R; r = sum / 3;)) if (diffG< _softening) { if (diffG >(_softening >> 1)) (sum = _leds [i] .G + _leds [i] .G + _ledsOld [i] .G; g = sum / 3;)) if (diffB< _softening) { if (diffB >(_softening >> 1)) (sum = _leds [i] .B + _leds [i] .B + _ledsOld [i] .B; b = sum / 3;)) _leds [i] = Color.FromArgb (r, g, b); )
Let _leds be an array of LEDs of the Color class, _ledsOld - frame values ​​before conversion, LedLumWindow - the width of the window of previous frames, to estimate the average change in intensity, in the final setup I had a window of 100, which equals 3 seconds at 30fps. _lumData - an array of the intensity value of the previous frames.

In the end, this mechanism gave even pleasant unexpected consequences to the picture, it is difficult to describe how it is perceived visually, but it makes it darker where necessary and brighter where necessary, like dynamic contrast. As a result, the defliker's goal turned out to be wide, not only to eliminate flicker, but also to overall balance the output color, both in terms of components and in time within the window.

8. Smoothing LEDs by neighbors.
In general, in the final setup, I didn't really like anti-aliasing, and I turned it off, but in some cases it can come in handy. Here we are simply averaging the color of each LED over its neighbors.
var smothDiameter = 2 * _smoothRadius + 1; Array.Copy (_leds, _ledsOld, _leds.Length); for (var i = 0; i< _ledsOld.Length; i++) { var r = 0; var g = 0; var b = 0; for (var rad = -_smoothRadius; rad <= _smoothRadius; rad++) { var pos = i + rad; if (pos < 0) { pos = _ledsOld.Length + pos; } else if (pos >_ledsOld.Length - 1) (pos = pos - _ledsOld.Length;) r + = _ledsOld.R; g + = _ledsOld.G; b + = _ledsOld.B; ) _leds [i] = Color.FromArgb (r / smothDiameter, g / smothDiameter, b / smothDiameter); )
9. Save the current state so that the packet sending thread grabs and sends it to the backlight controller.
I deliberately divided the process of processing frames and sending packets to the controller: packets are sent once at a certain interval (for me it is 40ms), so that the arduino sings to process the previous one, because more often than 30ms it chokes, so it turns out that we are not directly dependent on the frame rate capture and do not interfere with that process (and sending a packet is also wasting time).
A little about arduino
You can't just take and send a hefty packet to Arduino on the series, because it will go beyond the default HardwareSerial buffer and you will lose its end.
The solution is quite simple: we set the size of the HardwareSerial buffer to a sufficient size to fit the entire sent packet with an array of colors, for me it is 410.
UI
The software itself was implemented as a win service, in order to configure all parameters + enable / disable I made a Web UI that connected to the service through the WebService on the service. The final interface on the mobile screen looks like this:
Result
As a result, the result met all expectations, and now playing games on consoles I get even more immersion in the atmosphere of the game.

As a general result of the work, I recorded a video with the work of the atmosphere according to my scheme:

Test subject 1: Pacific Rim, Shanghai battle scene, this film is good for testing and demonstration, many bright scenes and flashes, lightning strikes, etc .:

Test sample 2: Some video from MLP, merged from YouTube, is very suitable for testing scenes with bright colors (I liked the stripes), as well as quickly changing scenes (at the end of the view, you can see the effects of the delay, visible only in the video, when This is not noticeable in real viewing, I tried to measure the delay from the video - it turned out 10-20ms):

And finally, it is worth noting about the consumption of resources from HTPC:
HTPC I have ASRock Vision 3D on i3, atmosphere service consumes 5-10% CPU and 32MB RAM.

Thank you for your attention, I really hope that my article will help someone.

Philips patented an incredibly simple, but without exaggeration, amazing TV backlight technology in 2007. With this adaptive backlighting less eye fatigue when viewing in the dark, the effect of presence increases, the display area expands, etc. Ambilight is applicable not only to video and photo content, but also to games. Ambilight has become the hallmark of Philips TVs. Since then, Philips has been closely vigilant so that none of the major manufacturers would dare to encroach on the sacred by creating something like that. Probably, this technology can be licensed, but the conditions are outrageous, and other market players are not particularly eager to do this. Small companies also tried (and now there are companies that do) to introduce similar technology in the form of separate kits, but the Philips car was inevitable. So, in the best case, if the company does not somehow renew the patent or its derivative, other manufacturers will only be able to release something similar in 2027.

But for us, ordinary consumers, this punishment does not apply. We are free for ourselves to do what we deem necessary. Today I will tell you in detail how to independently make an adaptive backlight for a TV or monitor like Philips Ambilight (hereinafter simply Ambilight). For some, the article will not contain anything new in itself, tk. There are dozens of such projects, and hundreds of articles have been written in different languages, and there are thousands of people who have already done this for themselves. But for many, all this can be very interesting. You don't need any special skills. Only basic knowledge of physics for the 8th grade of high school. Well, and quite a bit of wire soldering.

So that you better understand what I am talking about, I will give my example of what happened. The real costs for TV 42 "are about 1000 rubles and 2 hours of work.


The video does not convey all the sensations and the effect in full, but the children sat with their mouths open for the first time.

Possible implementation options

There are several options for implementing Ambilight. They depend on the video signal source.

The cheapest, simplest and most effective option is the signal source is a Windows PC, Mac OS X or Linux. Nowadays, Windows-based boxes on Atom processors are very common, which cost from $ 70. They are all perfect for the Ambilight implementation. For several years now I have been using various Windows boxes (in a TV cabinet) as a media player, wrote a small handful of reviews and consider them to be the best TV boxes for media content. The hardware implementation of this option is the same for all of the above. operating systems. It is about this option that I will talk about in the article... The software part will relate to Windows system, AmbiBox will act as a universal control program. With Mac OS X and Linux can be used.

The second option - the source of the signal is a media attachment on Android base, of which there are also a huge number. This option is the most problematic. First, the highlighting will only work in the Kodi media combine (and offshoots of that project). Secondly, in the overwhelming majority of cases, everything works only with disabled hardware video decoding, which is unacceptable for most boxes. The hardware implementation of the project also imposes certain requirements. I will not touch on it, but if something interests specific, then I will try to answer in the comments.

The third option is a source-independent solution. This is the most expensive, but absolutely universal solution. the signal is taken directly from the HDMI cable. For it, you need a sufficiently powerful microcomputer (like Raspberry Pi), HDMI splitter (splitter), HDMI-RCA AV converter, USB 2.0 analog video capture device. Only with this option can you be guaranteed to use Ambilight with any TV set / receiver, Android boxes, Apple TV, game consoles (for example, Xbox one, PlayStation 4) and other devices that have HDMI output. For the variant with support for 1080p60, the cost of components (without LED strip) will be about $ 70, with support for 2160p60 - about $ 100. This option is very interesting, but you need to write a separate article on it.

Hardware part

For implementation, you will need three main components: a controllable RGB LED strip, a power supply, an Arduino microcomputer.

First, a few explanations.

WS2811 is a three-channel channel controller / driver (IC) for RGB LEDs with one-wire control (addressable to an arbitrary LED). WS2812B is an RGB LED in SMD case 5050, which already has a built-in WS2811 controller.

LED strips suitable for the project are called WS2811 or WS2812B for simplicity.

WS2812B tape is a tape on which the WS2812B LEDs are placed in series. The tape operates with a voltage of 5 V. There are tapes with different LED densities. Usually these are: 144, 90, 74, 60, 30 per meter. There are different degrees of protection. Most often these are: IP20-30 (protection against the ingress of solid particles), IP65 (protection against dust and water jets), IP67 (protection against dust and protection during partial or short-term immersion in water to a depth of 1 m). Substrate in black and white.

Here's an example of such a tape:


The WS2811 tape is a tape on which the WS2811 controller and some kind of RGB LED are placed in series. There are options for 5 V and 12 V. The density and protection are similar to the previous option.

Here's an example of such a tape:


There are also WS2811 "tapes" with large and powerful LEDs, as in the photo below. They are also suitable for implementing Ambilight for some huge panel.


Which tape to choose, WS2812B and WS2811?

An important factor is the feed of the tape, which I will talk about a little later.

If you have a suitable power supply unit at home (often power supplies remain from old or damaged equipment at home), then choose a tape based on the voltage of the power supply, i.e. 5V - WS2812B, 12V - WS2811. In this case, you will simply save money.

On my own I can give a recommendation. If the total number of LEDs in the system is no more than 120, then WS2812B. If more than 120, then WS2811 with an operating voltage of 12 V. Why this is so, you will understand when it comes to connecting the tape to the power supply.

What level of tape protection should I choose?

For most, IP65 is suitable, because on one side it is coated with "silicone" (epoxy resin) and on the other there is a 3M self-adhesive surface. It is convenient to mount this tape on a TV or monitor and it is convenient to wipe off dust.

Which LED Density to Choose?

For the project, tapes with a density of 30 to 60 LEDs per meter are suitable (of course, 144 is possible, no one forbids). The higher the density, the higher the Ambilight resolution (number of zones) and the higher the maximum overall brightness. But it should be borne in mind that the more LEDs in the project, the more complex the tape power circuit will be arranged, and you will need more powerful block nutrition. The maximum number of LEDs in a project is 300.

Buying tape

If your TV or monitor is hanging on a wall and all 4 sides have a lot of free space side by side, then the tape is best placed at the back around the perimeter on all 4 sides for maximum effect. If your TV or monitor is installed on a stand, or there is not enough free space at the bottom, then the tape should be placed on the back on 3 sides (i.e. the bottom without tape).

For myself, I chose a white tape WS2812B IP65 with 30 LEDs per meter. I already had a suitable 5V power supply. I decided whether 60 or 30 LEDs per meter, but I chose the latter after reviewing the video with ready-made examples of implementation - the brightness and resolution suited me, and the power is easier to organize, there are fewer wires. There is a huge amount of WS2812B tapes on Aliexpress. I ordered 5 meters for $ 16. For my TV (42 ", 3 sides) I needed only 2 meters, that is, I could buy it for $ 10, the remaining three meters for a friend. Prices often change from sellers, there are many offers, so just choose a cheap lot on Aliexpress with a high rating (search keywords - WS2812B IP65 or WS2811 12V IP65).




Buying a power supply for tape

The power supply unit is selected according to power and voltage. For WS2812B - voltage 5 V. For WS2811 - 5 or 12 V. Maximum power consumption of one WS2812B LED is 0.3 W. For WS2811, in most cases it is the same. Those. the power of the power supply must be at least N * 0.3 W, where N is the number of LEDs in the project.

For example, you have a 42 "TV, you settled on a WS2812B tape with 30 LEDs per meter, you need 3 meters of tape on all 4 sides. You will need a 5 V power supply unit with a maximum power of 0.3 * 30 * 3 = 27 W , i.e. 5 V / 6 A. In my implementation, only 3 sides are used, a total of 60 LEDs (to be precise, 57) - power from 18 W, i.e. 5 V / 4 A.

I have had an ORICO CSA-5U (8 A) multi-port USB charger idle for a long time, left over from the old review. The power supply of the ports is parallel to it (this is critically important), this charger is ideal for me as a power supply unit, since I will connect the tape in 2 parallel connections(explanations will be provided a little later in the article).


If I didn't have this memory, then I would have chosen (there is information that it is in this PSU that the internals are put at 2.5 A, so you need to study this issue in more detail from the seller, or look at other models).

Buying a microcomputer

Ambilight will be controlled by the Arduino microcomputer. Arduino Nano on Aliexpress costs about apiece.

Costs for my version (for TV 42 "):

$ 10 - 2 meters WS2812B IP65 (30 LEDs per meter)
$ 4 - power supply 5 V / 4 A (I did not spend money on the PSU, I quote the cost for clarity)
$ 2.5 - Arduino Nano
-----------
16,5$ or 1000 rubles

Hardware implementation

The most important thing is to properly organize the feed of the tape. The tape is long, the voltage sags at high current, especially at 5 V. Most of the problems that arise for those who make themselves Ambilight, are connected with the power supply. I use the rule - you need to make a separate power supply for every 10 W of maximum power consumption at 5 V and 25 W of power consumption at 12 V. The length of the power supply (from the power supply to the tape itself) should be minimal (no margin), especially at 5 V.

The general connection diagram is as follows (the diagram shows the power connection for my version):


Power is supplied to the tape from both ends - two parallel connections. For example, if I made the backlight on all 4 sides, and the tape was 60 LEDs per meter (i.e., the maximum power is 54 W), then I would make the following power supply:


The supply wires must be used appropriate, the smaller the gauge (AWG), the better, so that they are more than enough for the calculated current strength.

There are two pins going to the Arduino from the tape. GND, which needs to be connected to the corresponding pin on the Arduino. And DATA, which needs to be connected to the sixth digital pin through a 300-550 Ohm resistor (preferably 470 Ohm). If you don’t have a resistor, then in most cases everything will work fine without it, but it’s better to have one. A resistor can be bought for a couple of kopecks at any radio store. The Arduino microcomputer itself can be placed in any convenient case, many use the Kinder surprise egg for this. The Arduino should be placed as close to the tape as possible so that the DATA leads are as short as possible.

Soldering wires to tape is simple. The main rule is that the contact time with the soldering iron should be minimal;

In my case, it turned out like this:



Two black high-quality USB cables were used for power, and a white one for connecting to a computer. I ran out of white heat shrink tubing, I used red ones. Not so “pretty”, but it suits me (it's still hidden behind TV).

An important question is how to bend the tape at right angles? If you have a 60 LED strip, then the strip needs to be cut and connected with short wires (by placing all this in a heat shrink tube). You can buy special angled three-pin connectors for LED strips(there are 4 contacts in the picture, just for example):


If you have a 30 LED strip, then the distance between the LEDs is large, you can easily make a corner without cutting. Remove a piece of the "silicone" coating, isolate (you can even use "tape") the contact pad and bend it according to the following scheme:

I cut a piece of tape to practice. The main thing is not to overdo it - they were slightly bent once and that's it. You do not need to bend here and there, you do not need to squeeze the bend line strongly.


Here is the rear view of the TV, all the wires go through the hole into the cabinet:

Software part

This is the simplest one.

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

Launch the Arduino IDE and open the Adalight.ino file.


We change the number of LEDs in the code. I have 57.


Tools> Board> Arduino nano
Tools> Port> Select COM port (there will be the desired option)

Press the button "Download":


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

Ready. You need to disconnect the Arduino from USB and reconnect. The ribbon will light up sequentially in red, green and blue - the Arduino has activated and is ready to work.

Download and install the program. In the program, click "More settings" and specify the device - Adalight, COM port and the number of LEDs. Select the number of frames to capture (up to 60).


Next, click Show Capture Zones> Zone Configuration Wizard. Select your ribbon configuration.


Click Apply and Save Settings. This concludes the basic settings. Then you can experiment with the size of the capture zones, make color correction of the tape, etc. The program has many different settings.


To activate a profile, just double-click on the corresponding icon (AmbiBox profiles) in the Windows notification area. The tape will immediately light up. It also turns off by double clicking.

That's basically it. You saw the result at the beginning of the article. Nothing complicated, cheap and great. I'm sure you will do better, so share your crafts in the comments.

Philips patented an incredibly simple, but without exaggeration, amazing TV backlight technology in 2007. With this adaptive backlighting less eye fatigue when viewing in the dark, the effect of presence increases, the display area expands, etc. Ambilight is applicable not only to video and photo content, but also to games. Ambilight has become the hallmark of Philips TVs. Since then, Philips has been closely vigilant so that none of the major manufacturers would dare to encroach on the sacred by creating something like that. Probably, this technology can be licensed, but the conditions are outrageous, and other market players are not particularly eager to do this. Small companies also tried (and now there are companies that do) to introduce similar technology in the form of separate kits, but the Philips car was inevitable. So, in the best case, if the company does not somehow renew the patent or its derivative, other manufacturers will only be able to release something similar in 2027.

But for us, ordinary consumers, this punishment does not apply. We are free for ourselves to do what we deem necessary. Today I will tell you in detail how to independently make an adaptive backlight for a TV or monitor like Philips Ambilight (hereinafter simply Ambilight). For some, the article will not contain anything new in itself, tk. There are dozens of such projects, and hundreds of articles have been written in different languages, and there are thousands of people who have already done this for themselves. But for many, all this can be very interesting. You don't need any special skills. Only basic knowledge of physics for the 8th grade of high school. Well, and quite a bit of wire soldering.

So that you better understand what I am talking about, I will give my example of what happened. The real costs for TV 42 "are about 1000 rubles and 2 hours of work.


The video does not convey all the sensations and the effect in full, but the children sat with their mouths open for the first time.

Possible implementation options

There are several options for implementing Ambilight. They depend on the video signal source.

The cheapest, simplest and most effective option is the signal source is a Windows PC, Mac OS X or Linux. Nowadays, Windows-based boxes on Atom processors are very common, which cost from $ 70. They are all perfect for the Ambilight implementation. For several years now I have been using various Windows boxes (in a TV cabinet) as a media player, wrote a small handful of reviews and consider them to be the best TV boxes for media content. The hardware implementation of this option is the same for all the listed operating systems. It is about this option that I will talk about in the article... The software part will be related to the Windows system, AmbiBox will act as a universal control program. With Mac OS X and Linux can be used.

The second option - the source of the signal is a media attachment based on Android, of which there are also a huge number. This option is the most problematic. First, the highlighting will only work in the Kodi media combine (and offshoots of that project). Secondly, in the overwhelming majority of cases, everything works only with disabled hardware video decoding, which is unacceptable for most boxes. The hardware implementation of the project also imposes certain requirements. I will not touch on it, but if something interests specific, then I will try to answer in the comments.

The third option is a source-independent solution. This is the most expensive, but absolutely universal solution. the signal is taken directly from the HDMI cable. For it, you need a sufficiently powerful microcomputer (like Raspberry Pi), HDMI splitter (splitter), HDMI-RCA AV converter, USB 2.0 analog video capture device. Only with this option can you be guaranteed to use Ambilight with any TV set / receiver, Android boxes, Apple TV, game consoles (for example, Xbox One, PlayStation 4), etc. devices that have an HDMI output. For the variant with support for 1080p60, the cost of components (without LED strip) will be about $ 70, with support for 2160p60 - about $ 100. This option is very interesting, but you need to write a separate article on it.

Hardware part

For implementation, you will need three main components: a controllable RGB LED strip, a power supply, an Arduino microcomputer.

First, a few explanations.

WS2811 is a three-channel channel controller / driver (IC) for RGB LEDs with one-wire control (addressable to an arbitrary LED). The WS2812B is an RGB LED in the SMD 5050 package, which already has a built-in WS2811 controller.

LED strips suitable for the project are called WS2811 or WS2812B for simplicity.

WS2812B tape is a tape on which the WS2812B LEDs are placed in series. The tape operates with a voltage of 5 V. There are tapes with different LED densities. Usually these are: 144, 90, 74, 60, 30 per meter. There are different degrees of protection. Most often these are: IP20-30 (protection against the ingress of solid particles), IP65 (protection against dust and water jets), IP67 (protection against dust and protection during partial or short-term immersion in water to a depth of 1 m). Substrate in black and white.

Here's an example of such a tape:


The WS2811 tape is a tape on which the WS2811 controller and some kind of RGB LED are placed in series. There are options for 5 V and 12 V. The density and protection are similar to the previous option.

Here's an example of such a tape:


There are also WS2811 "tapes" with large and powerful LEDs, as in the photo below. They are also suitable for implementing Ambilight for some huge panel.


Which tape to choose, WS2812B and WS2811?

An important factor is the feed of the tape, which I will talk about a little later.

If you have a suitable power supply unit at home (often power supplies remain from old or damaged equipment at home), then choose a tape based on the voltage of the power supply, i.e. 5V - WS2812B, 12V - WS2811. In this case, you will simply save money.

On my own I can give a recommendation. If the total number of LEDs in the system is no more than 120, then WS2812B. If more than 120, then WS2811 with an operating voltage of 12 V. Why this is so, you will understand when it comes to connecting the tape to the power supply.

What level of tape protection should I choose?

For most, IP65 is suitable, because on one side it is coated with "silicone" (epoxy resin) and on the other there is a 3M self-adhesive surface. It is convenient to mount this tape on a TV or monitor and it is convenient to wipe off dust.

Which LED Density to Choose?

For the project, tapes with a density of 30 to 60 LEDs per meter are suitable (of course, 144 is possible, no one forbids). The higher the density, the higher the Ambilight resolution (number of zones) and the higher the maximum overall brightness. But it should be borne in mind that the more LEDs in the project, the more complex the tape power circuit will be arranged, and a more powerful power supply will be needed. The maximum number of LEDs in a project is 300.

Buying tape

If your TV or monitor is hanging on a wall and all 4 sides have a lot of free space side by side, then the tape is best placed at the back around the perimeter on all 4 sides for maximum effect. If your TV or monitor is installed on a stand, or there is not enough free space at the bottom, then the tape should be placed on the back on 3 sides (i.e. the bottom without tape).

For myself, I chose a white tape WS2812B IP65 with 30 LEDs per meter. I already had a suitable 5V power supply. I decided whether 60 or 30 LEDs per meter, but I chose the latter after reviewing the video with ready-made examples of implementation - the brightness and resolution suited me, and the power is easier to organize, there are fewer wires. There is a huge amount of WS2812B tapes on Aliexpress. I ordered 5 meters for $ 16. For my TV (42 ", 3 sides) I needed only 2 meters, that is, I could buy it for $ 10, the remaining three meters for a friend. Prices often change from sellers, there are many offers, so just choose a cheap lot on Aliexpress with a high rating (search keywords - WS2812B IP65 or WS2811 12V IP65).




Buying a power supply for tape

The power supply unit is selected according to power and voltage. For WS2812B - voltage 5 V. For WS2811 - 5 or 12 V. Maximum power consumption of one WS2812B LED is 0.3 W. For WS2811, in most cases it is the same. Those. the power of the power supply must be at least N * 0.3 W, where N is the number of LEDs in the project.

For example, you have a 42 "TV, you settled on a WS2812B tape with 30 LEDs per meter, you need 3 meters of tape on all 4 sides. You will need a 5 V power supply unit with a maximum power of 0.3 * 30 * 3 = 27 W , i.e. 5 V / 6 A. In my implementation, only 3 sides are used, a total of 60 LEDs (to be precise, 57) - power from 18 W, i.e. 5 V / 4 A.

I have had an ORICO CSA-5U (8 A) multi-port USB charger idle for a long time, left over from the old review. The power supply of the ports is parallel to it (this is critically important), this charger is ideal for me as a power supply unit, since I will connect the tape through 2 parallel connections (explanations will be a little later in the article).


If I didn't have this memory, then I would have chosen (there is information that it is in this PSU that the internals are put at 2.5 A, so you need to study this issue in more detail from the seller, or look at other models).

Buying a microcomputer

Ambilight will be controlled by the Arduino microcomputer. Arduino Nano on Aliexpress costs about apiece.

Costs for my version (for TV 42 "):

$ 10 - 2 meters WS2812B IP65 (30 LEDs per meter)
$ 4 - power supply 5 V / 4 A (I did not spend money on the PSU, I quote the cost for clarity)
$ 2.5 - Arduino Nano
-----------
16,5$ or 1000 rubles

Hardware implementation

The most important thing is to properly organize the feed of the tape. The tape is long, the voltage sags at high current, especially at 5 V. Most of the problems that arise for those who make themselves Ambilight, are connected with the power supply. I use the rule - you need to make a separate power supply for every 10 W of maximum power consumption at 5 V and 25 W of power consumption at 12 V. The length of the power supply (from the power supply to the tape itself) should be minimal (no margin), especially at 5 V.

The general connection diagram is as follows (the diagram shows the power connection for my version):


Power is supplied to the tape from both ends - two parallel connections. For example, if I made the backlight on all 4 sides, and the tape was 60 LEDs per meter (i.e., the maximum power is 54 W), then I would make the following power supply:


The supply wires must be used appropriate, the smaller the gauge (AWG), the better, so that they are more than enough for the calculated current strength.

There are two pins going to the Arduino from the tape. GND, which needs to be connected to the corresponding pin on the Arduino. And DATA, which needs to be connected to the sixth digital pin through a 300-550 Ohm resistor (preferably 470 Ohm). If you don’t have a resistor, then in most cases everything will work fine without it, but it’s better to have one. A resistor can be bought for a couple of kopecks at any radio store. The Arduino microcomputer itself can be placed in any convenient case, many use the Kinder surprise egg for this. The Arduino should be placed as close to the tape as possible so that the DATA leads are as short as possible.

Soldering wires to tape is simple. The main rule is that the contact time with the soldering iron should be minimal;

In my case, it turned out like this:



Two black high-quality USB cables were used for power, and a white one for connecting to a computer. I ran out of white heat shrink tubing, I used red ones. Not so “pretty”, but it suits me (it's still hidden behind TV).

An important question is how to bend the tape at right angles? If you have a 60 LED strip, then the strip needs to be cut and connected with short wires (by placing all this in a heat shrink tube). You can buy special angled connectors for three pins for LED strips (there are 4 pins in the picture, just for example):


If you have a 30 LED strip, then the distance between the LEDs is large, you can easily make a corner without cutting. Remove a piece of the "silicone" coating, isolate (you can even use "tape") the contact pad and bend it according to the following scheme:

I cut a piece of tape to practice. The main thing is not to overdo it - they were slightly bent once and that's it. You do not need to bend here and there, you do not need to squeeze the bend line strongly.


Here is the rear view of the TV, all the wires go through the hole into the cabinet:

Software part

This is the simplest one.

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

Launch the Arduino IDE and open the Adalight.ino file.


We change the number of LEDs in the code. I have 57.


Tools> Board> Arduino nano
Tools> Port> Select COM port (there will be the desired option)

Press the button "Download":


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

Ready. You need to disconnect the Arduino from USB and reconnect. The ribbon will light up sequentially in red, green and blue - the Arduino has activated and is ready to work.

Download and install the program. In the program, click "More settings" and specify the device - Adalight, COM port and the number of LEDs. Select the number of frames to capture (up to 60).


Next, click Show Capture Zones> Zone Configuration Wizard. Select your ribbon configuration.


Click Apply and Save Settings. This concludes the basic settings. Then you can experiment with the size of the capture zones, make color correction of the tape, etc. The program has many different settings.


To activate a profile, just double-click on the corresponding icon (AmbiBox profiles) in the Windows notification area. The tape will immediately light up. It also turns off by double clicking.

That's basically it. You saw the result at the beginning of the article. Nothing complicated, cheap and great. I'm sure you will do better, so share your crafts in the comments.