View Full Version : RGB LED Lights
Hey CD! Our team bought these RGB LED Light Strips from AndyMark (http://www.andymark.com/product-p/am-3543.htm). Has anyone worked with something like a Raspberry Pi or Arduino to control them? I'm guessing the GPIO Pins on the rPi would work somehow? We might have to convert the 12V LEDs to 5V or something?
Also, is it possible to use the RoboRio to display the Alliance Color if we used these on the robot? I've heard that using a co-processor like a rPi or Arduino is illegal. If this isn't possible, how do teams use LEDs on their robot?
We were possibly thinking of somehow using our DriverStation to provide 5V Power on our control board. Would this be possible if we used a 5V -> 12V converter? On the board is where we probably would use a Raspberry Pi or Arduino.
Thank you!!
I've heard that using a co-processor like a rPi or Arduino is illegal. If this isn't possible, how do teams use LEDs on their robot?
Who told you that? Please tell them to read the manual.
Use of these is fully legal, as long as you don't plug them into motor controllers. For these LEDs, I would recommend using a relay with an Arduino to turn them on and off. Since they're by channel instead of individually addressable, you'll turn on a channel by turning one of the relays on.
As for getting the alliance color, WPILib provides a DriverStation API (http://http://wpilib.screenstepslive.com/s/4485/m/13810/l/241880-driver-station-input-overview) that can tell you what alliance you're currently on. You can then pass this on through I2C, serial, or SPI to the Arduino.
My bad... Yup in section 4.10, R56, it is legal There are no rules that prohibit co-processors, provided commands originate from the roboRIO to configure, enable, and specify all operating points for all power regulating devices. This includes motor controllers legally wired to the CAN-bus.
So do most people use an Arduino? What kind, and does anyone have code to do this?
On the robot, can we use the 12V from the battery?
We've used FastLED (http://fastled.io) in the past with success. Power comes through the Arduino so your power source whatever is powering that. We powered ours by plugging it into the RoboRIO's USB although our comm was done over I2C with the built-in Wire Library (https://www.arduino.cc/en/Reference/Wire).
One thing to watch out for if you're doing comm and light updates semi-concurrently is how to wait correctly. If you need to hold a light pattern, don't use millis(). It interferes with retrieving comm data. Use elapsedMillis (http://playground.arduino.cc/Code/ElapsedMillis) instead.
Billfred
22-12-2016, 09:54
Hey CD! Our team bought these RGB LED Light Strips from AndyMark (http://www.andymark.com/product-p/am-3543.htm). Has anyone worked with something like a Raspberry Pi or Arduino to control them? I'm guessing the GPIO Pins on the rPi would work somehow? We might have to convert the 12V LEDs to 5V or something?
Also, is it possible to use the RoboRio to display the Alliance Color if we used these on the robot? I've heard that using a co-processor like a rPi or Arduino is illegal. If this isn't possible, how do teams use LEDs on their robot?
We were possibly thinking of somehow using our DriverStation to provide 5V Power on our control board. Would this be possible if we used a 5V -> 12V converter? On the board is where we probably would use a Raspberry Pi or Arduino.
Thank you!!
Hi, Billfred from AndyMark. Let's tackle a few things in no particular order:
The prohibitions on Raspberry Pi or Arduino boards is in FIRST Tech Challenge, not the FIRST Robotics Competition. We brought these LEDs to market in particular because you could just hook up 12V and go.
These LEDs aren't individually addressable--they all show the same color, based on the voltages applied.
You could try to convert 5V to 12V, but I would highly recommend using a separate battery pack for driver station lights. Any unnecessary electrical loads on the Driver Station, to me as a mentor and coach, is tempting fate.
If you just want red, green, or blue, it's just a matter of grounding that channel by wiring them straight in the PDP. Purple? Ground red and blue. White? Ground all three. For more precise mixing, you'd need a controller or a bunch of resistors. Speed controllers would work, or one of the thousands of off-the-shelf LED controllers if it met (or was made to meet) the no-wireless-communication rule.
As always, read the electrical rules and the custom circuit rules in particular next year to make sure your application is compliant.
We used a similar string of LEDs to show alliance colors in 2015, using spike relays controlled directly from the RIO. See this post (https://www.chiefdelphi.com/forums/showpost.php?p=1454840&postcount=3) for the details.
arichman1257
22-12-2016, 10:13
In 2016 we used those on our bot. We used the FastLED library on an arduino to send them the signals. But we also sent the arduino PWM signals to tell the arduino what color to display. The driver station has a way to get your alliance color and we sent that to the arduino for that purpose. But mainly we had a rainbow animation on them which is this video (https://goo.gl/B8CMnF). If you want to know more DM me and I'll put you in contact with the person who wrote the code and developed the system for it. :)
GreyingJay
22-12-2016, 11:03
On the robot, can we use the 12V from the battery?
Yes, you could pull a run directly from a PDP breaker, or wire something off the VRM (and you can add a second VRM if needed for this purpose), or you could even use a solenoid relay from the PCM assuming you're using 12 volt pneumatics and not 24 volt.
Last year on our robot our green LED ring light for autonomous vision processing was powered from the PCM, since our VRM outputs were used by other devices (we had a webcam, and a Raspberry Pi running the webcam and vision processing software, and a D-Link gigabit network switch on board since the OpenMesh radio only has two available ports). This also lets you turn it on and off in software, whereas the VRM output is always on.
As a cheap and easy way to set up LED lights (non addressable, non controllable) we were looking at IKEA DIODER light strips. We would have run these off a PCM relay output or VRM output.
BenBernard
22-12-2016, 18:31
We run our RGB strips, ringlight, and targetting flashlight off of the roborio using PWM and a mosfet circuit based on a sample from adafruit. Very clean and simple.
Here's the adafruit link: https://learn.adafruit.com/rgb-led-strips/usage
Here's the rough circuit design. The green blocks are terminals.
https://raw.githubusercontent.com/frc5687/miscfiles/master/LED%20Controller.JPG
jlindquist74
29-12-2016, 23:19
In 2015 we had common-anode LED strips on the forklift verticals, and drove them through MOSFETs connected to the RoboRIO PWM ports. (We switched to CAN bus Talon SRXes, so our PWMs were totally unused.)
We were reminded (the hard way) that the PWM ports are shut off as part of the safety interlock when the robot is disabled. The plan in 2016 was to use the Adafruit I2C PWM driver (https://www.adafruit.com/product/815) instead, assuming the I2C port isn't shut off when disabled.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.