Tinkster Logo
All
advancedSmart Home & IoT23-Jan-2022

Adaptive TV backlighting in your home

Author
Anton Shagaev
Tomsk, RU
1 day
10
3
Project Overview
Cover
Friends, today we will be creating ambilight or adaptive backlighting technology, which was first presented by Philips. Ambilight is dynamic backlighting that 'analyzes' the colors of individual pixels along the perimeter of the screen image and reproduces diffused light onto the wall surface behind the TV body, repeating the colors taken from the perimeter. This effect visually increases the size and light intensity of the image.
Our homemade ambilight will not work on regular TVs that receive digital or cable television. For this we will need a set-top box with a media center Kodi, and from it we can take any video stream and apply this technology. The maximum screen refresh rate through the set-top box (x96 Mini) with the Kodi media center is 60 Hertz.

What you'll need

Materials

Steps

1

Installing Kodi media center on X96 Mini TV box

Installing Kodi media center on X96 Mini TV box
Installing Kodi media center on X96 Mini TV box
Installing Kodi media center on X96 Mini TV box
The Kodi media center will be based on LibreELEC or a stripped-down Linux, sufficient to run Kodi from it.
We will not flash the X96 Mini, but will install Kodi on a microSD card, which we will then insert into the TV box and boot Kodi from it.
Download the Kodi image from here. Then reboot into Windows and download the program Rufus and use it to install the downloaded LibreELEC image onto the microSD card.
Next, download the file dtb.img and copy it to the root of the microSD card, overwriting the existing file. Insert the card into the microSD card slot on the TV box.
Next, take a toothpick and insert it into the AV port on the TV box and press the button switch inside with it. While holding the switch pressed, power on the box. At this moment, Kodi will start booting from the SD card.
2

Connecting a remote control in Kodi on LibreELEC

Connecting a remote control in Kodi on LibreELEC
Connecting a remote control in Kodi on LibreELEC
By default, the set-top box comes with a remote control.
If you install Kodi on LibreELEC, the remote will stop working. To make the remote work again, you need to copy the file remote.conf to the set-top box. I recommend first connecting the set-top box to a router or switch via cable. If you need Wi-Fi connection, you can do that later after connecting the remote control.
At this stage, you need to know the local IP address of the set-top box. You can do this by connecting a USB keyboard to the set-top box, first going to Settings — LibreELEC — Services using the keyboard arrow keys and selecting Enable SSH.
You can exit sections using the ESC key, and move the switch sliders using Enter. Then, in the same way, go to Settings — LibreELEC — System Information and view the current IP address of the set-top box.
Copy the remote.conf file to the set-top box:
tinkster@almalinux:~#
1
scp ~/remote.conf root@192.168.0.XXX:/storage/.config
where 192.168.0.XXX is the LibreELEC address on the local network
Reboot the set-top box, the remote should start working.
3

Installing Hyperion service on Kodi

Installing Hyperion service on Kodi
Installing Hyperion service on Kodi
Using the remote control in the left Kodi menu, we go to Add-ons, then select Search in the upper right corner and type in the search bar Hyperion.
Press Enter, find this service and install it (the set-top box must be connected to the internet via the RJ-45 port or Wi-Fi).
I also recommend immediately setting up SSH access to the TV set-top box from another computer. To do this, you need to set a static IP address in Kodi itself and subsequently access the set-top box via SSH using the command in Linux (in Windows this is done via Putty):
tinkster@almalinux:~#
1
ssh root@ 192.168.0.XXX
Default password libreelec.
The password, unfortunately, cannot be changed, but you can create encryption keys, move the public key to the TV set-top box from the computer you will be accessing it from, and disable password login to LibreELEC. To do this on Linux, open a terminal on the computer and enter:
tinkster@almalinux:~#
1
cd ~/.ssh
2
ssh-keygen -t rsa
The system will prompt you to enter a filename:
tinkster@almalinux:~#
1
Generating public/private rsa key pair.
2
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter, for example, LE_rsa and press Enter.
Then copy the public key to LibreELEC:
tinkster@almalinux:~#
1
ssh-copy-id -i LE_rsa.pub root@192.168.0.XX
Next, enter the command:
tinkster@almalinux:~#
1
ssh-add LE_rsa
To prevent the changes from being reset after a computer reboot, open the config file:
tinkster@almalinux:~#
1
nano ~/.ssh/config
and insert the line into it:
tinkster@almalinux:~#
1
IdentityFile ~/.ssh/LE_rsa
Save the file.
4

Arduino Uno firmware

Arduino Uno firmware
Arduino Uno firmware
Connect Arduino Uno to the computer, open Arduino IDE, install the FastLED library (Tools – Manage Libraries) and flash the microcontroller with this attached sketch file.
In this sketch, you will need to change three parameters: MAX_LEDS, LED_TYPE and DATA_PIN.
MAX_LEDS – total number of LEDs
LED_TYPE – type of LED strip used (in my case it's WS2812B)
DATA_PIN – digital pin on Arduino Uno for data transmission (in my case it's the 13th digital pin)
I recommend installing the Arduino Uno itself in such a beautiful box.
5

Addressable LED strip installation and connection diagram

Addressable LED strip installation and connection diagram
Addressable LED strip installation and connection diagram
Addressable LED strip installation and connection diagram
Addressable LED strip installation and connection diagram
Addressable LED strip installation and connection diagram
Addressable LED strip installation and connection diagram
Carefully place our TV face down on the floor, preferably on a carpet. Before doing this, thoroughly vacuum the carpet to eliminate any possibility of damaging the matrix with foreign objects.
Determine the starting corner for applying the LED strip (for me, it's the top right corner when looking at the back of the TV). Also, follow the direction of the strip (indicated by arrows on the strip), this is very important.
Also, the number of horizontal LEDs must be equal on the top and bottom; the number of LEDs on the sides (vertical) can be different. This rule is dictated by the Hypercon environment of the configuration file for the service Hyperion.
Try to position the LEDs as close to each other as possible at the corner joints; the color gamut in the corners will be much more saturated later. .
Connecting wires at the corner joints can be neatly arranged using platforms with cable ties or wire platforms.
Also, I recommend removing the double-sided tape from the platforms using isopropyl alcohol and securing them with thermal glue. I recommend additionally securing the beginning and end of any LED strip segment with thermal glue as well.
Connect the beginning of the LED strip with a 3-core wire to a terminal connector, and secure the connector itself to the back of the TV case using thermal glue.
Also, do not use corner connectors for the strip, as I initially did.
I encountered a lot of problems even after soldering the contacts. For some reason, when voltage was applied to the strip, one LED constantly glowed green. As soon as I disconnected the corner connectors and soldered the corner contacts of the LED strip segments with regular wires, the problem disappeared. Then I had to add one LED each to the top and bottom on the side strip segments because the corner connectors took up that space.
I recommend checking the contacts with a multimeter after each soldering to immediately rule out defects.
Next, insert the corner connector board into the Arduino Uno. I recommend installing the entire board at once, as the fixation of the connectors will be much better than installing them individually.
Solder all wires according to the diagram:
We will supply power from both ends of the strip because if supplied from one end (in my case, the total strip length is 2.7 meters), there will be a significant voltage drop at the other end, and the LEDs will not shine as brightly.
For wires connecting to the power supply connector and the terminal connector on the TV, I recommend using crimp connectors.
Для проводов подсоединяющихся к коннектору блока питания и терминальному коннектору на телевизоре рекомендую использовать обжимные соединители.
6

Setting up the Hyperion service configuration file via Hypercon

Setting up the Hyperion service configuration file via Hypercon
Setting up the Hyperion service configuration file via Hypercon
Setting up the Hyperion service configuration file via Hypercon
screenshot_20220123_001254
Install Java and download Hypercon for LibreELEC to your computer (in my case it's a computer with Kubuntu):
tinkster@almalinux:~#
1
sudo apt install openjdk-7-jre
2
cd ~
3
wget http://releases.libreelec.tv/hypercon-LE.jar

Discussion (0)

No comments yet. Be the first!

Maker

Avatar
Anton Shagaev
Tomsk, RU

Anton is the Founding Engineer at Tinkster. He translates industrial reliability into software architecture, ensuring the platform's core is built to last. Anton studied oil and gas engineering in the United States and also holds two honors degrees from Tomsk Polytechnic University.

AI Project Assistant

Tinkster Neural Core

Hi! I am the AI assistant for this project. Ask me any questions about the assembly, code, or components.

Downloads

DTB image
39.7 KB
RC configuration file
2.9 KB
Arduino Uno sketch
8.2 KB