FPGA Ambilight Clone Packs A Ton Of Features

[Stephen] designed a standalone Ambilight clone built around an FPGA and recently added many new features to make his design even better. His original design was based around a Spartan 3-E FPGA, but his new design uses the Papilio One board with a Spartan-6 LX9 FPGA. This gives him dedicated DSP hardware and more RAM, allowing him to add more processing-intensive features.

[Steven]’s new board can drive up to 4096 LEDs total, and each LED is colored from one of 256 segmented screen areas. The output of the LEDs is smoothed over a configurable time period which makes the result a bit more pleasant. [Steven] also added color correction matrices and gamma correction tables to make up for differences in LED coloration and so the output can be fine-tuned to the color of the wall behind the TV.

Finally, [Steven] added multiple configurations which can be stored in Flash memory. The FPGA can detect letterboxes and pillarboxes in the video stream and change to a corresponding configuration automatically, so settings rarely need to be manually adjusted. He also added an extensive serial interface to configure all of the parameters and configurations in Flash. Be sure to check out the video after the break to see his setup in action.

59 thoughts on “FPGA Ambilight Clone Packs A Ton Of Features

  1. Wow! Best ambient light control I have seen yet, makes me want to give it a try :P. Do you think you could post a bit more information about your hardware setup? maybe a picture of the back of the TV?

    1. Thanks!

      The current setup has 330 LEDs. There are 20 between each of the three shelves on the left and another 20 between each of the three shelves on the right. They’re at the back near the wall and they help with the visible resolution as the wall is a way back from the TV and lights only on the TV tend to blend together before they make it to the wall. They’re mounted in bits of plastic trunking so you can’t see the LEDs directly.

      Shelf light units:
      http://hacks.esar.org.uk/29th-30th-november-2014/hdmilight-install-shelf-lights/

      Shelf lights installed:
      http://hacks.esar.org.uk/29th-30th-november-2014/hdmilight-install-shelf-lights-fitted/

      The rest of the LEDs are behind the TV and are mounted to an aluminium frame that hooks onto the TV wall mount:
      http://hacks.esar.org.uk/6th-7th-december-2014/hdmilight-led-frame/

      There is a double row of LEDs on the top to help combat the dark purple wall above the TV.

    1. It doesn’t handle HDCP, though in theory it can if you can get hold of the non -P variant of the ADV7611 chip (i.e. not ADV7611BSWZ-P), but you need proof of having a HDCP license to buy that variant :(

      I’ve not created a BOM (other than what the Eagle schematic contains), as for cost… it’s not exactly cheap, a commenter on my post for the original version (http://hacks.esar.org.uk/hdmi-light/#comment-1836) added it up to $208, though I’ve not verified that and you also need to adjust for a Paipilio Pro instead of Papilio One, so somewhere around $250!

    1. Yeah, setup is kind of tedious, especially as it’s currently done by manually entering numbers into text config files. It probably took me an hour or two to get everything lined up, then maybe another hour or two messing around with the gamma and colour correction.

      I like the webcam idea, for the LED positions that would almost certainly work, it might even be able to calculate the colour correction too.

  2. HDCP is a point to point protocol. It uses a key vector read from your TV’s DDC bus to encrypt the stream. Therefore any splitter device must first decrypt the signal then perform a separate independent encryption setup to each output device. Hint, most don’t do the later.

    1. I just tried it with a Panasonic Bluray player and the only splitter I have here, which is a “Neet 2 way smart splitter”:
      http://www.amazon.co.uk/Neet%C2%AE-SPLITTER-Amplifier-Display-Shipping-BLACK/dp/B001D9P1OW

      First impressions are that this splitter does re-encrypt. I can’t even get the bluray players menus let alone any copyrighted content, though maybe something else is wrong.

      If anyone knows of any splitters that don’t re-encrypt, let me know, I might get one to test with.

          1. Beautiful…There should be a 2 pin and a 5 pin header on the board somewhere. (they may not be populated with headers. Short the 2 pins on the 2 pin header together and it won’t encrypt anymore. (You’re shorting pin 16 of the EPF001A to 3.3V (holding it in bootloader mode so it doesn’t talk to the EP9132.)

          2. There only appears to be one 4 pin header, but it does go to the EPF011A (not EPF001A as I said earlier):

            gnd, pin 62, pin 63, pin 16

            How sure are you on connecting pin16 to 3.3v? I can’t find a datasheet.

          3. I’m 100% sure. If you want to validate my knowledge Pin 62 is RX, 63 is TX for RS-232. 57600 baud. You MAY get some debug information to spit out…it depends if they left that in the code. If pin 16 is at 3.3V you will just receive a stream of semicolons.

            Also, Pin 16 must be at 3.3V before you apply power. If you’d feel safer you can pull it high with a resistor, but there is a 4K7 resistor pulling it to ground, so you’d have to remove that.

          4. I found some strapping points on the bottom of the board, one of which went from pin 16 to 3.3v, so I added a 0 ohm resistor, which resulted in the following serial output:
            [KL56C]

            InFile: project.hex
            OutDate: 2010/03/26
            OutFile: kl56c.hex

            Use KL5xC IO Define
            D=0x70 Deep Color Detected
            Err: IIC failed 2, IICAddr=0x61, RegAddr=0x04
            Warn: D=0x60 No EPCC detected
            Err: IIC failed 2, IICAddr=0xE1, RegAddr=0x04
            Warn: D=0xE0 No EPCC detected
            Err: IIC failed 2, IICAddr=0xE3, RegAddr=0x04
            Warn: D=0xE2 No EPCC detected
            EDID Mixing Algorithm Change to Mode 0
            ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

            But now it won’t negotiate a connection to the TV at all, so it looks like the “before you apply power” is kind of important :)

            will try that next.

          5. I just noticed you said it was an EPF001A. Are you sure it’s not EPF011A? It may be a different pin if it’s 001A.

            The 9132 will decrypt the HDCP from the input and output non encrypted HDMI with no microcontroller. The microcontroller on the board is there to handle the HDCP authentication with the TVs. Pin 16 on the EPF011A is the OP_MODE pin. The microcontroller checks this pin when it is powered up. If low, it starts running, if high, it enters ICP bootloader mode.

            In bootloader mode the RS-232 should transmit a steady stream of semicolons. And as a side effect, it does not communicate with the EP9132 IC or the TVs connected to the outputs…so no encryption.

          6. So, if applying 3.3v just stops the microcontroller doing anything… rather than spending time making something to delay powering up the board, I wonder if it would work if I just cut the power trace to the microcontroller? Worth a try I guess.

          7. That should do the trick, you can completely remove the microcontroller if you want. One note: the microcontroller controls the reset signal to the 9132, so if it stops working after disconnecting the microcontroller power (or removing it), check to make sure that Pin 25 of the 9132 is pulled high. There should be an unpopulated 0603 resistor just for that.

            This will also work on a 4 port splitter with an EP9134, in case anyone has one of those.

          8. Esar…I don’t know why I didn’t think of this sooner…but on most designs I’ve seen with the Explore splitter ICs there are 0 ohm 0603 resistors in series with the I2C between the micro and the splitter. If you remove the 0R resistors connected to pin 35 & 36 of the 9132 it will have the same effect…and you won’t have to worry about the reset pin that way.

          9. Thanks, it does have 0 ohm resistors on the I2C, though it appears to be pins 36 and 37 rather than 35 and 36.

            After that it works almost perfectly… it’s all decrypted but there’s a minor issue possibly with DDC/CEC. Whenever the mode changes it makes the TV switch to HDMI-1 (should be on 2), then switching the TV to HDMI-2 makes the AV Receiver switch away from the blu-ray player.

            I’ll do a bit of sniffing over the weekend and see if I can resolve it. I’ve managed to track down a copy of the EP9132 datasheet, which should help.

          10. Esar, looking at the datasheet for the 9132, it looks fairly easy to bypass the re-encryption of the transmitter by clearing a bit in one of the registers. It also appears that some of the configuration that the controller is doing may be needed. You should be able to sniff what values are sent to the 9132 via i2c and then simply leave the re-encryption bits cleared. Then, add your own microcontroller of choice to send the configuration to the chip and leave the one on board disabled.

          11. @RoyTheReaper
            Do you happen to also know how the bootloader protocol works?
            The EPF011A datasheet alludes that you can upload code for execution without flashing in ICP boot-loader mode, but doesn’t explain the ICP protocol at all.
            Maybe someone with a Dataman 48 Pro can sacrifice one EPF011A and sniff the flashing sequence? It supports flashing the chip starting with software version 3.21…

        1. Pls help, 9132 datasheet says it need external eeprom with key but I dont see it on pcb and on diagram there keys inside chip. Is there different versions of 9132? wich one with keys inside?

  3. Nice build and all but completely utterly totally don’t get the attraction of flashing colored lights when you’re trying to watch a movie. Right up there with the ushers and their damn flashlights waving in your eyes while you’re at a movie theatre.

    1. The caps are all 0.1uF, forgetting to fill in the values is a bad habit of mine that I need to get out of!
      For reference, the board design is mostly derived from this app note:
      http://www.analog.com/static/imported-files/circuit_notes/CN0282.pdf

      I didn’t know the IP4776 had been discontinued, that’s a bit annoying.
      From a very quick look, the CM2031 from On Semiconductor looks like it might even be pin compatible… but no, it’s end of life too.

    1. :)

      Funny you should say that… I’ve been thinking of getting a projector to play with and having it project an image with a hole where the TV is. Maybe play around with some more complex image processing to try and separate the background and foreground of the picture and then attempt to extrapolate the background. I think I saw something like this from Microsoft in the past.

      I know sod all about image processing though so I’ll have a bit of a steep learning curve.

  4. Esar, would you have any plans of getting this produced on a larger scale? Perhaps kickstart or indiegogo?
    I would think, if it were promoted, you would have a lot of interest.

    Otherwise, what is the way you went about getting your board made?

    I assume I would have to send your file to a PCB shop then buy all the parts you listed?

    It wouls just be awesome to have one that I know will work! :)

    1. I’m making a rev of the board to fix the DC supply, put in values for everything and a few other minor changes, pass OSHParks validation checks, which will result in a BOM with part numbers for mouser/digikey. I’ll share the PCB on OSHPark so that it can just be clicked on and ordered (OSHPark allow open source boards to be permanently shared).
      Approximate cost for 3 copies of the PCB will be about $75 on OSHPark. But only if Esar is okay with me doing that as he’s the author of the project.

      1. Yeah, go for it.

        It’s all GPL’d and I’m happy for anyone to do anything that the license allows, including commercialising it and selling a finished product (something that I’ve got absolutely no interest in doing myself)… provided any changes are kept open and GPL’d.

          1. Does anyone have a digikey / mouser shopping cart they can share? I am not an electrical engineering and am unsure about some of the components (specifically what caps to order). I have a cart going from digikey here http://www.digikey.com/short/74zfwd. Was wondering if someone could take a look before I start ordering parts all willy-nilly.

      2. It would be cool if you could combine his hdmi board with a splitter all on one board. It would be even cooler if the Spartan 6 was included on the board too and this would become a true single board solution. My board routing skills are just not up to this…

Leave a Reply to esarCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.