Our team is looking for new LEDs to buy and we would love to hear your advice about LEDs and LED accessories and hear your LED setup.
We are not looking to buy things like CANdle and Blinkin.
I think any WS2812 LEDs with their data pin connected via roborio PWM works. As long as you supply the proper voltage/current from your robot.
That being said⌠I donât have a specific strip to say âthis oneâ but start with something cheap to prototype with and go from there.
While I canât offer a comparison between products as weâve only used the Candle for onboard LEDâs; I can say that we enjoyed using the Candle last year on our robot, and plan to use it again this coming season.
It was simple to use and setup, and appears to have a high âceilingâ so to speak with what we can do with it (various animations and can drive a large number of LEDâs)
One option is you can use is an Arduino or similar Microcontroller as your LED controller. FastLED and the NeoPixel libraries give you really great control over LEDs, animations and have easier functions to handle stuff that the default libraries donât. Then you need to connect the RoboRio to the Arduino to trigger those animations. We used digital lines and binary math (3 digital I/O lines gives us 8 possible combinations). You could also do serial or some other method, but the digital lines was simple and good enough for our use case.
In 2022 we had animations for arm down (limit switch activated), arm up (limit switch), which alliance color we were (taken from Drive station via code) and I think thatâs it. So 2 color versions of each arm position animation was our 8 patterns.
We used generic WS2812B lights and had good success.
The Rev Blinkin worked great for us last year. You just command it like a pwm motor and it interprets that signal to be one of many presets.
Last year since we didnât need a huge strip of LEDs and were not using anything else on the roboRIO 6V rail, we simply powered the LED strip directly from the roboRIO PWM port. The 6V rail can supply up to 2.2 Amps, which is plenty for a small strip. Since we didnât have anything else controlled by PWM, there wasnât a worry of taking anything else out if we drew too much power. And not needing an external voltage regulator made the wiring that much easier. This did give 6V to the nominally 5V LED strip, but it seemed to handle it without issue. YMMV of course.
We have used these strips (also available in a 5-meter strip). Cut them to length, wire power through a regulator, and run the data pin to a PWM port on the Rio.
Seriously, this is no more complicated than wiring up and programming any external LED controller.
Over the years, weâve added LEDs in several different ways. Here are some thoughts on what weâve learned and how we install them today.
LED Strips
As others have said, any generic WS2812B or C strips will work fine. They are all over Amazon or even cheaper from Ali if youâre not in a hurry. These strips are 5v and can be cut to length as needed.
Wiring
You will need to provide the LEDs with 5v power. There are a number of ways to do this, the easiest being directly powered from the RIO. If you want lots of LEDs, youâll need to power them from a higher amp source. Likely using a buck converter to drop down a 12v line to 5v.
One thing I donât see talked about much is that once you cut these strips, they can be a bit tricky to solder new wires to. You can certainly do it but the joints tend to be weak and break easily. Consider some strip connectors to simplify your life.
Installing on your robot
Installing the LED strips on your robot should be planned out ahead of time unless you just want a few small strips. Youâll want a clean, flat surface to attach them to. Do not trust the adhesive backing that comes with the strips unless they are protected somehow. The adhesive does not hold up to a season of working on a robot.
This year, we used difussing channels to mount the LEDs for the first time, and we liked them. They kept the LEDs protected and were easy to install with some rivets. They also fit nicely on a 1" tube face.
Keep them isolated
This is important. If you take one thing from this post, make it this: take care when mounting LED strips right to your robot frame/structure. I would guess that bad LED mounting is responsible for most short-to-frame failures during inspection. Itâs very easy for these strips to crack and allow a short to pass into the robot frame when stuck directly to the aluminum.
Controlling the LEDs
You have many options here; weâve used most of them over the years. The Blinkin and CANdle are easy enough to use but seem to be redundant at this point. With LED control in WPILib, now itâs just easier to wire these directly into the RIO and not have to deal with another little box on your robot, particularly if you donât exceed the amperage on the RIO line.
I would avoid any solution that includes adding another processing board to the robot. While Arduino and the like offer lots of flexibility, they are projects that are likely not worth the effort nowadays. If youâre looking for a project, though, Arduino-controlled LEDs are a lot of fun to play with.
What we do
I donât see us ever going back to one of the other devices to run LEDs. Itâs just way to easy to add a PWM plug to the end of an LED strip and plug directly to the RIO. There is great example code and instructions from WPI linked above making this very easy. With this option, you can add fully controlled RGB LEDs to your robot for $20.
Thanks for the detailed response, you helped a lot!
Do you think itâs worth buying the CANdle for the simplicity in the code and the easier electronics? Or is it just something that can be looked over?
Unfortunately, I canât speak to the software, only the hardware. For hardware, you can just splice a PWM connector on an LED strip and plug it into the RIO. Not much simpler than that. Looking over the sample code, it seems pretty simple to copy/paste from WPI. Now, there might be some better functionality built into the CANdle that Iâm unaware of.
Even if you have a lot of the aforementioned addressable LEDs and canât power them off of the RIO directly, itâs still simpler to wire them to the roboRIO and power them from elsewhere, rather than using a separate control device. A second VRM (not the one powering your radio; a different one) is a good option. Why that instead of something else? Because many FRC teams have one sitting around, either from an old robot or because they switched to the REV RPM. If youâre an even older team (i.e., 2014 or earlier), you might even have one of the old built-into-an-aluminum-heatsink voltage converters, which would also work for this.
The code to actually control the LEDs is easy to copy-paste from WPILib. Creating the patterns and managing the logic to set the right pattern is not something WPILib provides directly. Here is our code to do that for 2023. It uses Java functions-as-data to store a prioritized set of light states, represented as functions that set the LEDs to a particular pattern. Other parts of the code request states to be shown every loop, and the lights code displays the highest-priority of the states that have been requested since the previous loop.
We would want to have a couple of strips, and I think itâs more recommend to use a buck voltage regulator, which isnât that hard, but I think it could be easier to just use a CANdle. Iâm probably wrong since I donât have a lot of electronics experience, but I believe this is what I heard.
As for software, I know the CANdle has cool built in animations, that are pretty easy to use. To create animations regularly I believe you need to do things with timestamps with a whole lot of logic. Using a CANdle seems easier
I think youâre okay running between 20 and 40 LEDs directly from the RIO nowadays. I agree itâs better practice to run them off a separate supply, but that does complicate the setup a bit. Not that itâs that hard, but itâs not as easy as adding a PWM connector directly to the wires that shipped with the strip.
I agree with you; I have clarified the wording in my post.
If you get into multiple strips and want to chain things together, I agree the CANdle is a solid choice. It takes a direct 12v feed, which simplifies wiring. It supports 5v and 12v strips and has a bunch of stock animations. The Blinkin also provides similar functionality if your team is more in the REV ecosystem. I would go with whichever vendor your programming team is more comfortable with.
We would rather use ctre
Are there any down sides to CANdle?
Just cost and adding a small device to the robot. If your team is comfortable with CTRE stuff and has the money to buy them, go for it! To me, adding LEDs to your robot is one of the best bang-for-the-buck things you can do to excite and inspire students. It can take an average robot and make it look great! Always remember that the best solution is the one you get working on your robot. All these devices and options will work just fine. Pick one and run with it.
How clear were the colors and patterns behind the diffuser? I amAndyMark interested in these but if it provides any significant friction to drivers getting clear signal from the LEDs we would go without?