I’ve previously mentioned that I was initially using this code by James Bruce to drive the ambilight. While I was waiting for the circuit board components to arrive, I thought I would take some time to expand on his work, fix some bugs, and add a few features I thought were missing. After a few recent tweaks it’s now ready for distribution.

Presenting: Adalight-FastLED!

I’ve reworked the Adalight code to provide user-friendly options that allow you to easily customize it for your setup. I also added a brightness limiter and a calibration mode, which sets all LEDs to the same values.

Although I’ve only tested it with WS2812B strips, in theory the code should work with any FastLED supported chipset! These are relatively small changes from a programming standpoint, but it should make it easier for anyone to build their own Adalight setup without mucking around with the code.

I’ve created a git repository for the project, which I’ve decided to call Adalight-FastLED. You can find the repository, with the download links, here:  https://github.com/dmadison/Adalight-FastLED

If you find an issue with the code or can confirm that it works with a specific LED type, please let me know! (Creating an issue on the GitHub repo would be the preferred method.) I’m hoping to keep the repository up to date for the foreseeable future.

This post is part of a series on creating a DIY ambilight using Adalight and WS2812B LEDs. Check out the project page here.

Next up: Part 7 – Videos and Gifs


Mason · April 18, 2017 at 10:05 pm

I tried your sketch “Adalight-fastLED” with FastLED 3.1.3 library and Prismatic but the LED didn’t light up at all, the Led works fine with Adafriut Neopixel Library so i know for sure its not a hardware issue, any idea how to fix the issue with your code ?

    Dave · April 18, 2017 at 10:27 pm

    The current code has no issues that I’m aware of. Check that you have the correct serial port selected in Prismatik, otherwise try sending data through another application or switching USB ports / cables.

    Scratch that last – someone else reported an issue with the code if your LED length is above 85. You can try out a test fix on the ‘development’ branch, otherwise expect a fix in the next release.

Daniel · April 22, 2017 at 7:02 am

Hi Dave,

nice project and well done work.

I tried the “Adalight-fastLED” Release 1.1.0, but the Leds wont light up. I have 114 leds. I tried it with 60: works fine.
The limit is 85 leds. I did not debug the code, but 85 leds with 3 byte color is 255 bytes; i think this causes the limit.

Is there an intention to make Adalight-fastLED work with more than 85 leds?

I used FastLed 3.1.3 with prismatik 5.11.3.

    Dave · April 22, 2017 at 3:58 pm

    Hi Daniel,

    Thanks for the kind words. Someone else reported the same problem earlier this week. I’m not 100% sure what’s causing the issue, but I have a hunch. I’ve pushed a test fix to the ‘development’ branch on Github, which works for LED lengths above 85 on my setup. See if that works for you, and I’ll include the bugfix in the next release.

      Sofos · November 8, 2017 at 8:24 am

      Hi there,

      Since I’m starting to collect what I need for this project…I want to do it with 144 leds/m LED strip.
      I have a 34” inches ultrawide monitor. From my calculations that is 108 leds at the top and 43 leds at the side so total of 302 leds. Is it possible or there’s still the limitation of the 85 leds?
      Thanks in advance.

        Dave · November 8, 2017 at 8:51 am

        The 85 LED limitation should be fixed and work fine with 302 LEDs, although I’ve never tested with that many. I’d recommend against it though, as your framerate will be very poor (see the appendum posts about Adalight framerate).

sofos1990 · November 8, 2017 at 9:07 pm

Thanks for the reply. I just read it very fast. I will read it carefully later today.
I just wanted to ask according to your experience…is the difference between the LED strip and the actual monitor colors noticeable? I mean at the point where the LED strip will have a different color than the monitor.
Also, I’m reading that using a faster micro-controller won’t help much because the code is already lightweight but I was thinking of using 2 or even 3 Arduinos (1 for both the sides and 2 for the top and bottom). Most likely it won’t make any difference but let’s say I do it how do I mix them all in the Prismatik software?

    Dave · November 8, 2017 at 10:28 pm

    If you haven’t already, I’d recommend reading through the entire build series for my ambilight. It should answer most of your questions.

    The big limitation speed-wise is the throughput of the virtual serial port. Prismatik doesn’t support multiple serial outputs; you can’t run 2 or 3 Arduinos without some sort of go-between.

Sofos · November 9, 2017 at 10:44 am

Hi Dave,
You were right yeah after I read the build I think I will give it a go.
Definitely the more LEDs will add more latency but I still believe it won’t be bad. The 60 leds/m seems pretty ok to me from the video and from what you describe. Hopefully 144 perform the same.
I’m trying the software now but Prismatik only allows up to 99 leds. Horizontally I need 108 and ideally 112. Vertically I need 43 but the best would be 49. How can I allow more than 99 leds per direction on Prismatik ? Ambibox allows 300 zones max. and I need ideally 322. Bambilight allows 100 per direction so it’s still less. Hyperion allows more but it only works with Raspberry Pi? I can’t find any guide with Arduino. There’s seem to be a version of Ambibox which allows up to 400 zones(leds) but it’s not available in the public. Only the guy who modded it has and he doesn’t seem to be active anymore. Any idea?


    Dave · November 9, 2017 at 11:49 am

    If the software doesn’t exist, you’ll probably need to program it yourself. As a stop-gap you could modify some driver software to make logical groups of LEDs running off the same color data, which would allow you to use any of that software.

    Although again I’d recommend not attempting to build an ambilight setup with that many LEDs for a variety of reasons.

Mpegger · July 13, 2019 at 2:30 pm

I was having problems with my 270 LED SK9822/Prismatik setup (couldn’t go over 20FPS without random flashes of color) and I stumbled upon your site in my search for help. I saw that you were having no problems with high FPS rates and so I downloaded your code and it works great! The 270 LED setup can do 60FPS now, running with a 2,000,000 baud rate.
All the other scripts I tried so far, along with edits I performed here and there (I have ZERO Arduino/programming experience, but I understand the basics of coding), did not solve my problem, but your code worked without a hitch! Thank you for your code!
One thing I would like to know, is what the optional GROUND_PIN is for in the script? I am tieing the ground from the LEDs to a normal ground pin on the Arduino, but I did not uncomment the Ground_PIN definition.

    Dave · July 13, 2019 at 11:26 pm

    I’m glad to hear my code helped you out!

    The GROUND_PIN definition is a leftover from the code that I used as a basis for my modifications. If for whatever reason you can’t connect the LED strip to one of the Arduino’s ground pins, you can set that definition and ground the strip through one of the digital I/O pins of your choice. I doubt anyone uses it, and it will probably be removed if I ever rewrite the code.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Would you like to know more?