Home Addressable LED Control on the V5
Post
Cancel

Addressable LED Control on the V5

V5 Addrled

VEXos 1.1.2 introduced a new ability to control WS2812B addressable LED strips directly from the ADI on the V5. Previously this was semi-possible by bit-banging with APA102C strips, but the speed at which the V5 could send data to the lights was far too slow to be workable in any real application. User code, that being the code that runs on CPU1, is limited to updating the state of the ADI every 10ms. The protocols to drive lights require much faster timings than that to work properly, so until firmware was added to drive this directly from CPU0, controlling addressable lights wasn’t feasible.

I’ve had many people ask me how I made my lights work, and I thought that the short explanation that I put in the Sylib docs was sufficient, but apparently not.

Hardware

No off-the-shelf lights that I have found are directly compatible with the V5. They all require some soldering and custom wiring. These are the lights that I have personally used, and found that they work fine.

KXZM DC 5V WS2812B Individually Addressable RGB LED Strip Light 144Pixels 3.3ft Waterproof IP67

It should be noted that these are the 144 LED/3.2ft version, which I have used myself. Some other people have reported getting the less-dense kind, and them not working properly. I think this has something to do with a 5v/3.3v logic mismatch, but I’m not sure and I also don’t really care enough to try fixing it.

In order to get these working with the V5, one needs to solder pads on the lights (make sure to pay attention to arrow direction) to wires, and then route these wires to a 3-pin connector that plugs into the V5.

Even though there are 144 LEDs per strip, the max that the V5 can work with is 64 per strip, so they need to be cut. You can use multiple strips worth of lights, with some limitations as explained below in the software section.

Software

In order to program these lights, either Sylib, vanilla PROS, or VEXcode can be used. Personally, I recommend Sylib as it has the most versatile range of control options, including color cycles, pulses, and so on, but any can be used. PROS and VEXcode only allow for manually setting each pixel on the strip.

Documentation for Sylib addrled control can be found here.

As previously mentioned, the maximum strip length is 64 pixels. Multiple strips can be plugged in, but the V5 will start to limit current at 2 amps. When it does this, the lights will blink on and off, because they are repeatedly going under and over the 2A cutoff.

In order to combat this, ADI expanders can be used. The limit is 2A per set of 8 ADI ports. In addition, in the event that something becomes damaged due to faulty wiring, it is better to fry an ADI expander than the built-in ADI.

TL;DR

  • Use the dense 144 LED/3.2ft WS2812B strips
  • Wire them correctly pls
  • 2A current limit per set of ADI ports
  • Max strip length 64
  • Programmable using Sylib, PROS, or VEXcode

If anyone has any questions regarding these lights, they can email me at [email protected], or tag me at Sylvie#5090 in the VEX Robotics Competition discord server. I don’t accept DMs, so please ping me in a public channel.

This post is licensed under CC BY 4.0 by the author.
Contents