Log in

View Full Version : Team 5687 The Outliers 2016 LED Controller Design


BenBernard
03-01-2017, 15:29
As an off-season project, our team designed and built a general-purpose LED controller. Connected to the roboRio (or in our case the navX) this allows us to control an RGB LED string, our ring-lights, and our targeting flashlight (sorry, "photon canon") via 5 PWM ports.

The parts are all available from Adafruit (https://www.adafruit.com/):
5 N-channel power MOSFET (https://www.adafruit.com/products/355)
1 5v voltage regulator (https://www.adafruit.com/products/2164)
1 Perma-proto quarter-size breadboard (https://www.adafruit.com/products/589)
2 4-pin terminal blocks (https://www.adafruit.com/products/2137)
1 2-pin terminal block (https://www.adafruit.com/products/2138)
1 5-pin terminal block (https://www.adafruit.com/products/2139)

The wiring diagram follows:
https://raw.githubusercontent.com/frc5687/miscfiles/master/LED%20Controller.JPG

Finally, the terminal connections (other than 12v power) are:

Flashlight ground
Flashlight power
Ringlight ground
Ringlight power
-
RGB Strip common (power)
RGB Strip blue
RGB Strip red
RGB Strip green
-
PWM signal for flashlight
PWM signal for ringlight
PWM signal for RGB blue channel
PWM signal for RGB red channel
PWM signal for RGB green channel


We used this to drive a 5v LED flashlight and a 12v LED ringlight (https://www.superbrightleds.com/moreinfo/led-headlight-accent-lights/led-halo-angel-eye-headlight-accent-lights/49/#/attributes/15) and two 12v LED RGB strips (https://www.superbrightleds.com/moreinfo/rgb-bars-and-strips/led-strip-lights-with-rgb-leds-led-tape-light-with-18-smds-per-ft-and-lc4-connector-3-chip-rgb-smd-led-5050/1470/) from SuperBrightLeds (https://www.superbrightleds.com/).

Full Java code to interface with this controller is available in our LEDController (https://github.com/frc5687/2016-Outlier2/blob/master/src/main/java/org/usfirst/frc/team5687/robot/utils/LEDController.java) class, but ultimately each LED is driven by a single PWM channel, so you can easily control this with any language.

We further combined 3 LEDControllers into our LEDStrip (https://github.com/frc5687/2016-Outlier2/blob/master/src/main/java/org/usfirst/frc/team5687/robot/subsystems/LEDStrip.java) class to allow controlling the net color output of the strip more easily.

For the ringlight and flashlight, we used LEDSwitch (https://github.com/frc5687/2016-Outlier2/blob/master/src/main/java/org/usfirst/frc/team5687/robot/utils/LEDSwitch.java) to provide simple on/off control.

We hope other teams find this useful!