Jump to content

Adjust RGB with sliders for RGB Led Strips

TheNuzziNuzz

If you want to control the LEDs from your computer, I have almost finished coding an app to do just that with and arduino. It will just take me a couple of days to finish it.

Quote or tag if you want me to answer! PM me if you are in a real hurry!

Why do Java developers wear glasses? Because they can't C#!

 

My Machines:

The Gaming Rig:

Spoiler

-Processor: i5 6600k @4.6GHz

-Graphics: GTX1060 6GB G1 Gaming

-RAM: 2x8GB HyperX DDR4 2133MHz

-Motherboard: Asus Z170-A

-Cooler: Corsair H100i

-PSU: EVGA 650W 80+bronze

-AOC 1080p ultrawide

My good old laptop:

Spoiler

Lenovo T430

-Processor: i7 3520M

-4GB DDR3 1600MHz

-Graphics: intel iGPU :(

-Not even 1080p

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, dany_boy said:

If you want to control the LEDs from your computer, I have almost finished coding an app to do just that with and arduino. It will just take me a couple of days to finish it.

 

Awesome, I would love to see it.

Computers r fun

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, TheNuzziNuzz said:

Not everyone has a 3d printer in their closet, so that makes it more difficult, but I will make an enclosure from like wood or something.

 

I have no idea where to begin with replacing the nobs with sliders.

 

I meant to ask "How do I go about replacing the nobs with sliders?"

Computers r fun

Link to comment
Share on other sites

Link to post
Share on other sites

OP: From what you've said in this thread. I'm going to offer you the best advice you're going to get here.

 

You're in over your head. Buy the correct power supply and the correct LED "controller." You'll never make it work otherwise. 

 

There are many ways to do what you want to do, but considering you don't understand how to replace the simple potentiometer on the board posted above, they're all far above what you know about electronics. 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, corrado33 said:

OP: From what you've said in this thread. I'm going to offer you the best advice you're going to get here.

 

You're in over your head. Buy the correct power supply and the correct LED "controller." You'll never make it work otherwise. 

 

There are many ways to do what you want to do, but considering you don't understand how to replace the simple potentiometer on the board posted above, they're all far above what you know about electronics. 

 
 

So, the reason I created this thread is for help on doing this. The question I am asking is how to do this. So, your telling me that its not worth answering the question I'm asking so I should just buy one? That's not the point. I already have a premade controller, and my leds are functional. I wan't to expand my knowledge, and that the reason for this thread. So...

 

 

I can solder, and I do have an understanding of electricty, just not the best understanding of the components.

 

So, please correct me:

 

I believe what I will have to do is de-solder the included potentiometers, and re-sodder 3 new ones. If that's it, I can do that. I'm also guessing the potentiometers I will need will need to be 12v DC, 3 amps each to match the original ones.

 

Thank you for helping me, I will figure this out, and I will get this done, with or without your help. (But it will make it SOO much easier tho)

 

 

Computers r fun

Link to comment
Share on other sites

Link to post
Share on other sites

You have to split the problem in separate parts.

 

You basically have three potentiometers, each slider is a potentiometer.  One end of the potentiometer is connected to ground, the other end of the potentiometer to 5v (or whatever voltage you use to power your microcontroller, but I'll go with 5v from here on) and the wiper goes to one of your analogue inputs on the microcontroller.

You basically for a voltage divider with your potentiometer ... depending on where the slider is set, your microcontroller will see a voltage between 0v and 5v and convert on the pin. 

You configure the ADC (analogue to digital converter on that pin) and set the adc to use the power supply input (5v) as voltage reference, and then you run the ADC to convert the voltage on your input pin to a number, which is between 0 to 255 for a 8bit ADC or between 0 and 1023 for a 10bit ADC... 

So basically in your microcontroller you'll have a loop and every second or so, you'll measure the voltage on three input pins, one after another, and you have your color percentages.

It's up to you how you're going to use those numbers .. you could say with a 10bit ADC reading, anything below 100 is OFF, anything above 900 is full on, and then you have 800 numbers between 100 and 900, so you get your percentage by diving by 8. ... ex if your ADC reading is 753, then your percentage is (753-100) / 8 = 81.65% = 82%

 

Once you have the three percentages, it's time to adjust the brightness on each color in your led strip.

How you do that, depends on how the led strip is used.

 

If the led strip uses individually controllable leds, like those strips with 5050 leds, you basically just send a command to each led in the strip and set the brightness percentage for each of the three colors and the chips inside those 5050 leds will do the work of adjusting brightness (or maybe a better word would be intensity) of each color for you.

 

If your strip is basically made up of basic three color leds, for example on of those that's made of segments you can detach if you want to, which has with sets of 3 leds in series with a resistor and running from 12v or some higher voltage, you'll basically have to do PWM (turn on and off so fast your eyes don't detect the interruption) ... for each color in your led strip, you'll have an output pin on your microcontroller that's connected to a npn transistor or mosfet and this is between the power supply of the led strip and the led strip itself.

 

Depending on your percentage of brightness, you keep the led strip turned on for longer periods of time.. ex for 50% brightness, you may want to keep the color on the strip turned on for 10ms, then turn off the color for 10 ms, and repeat the process forever - your eyes are not fast enough to detect the leds turning off, they'll just see dimmer leds.

 

The last option is to actually use proper led drivers for each color in the strip. There are led driver ICs which you can talk to and set the brightness percentage and they'll do everything for you inside them.

 

More importantly... if you want to work with leds, you have to understand how leds work, how to turn on ONE or how to turn on SEVERAL leds, how to not blow them up, how to control the brightness of each one (most important thing you need to understand is that they're current driven devices, not voltage driven like incandescent bulbs)

 

You'll have to settle on some sliders, settle on the microcontroller you're going to use, settle on how you're going to make the led strips (if you make it, if you buy one from stores etc) , the type of led strip decides how you approach the project.

Link to comment
Share on other sites

Link to post
Share on other sites

14 hours ago, TheNuzziNuzz said:

YES thats exactly what im looking for. I wish they were sliders, but thats the idea.

It would be possible to replace it with sliders of the same resistance as the potentiometers if you really wanted to but it would be more hassle than it's worth. They do make slider type versions also if you are able to source some, here is an example:

http://www.ledstripbox.com/12-volt-dc-slide-dimmer-switch-3-channel-p-320.html

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, mariushm said:

You have to split the problem in separate parts.

 

You basically have three potentiometers, each slider is a potentiometer.  One end of the potentiometer is connected to ground, the other end of the potentiometer to 5v (or whatever voltage you use to power your microcontroller, but I'll go with 5v from here on) and the wiper goes to one of your analogue inputs on the microcontroller.

You basically for a voltage divider with your potentiometer ... depending on where the slider is set, your microcontroller will see a voltage between 0v and 5v and convert on the pin. 

You configure the ADC (analogue to digital converter on that pin) and set the adc to use the power supply input (5v) as voltage reference, and then you run the ADC to convert the voltage on your input pin to a number, which is between 0 to 255 for a 8bit ADC or between 0 and 1023 for a 10bit ADC... 

So basically in your microcontroller you'll have a loop and every second or so, you'll measure the voltage on three input pins, one after another, and you have your color percentages.

It's up to you how you're going to use those numbers .. you could say with a 10bit ADC reading, anything below 100 is OFF, anything above 900 is full on, and then you have 800 numbers between 100 and 900, so you get your percentage by diving by 8. ... ex if your ADC reading is 753, then your percentage is (753-100) / 8 = 81.65% = 82%

 

Once you have the three percentages, it's time to adjust the brightness on each color in your led strip.

How you do that, depends on how the led strip is used.

 

If the led strip uses individually controllable leds, like those strips with 5050 leds, you basically just send a command to each led in the strip and set the brightness percentage for each of the three colors and the chips inside those 5050 leds will do the work of adjusting brightness (or maybe a better word would be intensity) of each color for you.

 

If your strip is basically made up of basic three color leds, for example on of those that's made of segments you can detach if you want to, which has with sets of 3 leds in series with a resistor and running from 12v or some higher voltage, you'll basically have to do PWM (turn on and off so fast your eyes don't detect the interruption) ... for each color in your led strip, you'll have an output pin on your microcontroller that's connected to a npn transistor or mosfet and this is between the power supply of the led strip and the led strip itself.

 

Depending on your percentage of brightness, you keep the led strip turned on for longer periods of time.. ex for 50% brightness, you may want to keep the color on the strip turned on for 10ms, then turn off the color for 10 ms, and repeat the process forever - your eyes are not fast enough to detect the leds turning off, they'll just see dimmer leds.

 

The last option is to actually use proper led drivers for each color in the strip. There are led driver ICs which you can talk to and set the brightness percentage and they'll do everything for you inside them.

 

More importantly... if you want to work with leds, you have to understand how leds work, how to turn on ONE or how to turn on SEVERAL leds, how to not blow them up, how to control the brightness of each one (most important thing you need to understand is that they're current driven devices, not voltage driven like incandescent bulbs)

 

You'll have to settle on some sliders, settle on the microcontroller you're going to use, settle on how you're going to make the led strips (if you make it, if you buy one from stores etc) , the type of led strip decides how you approach the project.

 

Are there 12v amperage varying potentiometers I could use? I could just solder the three to each color on the led strip (Which are 12v 5050), and connect the +12 to the potentiometers in parallel?

 

Did I ask that correctly?

 

 

 

Computers r fun

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, W-L said:

It would be possible to replace it with sliders of the same resistance as the potentiometers if you really wanted to but it would be more hassle than it's worth. They do make slider type versions also if you are able to source some, here is an example:

http://www.ledstripbox.com/12-volt-dc-slide-dimmer-switch-3-channel-p-320.html

 

This is exactly what I am looking for. That may just be the answer to my question. Do you know if the device you linked is PWM varied or Amperage?

Computers r fun

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, TheNuzziNuzz said:

This is exactly what I am looking for. That may just be the answer to my question. Do you know if the device you linked is PWM varied or Amperage?

LED's are not amperage controlled, there are only two ways for controlling the brightness of them either directly via DC voltage control which is not ideal since you will not have a very large dimmable range, or the most common type which was mentioned PWM. Which does look to be the case with the IC on the back of the sliders as this single slider version here:

http://www.dx.com/p/sd-1-sliding-type-handheld-led-light-bulb-stepless-dimming-mini-dimmer-green-354918#.WC5oGeYrL4Y

Link to comment
Share on other sites

Link to post
Share on other sites

Basics of electronics :  Voltage = Current  x Resistance.   Power = Voltage x Current =  Current x Resistance x Current =  Current2xResistance

 

Incandescent light bulbs are basically resistors. Their resistance is fixed (well, changes very slightly as the filament heats up but let's ignore that) so the brightness of a light bulb can only be changed by adjusting the voltage. If you adjust the voltage, you'll change the brightness.  So for example with 10v at the input, the bulb will still light up but emit less light, and the total power consumed would be less.

 

LEDs are not incandescent light bulbs, they don't work the same.

Depending on the elements used to create the LED with a particular color, the LED needs a minimum voltage to turn on and emit light. Once this minimum voltage is reached, increasing the voltage won't make the LED brighter (well, i'm over simplifying but let's go with it).

For red leds, this voltage is typically about 1.8v..2.2v, for green the voltage is typically in the range of 3v...3.4v, for blue the minimum voltage is usually 3v...3.6v.

 

Here's a whole bunch of RGB leds, you can see the typical forward voltages there: http://www.digikey.com/short/3b0fqf

 

If you connect multiple leds in series, in order to figure out what's the minimum voltage to make a color light up, you need to multiply the minimum forward voltage by the number of LEDs in the series. So for example, if you have three leds in series, you'll need at least about 6v for red, about 9-11v for green and blue. This is the reason why most led strips designed to run from 12v are segmented in pieces with three leds and not more than three, because four or more LEDs in series would mean a forward voltage higher than 12v and then the color wouldn't turn on.

 

The problem with LEDs is that basically, they have almost no resistance, so if you just let energy flow through them, they consume so much power they burn themselves up. You NEED to control how much current goes through the LED and restrict the current to some sane amount.

 

The most basic method of limiting the current going through the LED is by adding a resistor in series with the led.

So for example, if our LEDs are supposed to handle at most 20mA (0.02A) going through them, as a precaution you need to limit the current going through each series of leds of a particular color to that maximum value.

 

For red :  we have 12v input , we have 3 leds with 2v forward voltage so 6v in total, so we need to add a resistor that would make 6v disappear, and we can use the basic formula above Voltage = Current x Resistance, but we write it like this instead : Resistance = Voltage / Current : 

 

So resistance  =  ( 12v -  3 x 2 v ) / 0.02A  = 6/0.02 = 300 ohm  and we can use the second formula to figure out how much power would be lost on this resistor : Power = Current2xResistance = 0.02A x 0.02A x 300ohm = 0.12 watts.

 

For green and blue : we have 12v input, we have 3 leds with 3.2v forward voltage so 9.6v in total, so we add a resistor that would make 2.4v disappear. 

Resistance = (12 - 3 x 3.2v)  / 0.02 A = 2.4v / 0.02A = 120 ohm , and the power lost on the resistor is 0.02 x 0.02 x 120 = 0.048 watts.

 

So we just limited the maximum current going through each color led in the RGB led to a maximum safe value by using a resistor for each series of 3 leds of same color. This makes it safe to just connect the anode of first led to 12v and the cathode of the last led to ground and turn on the three leds at max brightness.

 

If we want to control the brightness of each color, we'd have to change the resistors for each color to lower or bigger values, or we could use a potentiometer, but the big problem with potentiometers is that the material that's used inside them to allow you to easily adjust the resistance is really not designed to carry a lot of current. 

If you look in particular at slide potentiometers  you can see that the power rating for most is at maximum 0.1 watts, which means that if the power dissipated gets even close to that limit, your potentiometer would be damaged. So obviously, you couldn't use a slide potentiometer with a 0.1 watts maximum power for your red color, because at 20mA, the power lost in the potentiometer would already be 0.12w, more than its rating.

 

So instead of playing with the resistors that set the maximum power through resistors, it may be just easier to set it always to a maximum safe value and adjust the brightness of the leds some other way. The other way would be turn on and off the leds so fast that human eyes wouldn't perceive these interruptions, they'd just perceive the light as dimmer and that's what PWM means (pulse width modulation).  But in order to do that, you have to make your microcontroller able to send 12v to the strip of 3 leds or to not send 12v. 

Since microcontrollers work with lower voltages like 5v or 3.3v, you can't do that directly, you have to use something like a transistor or a mosfet which would act as on/off switches.

 

Your other option is to basically use specially made chips called "led drivers" which have the smarts inside them to control one or several channels, and on each channel you could have one or several leds in series, or just one color element from a series of leds  (how many would depend on how the driver chip is designed to work or the input voltage the driver receives)

 

For example, some LED drivers can be powered from a small voltage and have circuit inside which boosts this voltage gradually until the voltage on a channel is above the minimum forward voltage required by the series of leds on that channel .. so for example if you have 5 leds with 3.2v forward voltage, the led driver would take 5v in and raise it up to 16v, which is the minimum required.

 

Other LED drivers are designed so that you connect the LEDs to a higher voltage like 12v or higher, and the insides of the led driver chip acts as a resistor, limiting the maximum current. Some drivers limit the current as if they're resistors, others behave like having a safe maximum current resistor and then use pulse width modulation to adjust the brightness .

 

 

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

On 11/17/2016 at 6:32 PM, W-L said:

LED's are not amperage controlled

The best way to drive LED's is by the number of amps, not the voltage. The only reason the LED gets brighter past the forward voltage is because of their internal resistance (with an ideal LED past Vf the current consumption would be infinite). 

I don't think we need to really worry about that for OP's use case scenario, since LED strips have onboard current limiting resistors, which regulate the current anyways.

 

To answer OP's question, looking at the device that @W-L linked, it uses PWM control, meaning that you could replace the 3 onboard potentiometers (knobs) with slider potentiometers (aka faders). Keep in mind that the slide pots and regular pots are the exact same thing.

You would do this by first desoldering the potentiometer that is already on the controller (be sure to note down which pins of the potentiometer are connected where). Then solder 3 wires to the spots where the potentiometer's pins used to be, and then connect these wires to the corresponding pins on the slide potentiometer. (see diagrams below for further clarification).

Since the controller uses PWM, you don't have to worry about any other ratings other than the resistance (this should be written on the back of the potentiometers in the controller, which unfortunately means I can't recommend you a specific slide pot until you actually get the controller and open it up). If the resistance isn't on the back, then you can measure this using a multimeter (assuming you have one).

In summary: Desolder the regular potentiometers, and connect slide potentiometers in their place via wires to the correct places on the board.

 

slidepotwmark.png

pot1wmark.png

Oh and credit to Fritzing for the images.

Edited by WEEEEEE

May Our Framerates Be High And Our Temperatures Be Low.

PSUs: EVGA B2/G2/GQ/GS, Corsair RMx/i, Grey-Label CXM, Everything Seasonic/Delta/Super Flower, XFX except XT

Use pcpartpicker.com

Link to comment
Share on other sites

Link to post
Share on other sites

On 11/17/2016 at 5:00 AM, manikyath said:

just wanna mention this briefly:

 

DIYperks is an amazing guy for getting creative ideas, but dude has no idea what he's on about most of the time.

His videos are enjoying, but they turn into a cringe-fest about 2 minutes in.

 

The external control box he made a couple years back is a nifty idea though. Poor implementation of it, but still nifty. Can probably come up with something better, though I'd need some spare cash and a buttload of time to actually git'r'done.

 

 

Also, his case project was the worst thing I've seen since I tried to make a computing cluster out of P4 machines. never again

Remember kids, the only difference between screwing around and science is writing it down. - Adam Savage

 

PHOΞNIX Ryzen 5 1600 @ 3.75GHz | Corsair LPX 16Gb DDR4 @ 2933 | MSI B350 Tomahawk | Sapphire RX 480 Nitro+ 8Gb | Intel 535 120Gb | Western Digital WD5000AAKS x2 | Cooler Master HAF XB Evo | Corsair H80 + Corsair SP120 | Cooler Master 120mm AF | Corsair SP120 | Icy Box IB-172SK-B | OCZ CX500W | Acer GF246 24" + AOC <some model> 21.5" | Steelseries Apex 350 | Steelseries Diablo 3 | Steelseries Syberia RAW Prism | Corsair HS-1 | Akai AM-A1

D.VA coming soon™ xoxo

Sapphire Acer Aspire 1410 Celeron 743 | 3Gb DDR2-667 | 120Gb HDD | Windows 10 Home x32

Vault Tec Celeron 420 | 2Gb DDR2-667 | Storage pending | Open Media Vault

gh0st Asus K50IJ T3100 | 2Gb DDR2-667 | 40Gb HDD | Ubuntu 17.04

Diskord Apple MacBook A1181 Mid-2007 Core2Duo T7400 @2.16GHz | 4Gb DDR2-667 | 120Gb HDD | Windows 10 Pro x32

Firebird//Phoeniix FX-4320 | Gigabyte 990X-Gaming SLI | Asus GTS 450 | 16Gb DDR3-1600 | 2x Intel 535 250Gb | 4x 10Tb Western Digital Red | 600W Segotep custom refurb unit | Windows 10 Pro x64 // offisite backup and dad's PC

 

Saint Olms Apple iPhone 6 16Gb Gold

Archon Microsoft Lumia 640 LTE

Gulliver Nokia Lumia 1320

Werkfern Nokia Lumia 520

Hydromancer Acer Liquid Z220

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×