Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Ambilight help

  1. #1
    Junior Member
    Join Date
    Oct 2018
    Posts
    4

    Ambilight help

    Hi all,

    I know there are plenty of threads talking about ambilight and Teensy+Octo2811 but there's not a single thread which I can find that explains everything in detail at least for first comers in the world of Teensy.
    The attached picture is a 422 LEDs. It failed to work with ESP8266, as expected, but all the LEDs and the connections are working properly. The total amount of LEDs is 422 (75x136).
    Mostly my questions are regarding the wiring of these LEDs to the Octo2811.

    Click image for larger version. 

Name:	20181006_215109.jpg 
Views:	12 
Size:	168.4 KB 
ID:	14903

    From what I read I have to separate them to 4 different groups. Again, from what I read these groups should be the same amount of LEDs each. That's the first problem since I can't separate them equally but I can easily add/remove some LEDs so the count is correct. So that's ok.
    Since the start of my LEDs is at the bottom left corner how should I connect the cables from the main LAN cable?
    Should I cut my LED strip to create those 4 groups or I can keep it as is now and just solder the cables on it?

    I appreciate your help in advance!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,649
    Ideally you would connect the LEDs as 8 equal length groups. But that sort of ideal connection is only needed if you use several thousand LEDs.

    Using less than all 8 outputs is perfectly fine. The only requirement (without some creative hacks to the code) is that all but the last output must be equal length. The last output can be any shorter length, and the remaining outputs beyond the last can be left unused.

    So for 422 LEDs, you could put 200 on each of the first 2 outputs, and then put the remaining 22 on the last output. Or 300 on the first output and 122 on the 2nd. You could even put all 422 on the first output and not use the other 7 signals at all.

    The only line you need to edit in the Adalight example is this:

    Code:
    const int ledsPerStrip = 60;
    If you leave it set to 60, this means when your PC sends the LED data, positions 0 to 59 go to the first signal, then 60 to 119 go to the 2nd signal, 120 to 179 go to the 3rd signal, and so on.

    The Adalight protocol tells Teensy how many LEDs it actually sends. So if you leave that line at 60, Teensy could receive data for up to 480 LEDs. But your PC will send only 422, which is perfectly fine. Those last 58 positions simply go unused.

    Wasteful as this many feel, setting ledsPerStrip = 422 is perfectly fine. Teensy would be able to control 3376 LEDs this way. But when your PC sends 422-size data, those first 422 will get the intended output and the other 2954 possible LED points go unused.

    Earlier I mentioned you would want a better connection for a very large number of LEDs. As you connect more LEDs per pin, the maximum refresh rate gets slower. 540 LEDs per pin is near the point where the speed becomes less than 60 Hz. So for 1500 LEDs, I would suggest breaking it into at least 3 sections with at most 540 per section.

    Of course this is only about the data signals. Very long LED strips also need power connected in multiple locations.

  3. #3
    Junior Member
    Join Date
    Oct 2018
    Posts
    4
    Awesome that's very helpful!
    Can I keep my strip as is without cut in 3 different pieces and just connect the data and the GND cables from the LAN cable?
    Also, how do I tell Teensy that the first group is group no.1, the second is group no.2 etc?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,649
    Quote Originally Posted by sofos1990 View Post
    Can I keep my strip as is without cut in 3 different pieces and just connect the data and the GND cables from the LAN cable?
    Yes, as long as the first 2 sections are the same length.

    With editing the code, you could even make them unequal lengths. You'd need to add a function that translates from the original Adalight LED numbers to the locations OctoWS2811 has them. Doable with some equations or a lookup table or other ways. But unless you're pretty good with programming, recommend leaving the code as is and make sure the first 2 pieces have the same number of LEDs.


    Also, how do I tell Teensy that the first group is group no.1, the second is group no.2 etc?
    Look at the OctoWS2811 page for the hardware connections. The signals are in order. Connect the first LED segment to the first signal.

  5. #5
    Junior Member
    Join Date
    Oct 2018
    Posts
    4
    Alright this weekend I have some time to go forward with this.
    I connected the LAN cable and my groups will be 2 groups of 144 leds and one group of 134 leds.
    I upload the adalight sketch from the examples of Octo2811 libray and I set the leds per strip to 144 but only the first group lights up.
    I didn't cut my strip where I solder the second group. I just soldered in the existing pad which connects DIN and DOUT. Could this be the issue?

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,649
    Quote Originally Posted by sofos1990 View Post
    I didn't cut my strip where I solder the second group. I just soldered in the existing pad which connects DIN and DOUT. Could this be the issue?
    Yup, that's definitely a problem.

    But it's not as terrible as directly connecting 2 logic outputs together, because the Octo board has 100 ohm resistors with its outputs. Without those resistors, there's a pretty strong risk of this damaging your hardware.

  7. #7
    Junior Member
    Join Date
    Oct 2018
    Posts
    4
    Ok, it seems perfect now. I cut the strip and solder the LAN cable and I solder the ground point with the rest of the strip and it works fine.
    Hmmm, now I need Ambibox with up to 500 leds support. The version I have only supports 400 leds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •