loading

I have always wanted to add ambilight to my TV. It looks so cool! I finally did and I was not disappointed!

I have seen many videos and many tutorials on creating an Ambilight system for your TV but I have never found a full tutorial for my exact needs.

It is whether the system is only made for 1 single source (PS4 or Xbox or TV etc..) or it is not using the same LED's as I wanted to use, so I decided to create an instructable and put together all the information and experience I gathered in one spot while making this project.

The system I have made can be connected to up to 5 different sources. I have it setup here to run with my PS4 system or my home theater/blu-ray player or my Foxtel (Australian cable tv box) or my computer and have a spare input left for something else. All of these simply with the press of a button.

I have added a LCD screen to display the current source being connected to the ambilight and an ON/OFF button for the system.

If you are looking to have ambilight available for every different inputs connected to your TV, want to use the WS2812 type led strips, then look no further, this tutorial is for you.

I have entered this instructable into the Raspberry PI 2016 contest so if you like it please drop me a quick vote! Much appreciated in advance.

Step 1: Material Needed to Build This System

Not all of the sources have an HDMI output, like my computer is still connected through the old VGA connector and my Foxtel unit is still connected via AV cables. I had to purchase quite a few different adapters to get it all working, but in the end the result is awesome and well worth it!!

Not everything here will be needed depending on your own system and if you would like a LCD or not. I will separate the optional items.


  1. 1x 4meter strip of WS2812B 60leds/m. (this was enough for my 55inch tv) I have bought mine from Aliexpress. LED strip
  2. 1xArduino UNO board.
  3. 1x Raspberry Pi model B+.
  4. 1x SD card. (8Gb is good)
  5. 1x Video grabber type STK1160. (be carefull when chosing the grabber, some models will not work!!) This is the one I got and it works correctly. Video grabber
  6. 1x 5V 10amps power supply. I got mine from Aliexpress again and it works fine. Power supply
  7. 1x HDMI splitter 1 x 2. splitter
  8. 1x HDMI switcher 5 in 1. switcher
  9. 1x HDMI to AV converter. converter


cables and hardware:

  1. 4x 25cm HDMI cable. cable
  2. 2x HDMI female to female enclosure connectors. connector
  3. 1x 220V input connector (fused).
  4. 1x project enclosure (can be different, it is up to you, mine is 424mm x 203mm x 86mm) box
  5. Single core wire to connect the 5V to the different converters etc.
  6. Ribbon cablesor extensions to wire inputs to the Arduino exemple


optional extras:

  1. 1x AV to HDMI converter. converter
  2. 1x VGA to HDMI converter. converter
  3. 2x 25cm HDMI cable. cable
  4. 1x LCD display 16characters x 2lines. LCD
  5. 1x I2C interface for the LCD. interface
  6. 1x cooling fan for the case.

Step 2: What Computer Programs Will Be Required

There will be a few different programs required for this project.

You need to download and install them (if you don't already have it)

  • WinSCP can be downloaded here
  • Putty can be downloaded here (click on the putty.exe link in the list)
  • SDFormatter can be downloaded here
  • Win32DiskImager can be downloaded here
  • Arduino IDE can be downloaded here (I used version 1.6.5 at the time)
  • HyperCon can be downloaded here (click on the clone or download link)
  • Notepad++ (optional) can be downloaded here

You will need to download the Raspberry Pi disk image too. Chose the file named "OpenELEC 5.0 with STK1160/UTV007 compatible kernel RPI 1"that you can download from the bottom of the page here

Step 3: Getting the Raspberry Pi Up and Running

We are going to start by getting the Raspberry Pi up and running.

1) We are going to write openELEC to the SD card.

  1. Unzip the Raspberry Pi disk image.
  2. Plug the SD card into your computer.
  3. Run the SDFormatter program.
  4. Select the SD card drive letter.
  5. Click on option and select "size adjustment" to ON.
  6. Click OK.
  7. Click Format.
  8. Run the Win32DiskImager program.
  9. Select the Raspberry Pi image and the drive letter of your SD card.
  10. Select Write.

2) Eject the SD card from your computer and plug it in your Raspberry Pi.

Connections to be made on the Pi:

  • Connect an Ethernet cable to your Pi from your network.
  • Connect the HDMI port of your Pi to your TV or screen.
  • Plug in a keyboard and a mouse on the USB ports. (I use a wireless mouse and keyboard combo and I have left the dongle connected to the Pi, this way, now that the Pi is boxed up, I don't have to open it all up if I want to access my Pi.)
  • Plug in the usb end of the video grabber to your Pi.

3) Connect a 5V power supply to your Pi and follow the onscreen information until it boots up. You should be presented with a screen as per my photo.

We now need to check your internet connection. Follow the path SYSTEM - openELEC - system info and write down your IP address, it will be needed in the future.

While in the menu, follow the path SYSTEM - openELEC - services and scroll down until you find the tab called SSH. Put a tick into the Enable SSH.

Now we are going to install Hyperion and check our video grabber connection to the Pi.

For this we are going to use Putty. Your Pi has to be powered ON and connected to your network for this to work.

  • Type in the IP address you wrote down just before for your Pi. as per picture attached and click Open.
  • You should then be prompted with a window asking you for a username as per picture attached. type in root and press enter.
  • you will then be asked for a password. (note that the characters wont appear while typing the password, this is normal). Type in openelec and press enter.
  • To check all the usb ports, type in lsusb and press enter. You should find your video grabber in the list as per the picture attached.

While Putty is open, we are going to install Hyperion, this is the software running on the Raspberry Pi that is going to take care of transforming our video signal into the correct sequence to be sent to our led strip.

  • copy the following link and use the right click of your computer mouse onto the putty window to paste the link and start the process. curl -L --output install_hyperion.sh --get https://raw.githubusercontent.com/tvdzwan/hyperion/master/bin/install_hyperion.sh sh ./install_hyperion.sh

This complete the Raspberry PI setup. We will get back to it later on to upload our LED's configuration file.

Step 4: Hyperion and the Configuration File

!!!UPDATE!!! If your version of HyperCon contains 5 tabs, please refer to step 13 for programmation.

  • Start by opening the program HyperCon.jar.

You can simply copy the first 4 lines in the Hardware tab.

  • The direction is which direction the strip is running when you are looking at it from the screen side of your TV.
  • If like me, you have put LED's in the top and bottom corners, you have to select true for the next 2 lines.

If you select true to both of them, you have to take 1 away from your total number of LED's on the vertical axis.

(i have 47 LED's on each side vertically, with 2x true = 45 LED's for the count)

  • You can then fill up the next 3 rows according to your setup and paying attention to the comment above.
  • The bottom gap is simply the results of "horizontal number of LED" - how may LED's you have at the bottom of your TV. In my case 78 at the top, 30 each side at the bottom = 18 gap
  • Increase or decrease the offset number until the LED 0 on the right part of the screen matches the start LED of your own setup.
  • You can as well copy all the fields under Image Process according to my picture, it works well and can always be modified later if needed.
  • Once you are done, the number of LED's indicated on the right of the screen should be the same as the number of LED's physically stuck to your TV.

Now moving to the Process tab.

  • Make sure the frame grabber is ticked. set the height and width to a value of 3x your actual number of LED's. It works well. Again, this can be later modified if needed but is a good start. Copy the 25Hz as well
  • Enable the smoothing and copy the values from my setup.
  • Copy as well the Color values I have on my picture, they are a good starting point and work quite well.

To finish, move onto the External tab.

  • Everything in this tab can stay untouched except the highlighted field that you need to copy according to mine.

You can nowclick on the "create hyperion configuration" button and save the file somewhere easy.


I use Notepad++ to open the configuration file as this program works well for me.

We are now going to open the configuration file and add a few lines in it for hyperion to work with our frame grabber.

You can refer to the picture above for visual help.

  • Scroll all the way down the file.
  • Delete the last 2 lines as per the highlighted part on the picture.
  • Now copy the following lines from here under and paste them in your file at the end

/// Configuration for the embedded V4L2 grabber
/// * device : V4L2 Device to use [default="/dev/video0"]

/// * input : V4L2 input to use [default=0]

/// * standard : Video standard (no-change/PAL/NTSC) [default="no-change"]

/// * width : V4L2 width to set [default=-1]

/// * height : V4L2 height to set [default=-1]

/// * frameDecimation : Frame decimation factor [default=2]

/// * sizeDecimation : Size decimation factor [default=8]

/// * priority : Hyperion priority channel [default=800]

/// * mode : 3D mode to use 2D/3DSBS/3DTAB (note: no autodetection) [default="2D"]

/// * cropLeft : Cropping from the left [default=0]

/// * cropRight : Cropping from the right [default=0]

/// * cropTop : Cropping from the top [default=0]

/// * cropBottom : Cropping from the bottom [default=0]

/// * redSignalThreshold : Signal threshold for the red channel between 0.0 and 1.0 [default=0.0]

/// * greenSignalThreshold : Signal threshold for the green channel between 0.0 and 1.0 [default=0.0]

/// * blueSignalThreshold : Signal threshold for the blue channel between 0.0 and 1.0 [default=0.0]

"grabber-v4l2" :

{

"device" : "/dev/video0",

"input" : 0,

"standard" : "no-change",

"width" : 1,

"height" : 1,

"frameDecimation" : 2,

"sizeDecimation" : 4,

"priority" : 1100,

"mode" : "2D",

"cropLeft" : 0,

"cropRight" : 3,

"cropTop" : 6,

"cropBottom" : 17,

"redSignalThreshold" : 0.0,

"greenSignalThreshold" : 0.0,

"blueSignalThreshold" : 0.0

},

"endOfJson" : "endOfJson"

}


One word now on this video grabber's setup we have just added to our configuration file. This step will need to be done when everything is working and finished.

The 4 lines: Crop Left , Crop Right, Crop Top, Crop Bottom. These values need to be changed according to your setup. Start with all these four numbers with a value of 0 and load the config file back into your Pi. Reboot your system and watch some TV. If on the left side of your TV the LED's are not lit up you need to increase the value under "Crop Left" and try again until the LED's light up.

You can then repeat the process with the 3 other sides.

Success!!! I know it is a bit time consuming but it insures you are not cropping too much of the image off on one side or the other but just what is necessary.

Step 5: Getting the LED's on the Back of the TV

This step speaks for itself, it is time to put the LED strip at the back of the TV.

I personally just used the double sided tape of the LED strip and glued the strip on the edge of my TV. Some people prefer and build a frame for the LED's. This is all up to you and your TV as they will most likely always be different.

My setup has 78 LED's at the top, 47 on either sides and 30 on either sides at the bottom of the TV for a total of 232 LED's.

When I face my TV, the LED strip is running clockwise, this is looking at where the signal is getting to the first LED and travelling through until it reaches the last one.

Remember that there will potentially be a fair bit of current running through the strip, depending on its size, this is why I ran the power on both ends of the strip. The connecting wires on the edges of the TV will have to be big enough as well to pass this current through.

I used the connectors supplied with the LED strip. One connector (where the strip begins) has 3 wires, +5V and GND and as well the Data IN. The other side of the strip only has 2 wires. +5V and GND.

Step 6: Uploading the Hyperion Config to the Raspberry Pi

For this step, your Raspberry Pi needs to be powered ON and connected to your network. We will use WinSCP to load up the file into the Pi.

  • Start by opening the program and entering the IP address under Host name, user name root and password openelec into the field as per the picture attached. Click login.
  • You should then see a window with a few lines as per the second picture while it is logging in.
  • You will then be presented with a window as per the picture above. The left side is your personal computer and the right side is the Raspberry Pi.
  • On the left side, navigate through until you have the configuration file located.
  • On the right side, double click on the return arrow couple of time until you are in the root menu ( only a / in the address bar above) the double click onto storage to get into this menu.
  • Select the config file on the left and click F5 or click onto the Upload button above it.
  • You will then have an upload window as per the picture. You need to copy the path storage/.config/ and the press ok.

Your hyperion config file is now loaded into your Pi. You can reboot it and it will now use this new config file when it restarts.

Step 7: How It All Works

You can refer to the organization chart I have drawn, a picture is worth a thousand words.

Brief explanation:

The HDMI switcher will pass through to its output 1 out of the 5 input signal it receives, as selected by you. (Playstation, Xbox, tv, etc...)

This signal is then fed into the splitter, which will duplicate the signal.

The first output of the splitter is going straight to your TV, to display the image as per usual.

The second output of the splitter is fed into the HDMI to AV converter.

The signal is converted and passed through to the video grabber. (via the yellow connector. Red and white are not needed, they carry the sound).

The raspberry Pi will in turn take the data from the video grabber, process it and send through to the Arduino the color that each LED will have to take.

The Arduino will then output the data to the LED's.

The Arduino is as well monitoring the HDMI switcher and according to the channel selected on the switcher, it will update the LCD screen to display the correct source. It monitors the ON/OFF button too which allows the led strip to be turned OFF if not needed.

Step 8: Boxing Up the Project and Connecting the Different Parts.

The boxing up of your project will be up to you. I have tried to put as many comments as possible on the pictures to give you and idea of how my setup is put together.

One very important thing is to make sure the video grabber input to the Pi is not connected with anything else, I had frame size errors and a lot of other weird things happening when I had anything else connected to the other USB port. It must reach a bandwidth limit or something but it would not work when I tried plugging in a WiFi dongle in this USB or even the output cable going to the Arduino.


I recommend placing all the converters etc and starting by bringing power to all of them first. Most of these converters came with a wall plug power pack. I cut off the cable and only used the connector on the converter's side and decided to build a little board with a lot of +5V and GND connections to power them all from. It saved a lot of room.

I stuck the different converters down with 2 component glue and used plastic stand offs to bolt the Arduino down. I added some glue to the back of the IEC connector as well for a bit of added rigidity. My IEC connector has an inbuilt ON/OFF switch that I can use to power off the whole unit. It has as well a fuse draw where I have put a 1.6A /250V fuse for protection if anything had to go bad with my cheap power supply.

I used my dremel tool and some files to make the openings into the enclosure and make it look nice. I have as well carved an opening for the IR sensor at the front of the enclosure above the LCD.

I have not drawn a proper schematic drawing for the wiring to the Arduino, let me know if someone would prefer to have one instead of using the picture one I have made up.

Don't hesitate to comment if needed and I will happily answer questions and update this instructable to make it more complete or easy to understand.

Step 9: Hacking Into the HDMI Switcher (optional)

For our Arduino to tell which source the HDMI switcher is actually displaying, we need a way to send this information from the switcher to the Arduino. Luckily, the switcher the switcher has 5 LED's to display source 1 through to 5 when selected and we are going to use these signals for the Arduino.

I have taken a signal from the 5 LED's but later when I wrote the Arduino code, I realized that I did not need a signal from the LED number 1, if you look closely at the ribbon cable connection to the Arduino, you can see that the brown wire on the right hand side is actually not connected. We only have LED2 connected to A0, LED3 to A1, LED4 to A2 and LED5 to A3.

I connected them to the Analog inputs for no other reasons that convenience of the wiring into my project box.

If you decide to build this project and do not want to have an LCD display on the front panel, this step is not needed and can be skipped. It will be hard to know which source is selected on the HDMI switcher if the LED's on it are out of view like in my project design where the switcher is housed inside the enclosure.

Step 10: The Arduino and Arduino Code

For the Arduino sketch to compile properly you will need 2 libraries:

Adafruit_NeoPixel.h that you can download here

LiquidCrystal_I2C.h that you can download here (version 2.0)

I have tried to add as many comments as possible through the code. If anything is unclear, don't hesitate to post a comment and ask questions. They can help a lot of people.

Having a look through the code that I have attached to this step.

Here you can select a start color for the LED strip to light up at startup

#define STARTCOLOR 0xff8000

Datapin is the pin selected where the Din of our LED strip will be connected

#define DATAPIN 5

Led count is the actual number of LED's in your system

#define LEDCOUNT 232

The baudrate must not be changed, or it will need to be changed in the Hyperion config file too

#define BAUDRATE 500000

This is the brightness level you want your LED strip to operate at. Testing required in your environment. 0 to 100 selection

#define BRIGHTNESS 90


This line below is probably the hardest thing to understand and has to be modified to work in your setup.

const char prefix[] = {0x41, 0x64, 0x61, 0x00, 0x??, 0x??};


Start by taking the first 4 bytes, it never changes. So you can already write const char prefix[] = {0x41, 0x64, 0x61, 0x00, and it will be correct.

This is not that bad in the end. For the 5th byte. In my system I have 232LED's. The 5th byte calculation is to substract 1 from my LED number and transform the result in HEXADECIMAL value. 232 - 1 = 231. 231 in HEX = E7

Now we have to deal with our 6th byte. It is an "exclusive OR" function or XOR function between to numbers. The first number will be 55 and this never changes. The 2nd number is your calculated 5th byte. In my case it is E7.

Use the following 5th and 6th bytes in the line of code, replacing the ?? and you are done.

At the end of the code, in the check_source() routine, this is where you can change for each source the information that is going to be displayed on the LCD when the source is selected like TV or PS4 or computer etc etc...

You can set the LCD cursor as well to have the printed name printed in the center of the LCD.

Once you are happy with your code you can upload it to your Arduino and check that it works correctly with at least the LCD for now.

Note that it will take a good 20 seconds to start as I added long delays at the beginning of the code to avoid having strange reboots of the Arduino while the Raspberry Pi was booting up. So don't be afraid if nothing shows up on the screen straight away. One way to tell the code is running is the LED of the ON/OFF button should light up at startup.

Step 11: Bringing It All Together and Testing

Raspberry Pi and Arduino can now be linked with the USB cable.

LED strip has been connected to the enclosure and to the Arduino.

Arduino and Raspberry are programmed.

5V supply from the power supply is going to all the different converters Arduino and Raspberry.

When power is applied to the project box, the HDMI switcher LED source is light up, Source channel can be change by the mean of the remote control or button on the switcher.

Select the source on your TV where you connected the main cable from the project box output and see if you are getting an image on the screen from whatever source you have selected on your switcher.

After a few seconds, the LED strip should progressively light up and the switch off. This mean the Arduino has started and the connection with the LED strip is good.

Soon after, the LED strip should start displaying colors as per the information passed on by the Raspberry.

Succes!! You have now finished your project and can start enjoying some entertaining TV light show!

Step 12: Control Your LED Strip From Your Phone

To add a bit of fun to this, you can download an App on Iphone, I am sure it must be available for other devices as well.

Very easy to use, just make sure your Pi and LED strip are ON and press the Detect button on the top left. It should detect the Server, that you can name as you wish to.

Select it and you are all set, you can pick colors from the color wheel and your strip will light up accordingly or chose from different effects to be displayed.

Step 13: Update for the New HyperCon Program

As some of you have stated in the comment section, Hyperion have come out with a new version of HyperCon which contains more settings to create your hyperion config file.

If you are using this new program you will need to skip Step 4 and do this one instead.

Start by opening the program HyperCon.jar.

I have added as much info as possible on the pictures, you can refer to them to help you through the setup.

Under construction, if you select LEDs in the corners of your TV, like me, you will have to substract 2 to your actual numbers of LEDs on the Left and 2 on the right side of your TV.

On my TV, I have 47 LEDs on each sides but I had to write 45 in the boxes to account for the corner LEDs added.

As a control, on the bottom right corner of the HyperCon window, the numbers of LEDs shown should match up to your physical number on your TV.

At the bottom of the HyperCon page, you have a help/wiki button. It will bring you to a nice page with all relevant infos and explanations on the different possible settings if needed.

Once your configuration is complete, you can click the "Create Hyperion Configuration" button and save the file somewhere handy.

After several unsuccessful attempts, everything works perfectly. I used a pi zero W and Librelec for the wifi to work. I would post photos and my configuration files as soon as I would have made a box.
<p>I'm near the end of this project, but having issues with the external grabber. I'm still trying to get my hands on a UTV007, but in the meantime have found a STK113. When using this one, HyperCon locks up everytime I try to &quot;Take Grabber Screenshot&quot;.</p><p>What could he going on here? Is it the chipset that's causing the issue? My grabber is currently the only thing connected to an active USB hub, so it's definitely not a power issue.</p>
<p>Does your version support 24p from an HDMI source eg a bluray player? Most of the others don't which unfortunately make them useless for me.</p>
I would like to replicate this project, using a raspberry pi 3 shouldn't it be easier due to the HDMI port? What other hardware should be needed other than that, the Arduino and the led strip?
<p>Thanks for this wonderful tutorial!</p><p>Now i need to make a box to put everything in it.</p><p>Used openelec 7 beta 3.</p><p>I had problems with hdmi grabber not working, check step 13 hypercon, tab &quot;grabber&quot; , i need to have a lower number on priority channel for grabberv4l2 than the number in the priority channel for &quot;internal grabber&quot;. </p>
<p>Hi <a href="https://www.instructables.com/member/NicaG2" rel="nofollow">NicaG2,<br></a></p><p>How did you power your led strip ?<br><br> </p>
<p>i've used a power supply : <a href="https://www.aliexpress.com/item/DC5V-10A-50W-LED-adapter-driver-Power-Supply-Transformer-for-LED-Strip-LED-module/32615994621.html?spm=2114.13010608.0.0.lIXEeW" rel="nofollow">https://www.aliexpress.com/item/DC5V-10A-50W-LED-a...</a> , and i hooked up everything to it ( including raspberry/arduino/splitter/av converter)</p><p>You still get the blue light from Kodi ( installed on your raspberry... go to hypercon and &quot;I THINK you need to disable &quot;enable internal grabber&quot; &quot; so that when you power off your hdmi output the rasberry will not switch to Kodi ( witch has a blue theme) </p>
<p>I had problems with a bad grabber I bought from Eb@y... My new one is ok now : <a href="https://www.amazon.fr/gp/product/B0013BXFLG" rel="nofollow">https://www.amazon.fr/gp/product/B0013BXFLG</a></p><p>Configuration of the Hyperion was not so easy, don't forget to delete first your old file, transfer the new one, and reboot the PI...</p><p>My configuration : FREEBOX (the only source I have) --&gt; HDMI splitter (one goes to the TV and the other one to the HDMI to AV) --&gt; HDMI to AV --&gt; PI3 --&gt; Arduino UNO --&gt; led strip</p><p>I didn't buy any power supply like the 5V10Amp <a href="https://www.instructables.com/member/pfoglietta/" rel="nofollow">pfoglietta</a> recommends . The HDMI splitter and the HDMI to AV are powered with a powered usb switch. My arduino UNO and the LED Strip have no power supply, everything goes throught the USB from the PI3.</p><p>Everything works great BUT :</p><p>- when I shut off my FREEBOX, all the leds remain blue...</p><p>- Hyperion process sometimes crashes with a buffer overflow. I think I will have to power the Strip LED but I don't want to by a 5V10A power supply. Can I power the Stip another way ?</p>
<p>Hi,</p><p>i have a little problem with the HyperCon. Please guide.</p><p>Snap is attached. Thanks :-)</p>
<p>Great work, thanks! I have some questions. I am watching TV only from my TV box - iconbit xds73d mk2. My tv box has component video out and if I'm right, then I do not need to use an HDMI converter??</p><p>In my mind: iconbit xds73d mk -&gt; Easy Cap -&gt; Raspberry Pi -&gt; Arduino -&gt; LED Strips. All of it connect to 5v20a power supply.</p>
<p>Hey guys i wanting to make this for my PC dual monitor setup.</p><p>just wanted to know that do i need exactly this same components since it will be connected to my PC not TV?</p><p>i mean do i will the ARDUINO UNO only will do and or will need the </p><p>RASPBERRY PI and the video grabber and the spliters?</p><p>Do i need all of this items since i am going to use for my PC monitor setup?</p><p>HELP NEEDED first time going to use ARDUINO &amp; RASPBERRY</p>
<p>Hello Pfoglietta, i cannot get the hypercon-install to my raspberry. The link doesn't work, can you help me?</p>
<p>Hello, in my Philips SmartTV I still have a SCART connection, can I connect it directly to the video grabber to have the video signal? So I can skyp all the HDMI switchin/splitting/converting part and still have ambilight for all sources.</p>
<p>I tried to make the PCB that powers all the devices at once but sometimes it keeps flickering off. Can I ask you for the circuit diagram just in case I got it wrong? Many thanks.</p>
<p>Hello,</p><p>I mounted my Ambilight following this excellent tutorial, but the result is a little bit poor: Often the System choose the wrong colors and it already reacts too slow.</p><p>My setup is:</p><p>Raspberry Pi 2</p><p>OpenElec with Kodi 6.0</p><p>Hyperion</p><p>Arduino Uno</p><p>188 WS 2812b Leds</p><p>Has anybody an idea what could be an option to make the system running as planned?</p><p>Another point: How can I shorten up the Arduino sketch, because I only want to use 1 Input, so the part for monitoring the input device and singalize it on LCD is already unnecessary for me.</p><p>Thanks a lot</p><p>Screwdriver</p>
<p>Hello,</p><p>Starting by the arduino code, this will not really make the system any faster as it is designed to update the LCD only when it is not receiving active data from the Pi. The LED data received has priority over updating the LCD.</p><p>If you want to get rid of it your can remove the lines as per the attached photo.</p><p>Have you tried getting a screenshot of your system to see what the grabbed image looks like? I had a problem where sometimes my grabber would get images that are complete garbage with completely wrong colors. This could explain the problem. Slow reaction might be due to too many &quot;frame too small&quot; received by the grabber. As per JwJolly88 's picture below.</p><p>Let us know.</p>
<p>so, got the new power supply in (much less noise), and fired it up today. when looking for the file I found one by the name, though it doesn't have the .sh file extension. </p>
<p>I wouldn't think that would matter...... the sh extension just means it's a shell script....looking at the permissions.....it has &quot;x&quot; for execute....so it should work.</p>
It should have one with .sh as well. For some reason i can't upload .sh files on here. Can you send me your email address and i will send you a copy of my file.
Sure, email sent to you in private message
<p>File sent to your email. Let us know how it goes.</p>
<p>any ideas?</p>
<p>Ok..so got the .sh file copied over and when trying to take screencap through hypercon, this is the output log</p><p>ssh out: /storage/hyperion/bin/hyperion-remote.sh -c e5fffa<br>ssh in: Connected to localhost:19444<br>ssh in: Set color to 229 255 250<br>ssh out: /storage/hyperion/bin/hyperion-remote.sh -c ff699d<br>ssh in: Connected to localhost:19444<br>ssh in: Set color to 255 105 157<br>ssh out: /storage/hyperion/bin/hyperion-remote.sh -c ff669a<br>ssh in: Connected to localhost:19444<br>ssh in: Set color to 255 102 154<br>ssh out: killall hyperiond 2&gt;/dev/null ; /storage/hyperion/bin/hyperion-v4l2.sh --device /dev/video0 --video-standard PAL --input 0 --width 240 --height 192 --crop-left 0 --crop-right 0 --crop-top 0 --crop-bottom 0 --size-decimator 1 --frame-decimator 2 --red-threshold 0.0 --green-threshold 0.0 --blue-threshold 0.0 --screenshot<br>ssh out: sh: /storage/hyperion/bin/hyperion-v4l2.sh: Permission denied<br>sftp getFile(./screenshot.png, java.awt.Image)<br>ssh out: /storage/hyperion/bin/hyperion-remote.sh -c ff6ea2<br>ssh in: Connected to localhost:19444<br>ssh in: Set color to 255 110 162<br>ssh out: /storage/hyperion/bin/hyperion-remote.sh -c bcecff<br>ssh in: Connected to localhost:19444<br>ssh in: Set color to 188 236 255<br>ssh out: /storage/hyperion/bin/hyperion-remote.sh -c 39ff4e<br>ssh in: Connected to localhost:19444<br>ssh in: Set color to 57 255 78</p><p>As you see I did a manual change to LED color through hypercon, which worked just fine. For some reason, it is not allowing access to the .sh file from what I can see.</p>
<p>Cool project. I've been looking to do something like this but I want it to work on a retractable projection screen. Maybe with side firing leds that drop down with the screen? Not sure.</p><p>My idea that I'd like people to chime in on though is this: Take a pi with a camera attached and a small touch screen or app to set up with. Mount it anywhere that can see the screen. Send the data wired or wirelessly to a light controller. It could set itself up be looking at the lights with the camera. You just need the screen to position the viewable image, although I can see that being automated as well. The benefit would be it's easy to set up, can be easily moved, and is not dependent on the source at all. The negative would be mounting the little pi/camera box somewhere. </p>
<p>I really need help...</p><p>I want to use Arduino Uno, LED Stripes with WS2812B and Ambibox to make the ambilight. I tried like 10 tutorials and always get problems with uploading the program to my arduino. There's no error in the program but nothing happens on the LED-Strip, beside the running project stops working. But every tutorial seem to work for everyone just me.<br><br>It can't be a problem with wiring bc other programs are working.<br><br>Did anyone also had this problem or knows where the problem could be?</p>
you have to make sure your XOR values are correct also the type has to be adalight and your output must be dev/ttyAMCO. I had the same problem till I changed it. hope this helps.
why is arduino necessary for this? can not we use raspi gpio instead to control led strip?
​Great write-up, thanks!<br><br>So I decided to take it slow and first of all build a very basic setup which I would expand afterwards. I currently have just the Raspberry, the Arduino and the WS2812B LEDs connected and the Ambilight works perfectly for any media played on Kodi. <br><br>However the LEDs lag behind. There is about 0,5s delay. i.e. the LEDs change about 0,5s after the picture changes.. Any way to fix this? There seems to be a parameter which can delay the LEDs in case they are faster than the picture but in my case it is the other way around. Any ideas?
Awesome&lt; build, I used osmc and you tube info to make but all inspired by this great project. Few problems with dev/tty (mine was ACMO) Hyperion doesn't load your saved config. file and the arduino sketch throws up a warning when you change char prefix but all good now. Thanks again
<p>Thanks for the great instruction. I recommend the Fushicai usbtv007 video grabber instead of the Syntek STK1160 grabber. No frame to small errors.</p>
<p>Hi pfoglietta.</p><p>This is a nice instructable.</p><p>I have a question. I made ambilight using teensy board, and I am curious whether Teensy/Rashpberry Pi combination will work or not.</p><p>I've chosen Teensy due to its high feedback speed between data source and LEDs. (I used Adalight)</p><p>I want to keep the feedback speed that I have now, but want to get various inputs like you did. (If your setup has no speed issue, then it would be best!)</p><p>Second question is that; will it work well in the case of HDMI 2.0 sources (4k)? Not sure whether the grabber will convert the hdmi source into RGB properly.</p><p>I will wait for your reply, thx!</p>
<p>Hello guys! I would like to know if the CROP values are defined in therms of another thing? Because I try like 20 values for 1 CROP and I couldn't make it work and if I have to try I don't know were the limit is! Thank you very much for your time!</p>
Hello <br>First let me thank you for your big project and the answer of every problem! <br>I have made this one week ago I think and it is awesome I just use the internal grabber because I don't have all the things to do the entire project <br>But two days ago I have received the part who's missing <br>And it is running when I'm on the raspberry but when I change the input of my TV to the chromecast or the ps4 every led is black I suppose it is the grabber but I'm not sure
<p>First, thank you again for all of your help thus far pfoglietta! So, because my brain just refuses to let me take a break from this until I get it working, I have done a bit more troubleshooting this morning. After changing the resolution down to 320;280 and still having frame size errors, I wanted to look further into the cause. I went ahead and checked my json file, just to be sure I had A. made the correction and B. loaded the correct file. Values match what they should be, however after trying again to run the screenshot command, it returns entirely different values for what the sizes are set to. Is this normal?</p>
<p>I suppose it is also worth noting, I am powering my Ard. Uno directly through the USB from the RasPi. Could this be causing a power drop on the Pi that would make the vidgrabber lull? If so, how did you power your Arduino? directly to the +5/GND pins from the power supply?</p>
Yes it is normal it returns different values as this is a screenshot that doesnt use the actual hyperion config.<br>Maybe you can try to connect to your Pi using the 5th tab on hyperCon and see how it performs.<br><br>Powering the arduino via the usb is a definate no go. Power it via the +5V and GND header pins instead.<br><br>Let me know how this works.
<p>Ok, this morning I went ahead and hard wired my power for the arduino. Sadly no luck though. I am starting to wonder if I have compatability issues. I checked via putty to ensure that my vid grabber was recognized, but from Hyperion if I right click the image the &quot;take screenshot&quot; option is entirely grayed out. Granted, I wouldn't expect it to work since doing it via CLI doesn't work. However, it does seem strange that it doesn't even recognize that a grabber is available, especially since hyperion itself has an internal one.</p>
That is strange, have you connected to your Pi before trying to take a screenshot with HyperCon? Maybe you can post up the log file that appears when you connect with HyperCon to see what is happening
Wel outside of this project I have never touched a pi or Hyperion. As soon as I get home I will post the log file from connecting with pi. Is there a particular CLI prompt that you would like, or just the traffic log from within Hypercon?
Get the whole log when you connect to your Pi and the screenshot process
<p>Ok so slight update. I have managed to get the LED's to work via the mobile app control, but they are still not receiving information from the grabber. Upon trying to take a screen cap. via HyperCon I am given</p><p>SSH Traffic:<br>ssh connected<br>ssh out: /storage/hyperion/bin/hyperion-remote.sh -c ff425a<br>ssh in: Connected to localhost:19444<br>ssh in: Set color to 255 66 90<br>ssh out: killall hyperiond 2&gt;/dev/null ; /storage/hyperion/bin/hyperion-v4l2.sh --device /dev/video0 --video-standard PAL --input 0 --width 320 --height 280 --crop-left 0 --crop-right 0 --crop-top 0 --crop-bottom 0 --size-decimator 1 --frame-decimator 2 --red-threshold 0.0 --green-threshold 0.0 --blue-threshold 0.0 --screenshot<br>ssh out: sh: /storage/hyperion/bin/hyperion-v4l2.sh: not found<br>sftp getFile(./screenshot.png, java.awt.Image)</p><p>Went ahead and did an LED color change to verify comms, and it checked out.</p><p>Is there any way to see what output the screengrabber is putting out, aside from hyperion? and obviously welcome to any other ideas. thank you again for all the help!</p>
<p>This looks promising!!</p><p>Communication between hyperion and arduino and LED is working for sure as per your tests with the color wheel.</p><p>Now our only issue is the grabber. If you look at the log, it is looking for the hyperion-v4l2.sh but cannot find it in the path stated above. ( /storage/hyperion/bin/ ) Can you log into your Pi with WinSCP and go to the path above to see if the file is in there or not please.</p><p>If you can't find the file, try an locate it in any other folders and move it to the correct location. If you can't find it, I will send you mine. </p><p>Once the file is in the correct folder, run the test again and let us know the result.</p>
I have already been using the ssh tab for communication, if for nothing else it gives me a readout so I know for sure what took place. In the morning I will wire up the arduino directly to power and let you know any changes. Thanks again!
<p>Great project idea! That being said, I am very new to working with both Arduino as well as RasPi. I have followed your instructions as best I could, but seem to be running into a similar issue to MartinMemol. Arduino runs boot up color sequence, and then its lights out.</p><p>I have attached what I can think of, after reading your suggestions for his issues. If there is anything else I can do to help figure this out please let me know. I am looking forward to finishing it up.</p><p>My system looks like this:</p><p>Raspberry Pi B+</p><p>Arduino Uno</p><p>45 LED left and right with none in corner positions</p><p>77LED top, with 0 on bottom</p><p>I have also attached my hypercon, Arduino code, and a readout from hypercon when I try to directly install/update hyperion via ssh through it. I have also already entered the &quot;killall hyperiond&quot; command via putty, and am simply returned to the next line. Thank you again for your help</p>
<p>Hi and thank you for the nice comment.</p><p>I can see in your json file that you didn't set the output to &quot;/dev/ttyUSB0&quot; but instead it is set to &quot;/dev/ttyS0&quot;.</p><p>Change this in your hyperCon program and then try and upload the new json config file and test again. MAke sure you power off the system and back on for hyperion to use the new json config file settings.</p>
<p>Thanks, I noticed that this morning as well but neglected to mention it in my update comment. I went ahead and corrected that. I was curious about whether or not my grabber was functioning properly, so I tried to take a screenshot. Here is what I got in return. Hoping it isn't a frame rate issue. As it stands my USB hookup on the pi is, top left and bottom right usb ports are open. Top right has the Grabber, and lower left has a 4way USB octopus. One of those legs is connected to the Arduino, 2 are open connectors in the back of the enclosure(to easily plug in a mouse/keyboard once completed), and the fourth is open. Thanks again for your help</p>
It did happen to me as well. In your hyperCon config, under the grabber tab, try and lower the resolution a bit from -1;-1 to something like 340;280 and try again.
<p>Thanks for the suggestion. Tried making the switch, with very little change. Following initial boot up illumination, I get about .5 seconds of only about 5 LEDs, before it is back to nothingness. Also checked screenshot abilities after the change. Sadly still receiving the same error. :(</p>
<p>Just a small update for this morning. After some rest and looking at hypercon with a fresh set of eyes, I was able to install and upload my config via ssh. Still however no luck with my LED's past the initial boot light up.</p>
<p>A rReally cool project! After some fiddling around it finally works!</p><p>I put all the parts in a cardboard box which I &quot;screwed&quot; to the TV's wall mount holes. Everything looks quite improvised, but since the TV is big enough to hide this stuff, it is a good enough solution for me. For the power supply I used a 4 port usb charger. This powers the LEDs, the splitter box, the raspberry and the hdmi to composite converter. I don't have a hdmi switch since I have a soundbar which does this for me. I also ommited the LCD display since it was not needed for me.</p><p>I still need an idea how to power the system up and down. Maybe the arduino can do something here. By the way, I used an arduino nano since it is much smaller and works exactly as the uno.</p><p>Thank you for this nice project. I enjoy it very much,</p>

About This Instructable

142,325views

1,562favorites

License:

More by pfoglietta:Ambilight system for every input connected to your TV. WS2812B Arduino UNO Raspberry Pi Arduino solar charge controller + output control and data logging online with Xbee WiFi Temperature controlled fan speed using PWM 
Add instructable to: