Go Down

Topic: Program for controlling LED strips with RGB and HSV values (Read 290 times) previous topic - next topic


I was feeling dissatisfied/lost after looking around for a program to control my LED strips and transition through all the colors on the HSV wheel, so I decided to write a small program (posted here on GitHub) for controlling LED strips (I got cheap 5V ones off of Amazon--not the individually-addressable kind) using RGB and HSV values.

The GitHub readme goes more in-depth on the usage/values and includes a wiring diagram. Since my LED strips are only 5V and 1 meter long, I'm able to power them using a USB 3.1 port on my computer (make sure not to draw too much current from your own USB port as Grumpy_Mike mentioned), though you may need an external power supply for higher-voltage LED strips. Figured I'd post it here in case anyone else is interested; feel free to use (at your own risk), modify, and share as you please.

EDIT: Updated with USB current info


Since my LED strips are only 5V, I'm able to power them using a USB on my computer
No this depends on the length of the strip because the current the strip takes is dependent on how many LEDs there on it. You make no mention of the strip length nor how many LED that corresponds to. It will also depend on the current limiting resistor in each LED of the strip.

USB can supply at the most 500mA and often much less. There is a danger of damaging your Arduino or your computer's USB socket if you push the current you draw from it. Please update your page to include this information.



Nice work!   Are you thinking of making an Arduino Library and including a Sample App showing how to use the library? 

If you go that route, I suggest adding these functions to a library: 

a. Convert Hue, Saturation, Value (HSV) values to RGB values
b. Convert RGB values to HSV values
c. Gamma correction with changes in brightness values for human eye perception.
d. Store/retrieve RGB values and colors to/from EEPROM.

And Sample App with both Value (brightness) and Hue fade functions.


Go Up