0
\$\begingroup\$

I recently found and old amplifier with the speaker taken out of it and thought it would look nice as a light feature. The switches and potentiometers are still in place but have removed the power supply.

After finding this project from MAKE Magazine (http://makezine.com/projects/android-arduino-led-strip-lights) I was wondering instead of using an android device to control the LED strip, if I could possibly re-purpose the pots already on the amp box to control the LED's. Possibly one pot for each channel such as R G B.

Is there a way to do this? And if so, what would the code be?

Any help or tips are appreciated :)

\$\endgroup\$
1
  • \$\begingroup\$ Googling "5050 pot arduino" gives hundreds of examples. In fact, if you are going with pots per channel, you don't need the arduino at all... \$\endgroup\$
    – Passerby
    Commented Oct 26, 2014 at 23:32

1 Answer 1

2
\$\begingroup\$

This is doable and quite a simple task, very well suited for a beginner. You should work out the details and write the code yourself, or you won't learn anything.

Adafruit has a good tutorial on how to do the "dimming" of the individual colors. Use an n-channel MOSFET instead of a BJT. The used technique is called PWM. The Arduino software does the hard work for you, all you have to do is call the AnalogWrite function from your code. The Adafruit page has some sample code too.

Then you need to "read" the values of the potentiometers. You can use the analog pins of the Arduino and the AnalogRead function for that. Again, Adafruit has a nice tutorial, that shows how to hook it up.

Now you just have to figure out how to combine this into one script. It isn't very hard if you understand the individual parts.

You'll shortly find out that controlling R, G and B individually isn't very interesting. In general the resulting color will be hard to predict (for a human) and good looking transitions difficult to make. I suggest you treat the potentiometers as HSV input (a different color representation than RGB), it is much more natural in many aspects. Converting from HSV to RGB is a matter of a few calculation steps, but you'll find plenty of implementations on the internet (e.g. this).

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.