Connecting the WS2812 LEDs to power source in the Robot

,

Hey there.
I saw WPI released full support to the ARGB WS2812 LEDs.
In their docs, they are saying that the Addressable LEDs should be connected to the PWM for data transfer.
I was wondering where the LEDs are getting their power from.
THX :smile:

I’d recommend you put a COTS voltage regulator on a PDP slot, following CUSTOM CIRCUIT rules.

You can use a second VRM connected to a PDP slot, but official VRMs are expensive.

Don’t use the first VRM (that your radio is connected to). Only connect the radio to that VRM.

Why is that? Is there a problem with it?

From my knowledge, the 6V from the PWM headers will power WS2812 LEDs fine.

I’m guessing that the assumption is that you’d try to run off the 12V 2A terminals on the VRM–and run right into R47 and the LRIs. If you connect elsewhere you’re 90% OK, unless there’s an interference that I’m not aware of.

I was actually thinking the 5V .5/2A rails. The WS2812 LEDs are marked as 4-6V by Adafruit, and while this may vary between manufacturers, I don’t think there are any WS2812 LEDs out there that require 12V.

To my knowledge, you’d probably fry them if you’d connect them to the 12V rails.

Hello,
This is an excellent thread.
WS2812s come in two varieties: 5 Volt and12Volt. Do you think not using a voltage regulator on the 12 volt would be problematic?

Also, be aware that if you are not careful, LEDs can use a lot of power.

1 Like

I always recommend teams only use their VRM to power the radio, and put any other devices on a separate buck-boost converter. All ports on the VRM go through a single non-resetting fuse in the PDP. If you should have a short or over-current in another device on the VRM it can blow that fuse and you’ll be dead for the rest of the match. That’s far too high a risk in my book. You can get voltage converters for reasonably cheap (I’ve been recommending something like this one), and they can handle much more current than the VRM at a wide range of voltages.

2 Likes

If you still have some old pre 2014 robot parts the 12V to 5V converter that used to come in the KOP for the radio power works well.

image

One the red and black set of wires is the 12V in that needs to plug into the PDP. They black and yellow are a 5V out that can go into the LED’s. Then you will need to hook up the signal line of the LED to at PWM port in the Rio.

If you do not have the old KOP voltage converter something similar can be purchased on amazon

Technically, the 12v LEDs are not WS2812, they are WS2811.

2 Likes

Gotcha, I just didn’t get the reasoning behind this. Thanks for the explanation!

Another question - if the PWM headers on the RIO can supply 6V, why not use them directly?

Very low current - the PWM header supplies a max of 15.0mA, where LED strips need a few A per meter at full brightness (3A per m of LED strip in this case: http://www.revrobotics.com/rev-11-1198/)

1 Like

Use a separate regulator i.e. one not in your RoboRio. If you use a regulator in the RoboRio and there is a fault, you might cause the RoboRio to stop working. If the fault damages a regulator, it is easier to repair/replace if it is not in the RoboRio.

It’s a separation of duties thing.

Don’t let an LED over-current event take down your ability to communicate with the robot.

To the folks who say it’s fine: You are correct - until it isn’t :slight_smile: .

1 Like

The 15mA number refers to the max current on the signal line, not the 6V power rail. The PWM 6V rail supplies up to 2.2A, since they’re designed to drive servos. Some LED strips work with 6V, others require 5V. YMMV.

1 Like

After some research I did on this Led model, I found that they don’t have a PWM connection.
Anyone tried to connect this specific LEDs to the roborio and enable them through wpi’s software?

Even though the port on the Rio is labeled “PWM”, the Rio can generate other types of signals than servo-style PWM on those ports. In particular, a feature added in 2020 is for the Rio to generate the signaling protocol used by the WS2812 type of addressable LEDs, so you can connect that type of strip directly to the Rio.

We got this working on the weekend and are excited to try it. We’ve been doing LED “bling” on our robots for the last few years thusly:

  • WS2812 LED strips, powered by an separate voltage regulator and filtering capacitor.
  • In our first years, the signal line was driven by an Arduino board and the RoboRio talked to the Arduino via a serial port signalling protocol
  • In our second year we moved to a RioDuino, but same thing
  • In our next few years we moved the control over to a Raspberry Pi with a custom HAT that drives the LED signalling; the Raspberry Pi ran a networktables client to communicate with the RoboRio.
  • this year we’ll try running the signalling straight from the RoboRio.

We took the example code from wpilib and were up and running within 10 minutes.

That is what I am using it is rated 25W 5V output.

I am using the cheapest ws2812b strip I found on Amazon.

For shown lights I used the example code rainbow() from docs.

I’ve borrowed code from 178 to start a subsystem for LEDs for us.

edit: Similarly, setting it up was very fast. Also, reminder that you only have 1 LED driver to work with so will have to put the LEDs in series and segment out the different patterns in code.

1 Like

We seem to have an issue getting this to work at all. My question In the above configuration do you just have the PWM signal pin connected to the signal pin on the LED strip. And the LED +5VDC and common from a separate power source. This is what we have been trying and no luck. No leds light. We take the same setup and run the LED signal wire to our Ardrino and it lights up. So we are using the example code and I’m just trying to verify if I have an electrical issue.