Unable to wire LED Strips

Our team has been trying to wire and program LED strips (BTF-Lightning WS2812B) for our competition bot. We successfully were able to get the LEDS working and were able to change the colors and create patterns. Then one of our team members had raised up the strip and while they did that it broke. All of the lights turned off except one blue and one red one. We were setting it to green and purple at the time. After it broke we measured the voltage at the end and between the positive and ground pads. There was about 3.8 volts when it is a 5volt LED strip. It also had continuity from the end of the signal strip to the port in the PWM. We are powering through the VRM. We had tried another strip from the same wires in case we broke the first one but it wouldn’t even turn on. At one point we were trying to set it to white and some lights at the end opposite the wires turned on but then when we redployed code they turned off and we couldn’t get them back on.


In the image the 5 volt is connected to the red port on the 5v/2A on the VRM the signal is connected to the S on the PWM and the ground is connected to the black on the 5V/2A on the VRM. Here is our code:

 AddressableLED m_led;
  AddressableLEDBuffer m_ledBuffer;

  @Override
  public void robotInit() {
    m_led = new AddressableLED(4);

    // Reuse buffer
    // Default to a length of 60, start empty output
    // Length is expensive to set, so only set it once, then just update data
    m_ledBuffer = new AddressableLEDBuffer(15);
    m_led.setLength(m_ledBuffer.getLength());

    // Set the data
    m_led.setData(m_ledBuffer);
    m_led.start();
    // Instantiate our RobotContainer. This will perform all our button bindings,
    // and put our
    // autonomous chooser on the dashboard.
    m_robotContainer = new RobotContainer();
  }

  /**
   * This function is called every 20 ms, no matter the mode. Use this for items
   * like diagnostics
   * that you want ran during disabled, autonomous, teleoperated and test.
   *
   * <p>
   * This runs after the mode specific periodic functions, but before LiveWindow
   * and
   * SmartDashboard integrated updating.
   */
  @Override
  public void robotPeriodic() {
    for (int i = 0; i < m_ledBuffer.getLength(); i++) {
      // Sets the specified LED to the RGB values for red
      m_ledBuffer.setRGB(i, 255, 255, 255);
    }

    m_led.setData(m_ledBuffer);
   CommandScheduler.getInstance().run();
  }
1 Like

You also need to run the signal ground to the Roborio PWM port. It looks like you only have the white line from the LEDs going to the PWM port.

3 Likes

We have successfully run LEDs without connecting the GND pin to the Rio PWM port, but it is probably a good idea to add one.

If the LED strip failed when it was being moved, I would inspect the soldered connections carefully to see if anything disconnected or shorted out. It is also possible that the strip has been damaged, so you might try replacing it with a new segment to see if the behavior changes.

The ground and 5 volts are running to the VRM and we had also tried it with the ground and 5V at the PWM

We tried a new one and it also would not work

Can you do two grounds? One for power and ground at the VRM and signal and ground at the RoboRio?

Unrelated to your problem, but I note that your radio is powered from the 12V 500mA channel on the VRM. R616A requires that you use the 12V 2A channel.

6 Likes

We got it working we made a third strip and this one worked. We think the first two may have just been poor soldering jobs.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.