WS2812b Ambilight Clone For The Raspi

For how often the Raspberry Pi is used as a media server, and how easy it is to connect a bunch of LEDs to the GPIO pins on the Pi, we’re surprised we haven’t seen something like Hyperion before. It uses the extremely common WS2812b individually controllable RGB LEDs to surround the wall behind your TV with the colors on the edges of the screen.

One of the big features of Hyperion is the huge number of LEDs it’s able to control; a 50 LED strip only eats up about 1.5% of the Pi’s CPU. It does this with a “Mini UART” implemented on the Pi running at 2MHz.

There’s only one additional component needed to run a gigantic strip of RGB LEDs with a Pi – an inverter of some sort made with an HCT-series logic chip. After that, you’ll only need to connect the power and enjoy a blinding display behind your TV or monitor.

Thanks [emuboy] for sending this one in.

 

28 thoughts on “WS2812b Ambilight Clone For The Raspi

  1. It’s not new (search for BOBLIGHT for example), BUT it seems, that this time they use the Rasp to analyze the image – making it a true Ambilight-clone. Or it’s just better code… :-)

    I for one suspect that the recent revealing of the DSP’s source is the base for this.
    Good thing that I still have a roll of LPD8806 LEDs here :-)

  2. Pretty sure we have seen stuff quite a lot like this before, even using the Raspi to analyse the image. I recall stuff featured here that was at least very similar. Still, a new way of doing it’s always welcome.

    Not sure where you get the 2MHz rate from, is that just the CPU’s clock frequency multiplied by the 1.5% usage? Or does it mean something else?

    1. They’re abusing the UART to convert 2Mbit 8N1 to look like the goofy 400kbit signal the WS2812 uses.

      I bet they’re sending either the bytes 0x08, 0x0E, 0xE8, 0xEE, which will be two bits of the WS2812’s format, 20% or 60% duty cycle.

      1. Why? Harder to get and more expensive than a cheap transistor (eg. BC549) and a couple of resistors.

        Plus if you’re buying a stock of them, a transistor is definately useful in a wider number of applications than a single inverter IC.

        1. More compact, either sharper transitions or less dependent on exact hFE of the BJT, lower power consumption, same cost when the resistors are factored in (at least, whenever I look for quotes of equal quantity)

          1. For a small DIY job I’d call the compactness a disadvantage – harder to work with.

            “either sharper transitions or less dependent on exact hFE of the BJT”

            True to an extent, but I don’t think it’s a major concern in this design (not that I’ve used addressable LEDs)

            “lower power consumption”

            When you’re powering tens of LEDs, I don’t think a milliamp or two here or there in the inverter circuit really counts as significant.

            “same cost when the resistors are factored in (at least, whenever I look for quotes of equal quantity)”

            None of the electronics stores Iuse stock these Inverter ICs, so I’m just going by Element 14’s price which is $0.10 cheaper in single quantities than a single transistor and two resistors from my usual electronics store. I’m sure you could find both options cheaper, but I don’t get the point when a transistor and two resistors is so much more versatile (so you can buy in bulk more hapilly anyway).

            Plus a BC549 can give you 100mA output current compared to 32mA, and a far wider operating voltage range.

    1. Yeah, current is the issue.
      Keep in mind the raspberry Pi is designed to powered from a 1amp 5volt smartphone charger and as such it isn’t designed to conduct much current on the 5volt trace.

        1. I power my pi from a scavenged PC power supply which also powers whatever else is going on. I cut a usb charger cable and wired it the power supply’s 5v and ground so that it plugs into the pi without bypassing the fuse.

  3. It isn’t just the ws2812b, it can use a number of LED Strips, also it uses the dispmanx in the Raspberry Pi firmware (thought you might want to mention this) with XBMC. Also has a JSON interface, can use V4L Devices, Compatible with boblight, has android app and a web interface to change static colours and load effects. With a little research you could of made a good article about it.

    1. Ih you have a device with processing power to spare, then the WS2812b is vastly superior since the only extra component needed is a decoupling capacitor across VCC and ground.
      And even then it isn’t always needed..
      And the WS2801 isn’t available embedded inside a 5050 packaged RGB IC, it’ll need a separate RGB LED since the WS2801 is a controller for RGB LED’s and not a all-in-one package.

  4. It will work until/unless some other interrrupt comes in and blocks the next UART character from going out. It might be fixed with the next burst, but it won’t be 100%.

  5. Could you teach how to use lattice ice40UP(FPGA) control ws2812B?
    If I want to use development board how to jump control ws2812B?

    Beginning student

Leave a Reply to GreenaumCancel 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.