1

I've created a 600 LED wall using WS2811 addressable LED strips wired in series, but I have found it quite difficult to find a tutorial or article on how to get it to project video (or any animation for that matter). I've found a few that demonstrate how to use the Pi with a standard matrix board (i.e. ribbon cable), but in my case I am looking to send data through the data wire on my LED strip.

My question is, is this possible and if so, do I need to use another controller or device with the Pi? FYI, I have been using an Arduino Mega so far.

Thanks

  • My gosh, 600 WS2811s?!?!?! How do you distribute power?!?!?!? And, that is a lot of LEDs, so that's a lot of data. I've heard that the Pi is not good at interfacing with these types of led strips, because the timing requirement is very very tight – Unsigned_Arduino Aug 13 '20 at 3:12
  • Haha well it sounds like a lot more than it is really; just 4 WS2811 strips (5m, 150 LEDSs each) connected in series on a panel. I injected power at the end of each strip with a 12v 60W adapter, with all grounds going back to the Arduino Mega. All the fastled sketches work, but no matrix ones. Is it not possible to integrate the Pi and Arduino so that the Arduino can translate to the data channel on the LED strip? – lakerice Aug 13 '20 at 7:14
  • That's definitely possible, having the Pi ping data to the Mega, which is doing the heavy lifting. – Unsigned_Arduino Aug 13 '20 at 14:23
  • 1
    Retro gaming is good! You can skip the Arduino, but 600 WS2811s might be too much data for the Pi to send, because the Pi also has to manage a Linux OS too. But if you do, I'm thinking of like using ffmpeg to resize and split a gif or video into a bunch of pictures. Then in Python, open a picture, and iterate through each pixel and get the RGB value and set the corresponding pixel to the colors. Delay a tiny bit and repeat – Unsigned_Arduino Aug 14 '20 at 16:15
  • 1
    the user would insert the video file name as a variable I mean you would turn the video file into a bunch of pictures so one picture is one frame, then you would open a frame, loop through each row and column, and send the appropriate commands to the Mega to light which pixel up at which color. So yeah, something like that. – Unsigned_Arduino Aug 15 '20 at 20:55
1

From what I read WS2811 LED Strips aren't individually addressable. A group of 3 LEDs are treated as a pixel so I'm not sure how you would go forward with that.

For getting a video on the LEDs you'd could use multiple strings of 1s and 0s with each string representing the states of all the LEDs at a given point in time. There are two ways you can do this. If you think you will be changing the video often, you should use the first method. If your use case is to display a simple drawing, message, or animation which you can easily make, you should use the second method.

Creating a python script to convert a video to a bunch of 0s and 1s:

  • Convert an mp4 file with something like FFmpeg to individual images.
  • For every image delete the next n images using something like os to reduce the fps so that the data won't exceed the mega's memory.
  • If you're planning on using short videos with fewer frames per second like 10s and 3fps use an online tool like this and skip the next 2 steps.
  • Assuming you're using a 33 x 18 grid of LEDs, compress the images to 33 by 18 pixels with something like PIL.
  • Convert the multiple images (594 pixels) to strings of 594 1s or 0s. You can use PIL to help you get the RGB values of individual pixels. Darker colours (the value of any of the r, g, and b values > 256/2) are assigned a value of 1 while the lighter pixels have a value of 0.

Using Gimp or similar software:

  • Create a new image with a 33 x 18 resolution.
  • Go to the pencil tool and change the Size to 1, the Hardness and Force to 100, and the Colour to black.
  • Create your first image with the pencil. Once you're done, make a new layer and create the next frame.
  • Once you've finished with all the frames, you can export each layer as an image which you can convert to 0s and 1s using this or something similar.

      An Example:

      Original Image (32 x 32):
      Original Image

      Output:
Output from website

Once you've got those strings from using either of those methods, you can either copy and paste them into your program for the Mega or, If you're using a Pi, add a script in the Pi that sends these strings to the Mega. In the loop function of the Mega, you'd have a for loop that iterates through the different strings. The loop would tell the strips which LEDs to turn on and wait for a small amount of time before switching to the next frame.

Note: By strings I mean a bunch of 0s and 1s. If you have a 16 x 9 grid of LEDs, then you would have strings of 144 0s and 1s that would represent the values of the LEDs at a given frame.

  • Awesome and resourceful solution! I do use GIMP, but as it would be video (should I choose to use a Pi instead of my T1000 controller), the first method would probably work better for me. So if I understand correctly with the first method, it would essentially run video as images (frames) that are deleted as they are passed on to the Mega in order to save memory? And the PIL would be converting the images to binary in real time? Forgive me if I make absolutely no sense; I'm not much of a coder :) – lakerice Aug 15 '20 at 0:33
  • 1
    @lakerice I don't think the Python script would be fast enough to convert the video and send the data in real-time. I meant you would input a video to a Python script, and then it would take a few second to convert the whole video to the binary strings. You would then pick whatever controller you'd like to display the strings. I'm not that good with hardware, so I'm not sure how the T1000 controller works. – aklingam Aug 15 '20 at 6:16
  • @lakerice Once you found the right hardware, it's probably a matter of looping through the strings and changing the value of the individual LEDs based on the bits. If you do decide to use a Pi, you can run the python script on your Pi and add the whole controlling the LED part after the conversion. Hope this helps :) – aklingam Aug 15 '20 at 6:16
  • @lakerice My solution is mainly about how you would convert/create a video into something that is easy to write code for displaying it. I do not know enough about the hardware to give you advice on what you should use. – aklingam Aug 15 '20 at 6:25
  • sorry for the late response! OK that clarifies it. Definitely makes sense now :) – lakerice Aug 17 '20 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.