Need help getting 256 colors out of a LED

Thread Starter

branden137

Joined Mar 7, 2010
27
I am making an attempt to produce a LED color controller that will produce 256 colors using potentiometers.

BUT I can't get the pots to resist the voltage down low enough that the LED's individual colors do not glow at all.

According to my math a 10k pot should resist the voltage far below the operating voltage but alas it still glows.

I KNOW THIS CAN BE DONE EASIER WITH A MICRO CONTROLLER.

I WANT TO MAKE THIS ON THE CHEAP SO NO MC's

Thank you so much in advance.

I am a DC circuits noob so please explain well, and I am not shy of reading large hidden forum pieces on this subject.

Twitchell
 

SgtWookie

Joined Jul 17, 2007
22,230
You need a PWM controller, one for each color.

You can make one from an LM339 quad comparator and some additional components.

See the attached schematic.

[eta] The connections for the power pins of the LM339 are not shown, and neither is the voltage. The circuit was designed to be operated on 12v-14v for V+.

You could use separate red, green, and blue LEDs, or you could use RGB LEDs that have common anodes. The circuit will not work as shown with common cathode LEDs.

Not shown are current limiting resistors for the LEDs, as this is a rather generic schematic.
 

Attachments

Audioguru

Joined Dec 20, 2007
11,248
You need a red LED, a green LED and a blue LED. Their brightness is controlled by varying the current, not the voltage.

You forgot to show your schematic so I guess you simply connected a potentiometer in series with each LED. Then each LED will never turn off completely.
 

Thread Starter

branden137

Joined Mar 7, 2010
27
You are correct Audioguru

Currently i have

10k pot----/470ohm/----/LED-red
10k pot----/470ohm/----/LED-blue
10k pot----/370ohm/----/LED-green
INPUT+----to common cathode.

in NOOB thought process it seemed that easy.

I thought the 10,000 ohms of resistance would turn the indivual colors off.
 

Thread Starter

branden137

Joined Mar 7, 2010
27
Sgtwookie I looked up this LM339 Quad Comparator

First i am not sure how to put it together but that I can figure out.

How would i be able to have knobs on the front of a computer case to actually change the colors on the LEDs with this.

LM339 Quad Comparator = something about +ing and -ings voltage?

But how do i actually cycle thru these voltages to get different end colors.
 

SgtWookie

Joined Jul 17, 2007
22,230
I thought you didn't want to involve computers?

The circuit won't work as it is anyway with your common cathode RGB LEDs.

Since you have pots, I thought you wanted to control them manually.

What is it that you want to do - cycle through various colors automatically using integrated circuits?
 

Thread Starter

branden137

Joined Mar 7, 2010
27
My original idea was to take a manual fan controller and make it to were i could manually adjust the red blue and green parts of a RGB led (with a common cathode)

My end goal was to make a Manual LED color controller that i could mount in a 5.25 drive bay and control all the LED's on my LED fans in my computer.

I figured if i could adjust each color i could make all 256 RGB colors by having full red full blue no green =purple as an example.

At no point will there be a computer interface. I was trying to do this fully manually.

I do not want to cycle thru colors automatically i want to be able to select a color by adjusting the three individual colors via manual knobs.

ideally i would need 55 choices per color but less will be okay too.

Thank you SGTWOOKIE
 

SgtWookie

Joined Jul 17, 2007
22,230
If you use three potentiometers for individual control of the red, green, and blue, you will have practically an unlimited number of colors available. Did you want to limit the selection to just 256 colors? That would actually be harder to do.

How many of these RGB LEDs did you plan on operating with this circuit? One? Five? 25?

What are the exact specifications of the LEDs that you have, or a link to where you bought them? What I am looking for is the typical Vf at a specific current for each color.
 

SgtWookie

Joined Jul 17, 2007
22,230
Following along with what blueroomelectronics mentioned, a DIP switch of 8 positions could give exactly 256 combinations; three switches for two of the colors and two for the other color. A 9-position DIP switch could allow selection of up to 512 colors, if you include black (off) as a color. Radio Shack carries an 8-switch DIP, but it is overpriced junk.

The switches would select different combinations of resistors to select the percentage of PWM, and the colors would be very repeatable. However, potentiometers would provide for a constantly variable palette; ie: a nearly infinite number of colors.
 

SgtWookie

Joined Jul 17, 2007
22,230
Alberto,
Oddly enough, the schematic you linked to won't work as-is for his RGB LEDs, as they are common cathode. It could be modified to work with P-ch MOSFETs, but it would require a 330 Ohm pull-up resistor on the output of the 555, resulting in fairly high power dissipation when the output was low; 1W resistors would be required. The parts count would be higher; as three of those circuits would mean at least two ICs (one 556), or three 555's - instead of one 339 comparator.

Another item is that the circuit you linked to won't actually go to 0%; it has a range of perhaps 3% to 97%. The 339 circuit I posted has a full 0% to 100% range.

The circuit I posted needs modification in order to be able to source current. I'm still waiting for our OP to let us know what the specifications of their RGB LEDs are, and how many of them they plan on operating at once.
 

Thread Starter

branden137

Joined Mar 7, 2010
27
i plan to be lighting a maximum of 40 LEDs Min of 12.

Again how do i get pots to bring color down to 0% THOUGH

20pcs Super bright 4 pins Red/Green/blue Diffused LEDs Common Cathode and Manual Control LED
Item Photo
Description
Description
QTY
Emitted
Color
Size
(diameter)
Lens Color
Remark
5mm round Super bright Diffused Red/GreenBlue LED
20PCS
Red/Green/Blue
5mm
Water Clear
Common Cathode

Diffused LEN

Diffused LEDs
  Forward
Voltage(V) Dominant
wavelength(mm) Luminous
Flux(Lm) Reverse
current(uA) 50% Power
Angle (deg)   If=20mA If=20mA If=20mA Vr=5V   Min Typ Min Typ Min Typ Max Red 1.8 3.5 615 625 6000 8000 10 20
Green 3 3.5 515 520 6000 8500 10 20 Blue 3 3.5 460 465 6000 8500 10 20


I think this is what you all need.
 

Audioguru

Joined Dec 20, 2007
11,248
Somebody else bought cheap ******* RGB LEDs on E-Bay and instead of common-cathode they were actually common-anode.

They do not say how narrow is the beam. They might be extremely cheap and dim but use a tight focus to make them appear bright when pointing directly at you. Then they will not be seen pointing to one side.
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, I actually have some that are similar to those - except mine are clear, not diffused.

The pots don't directly control the current flowing through the LEDs.

The pots set a reference voltage for the comparator to "trip" at.

Referring to the schematic I posted earlier, one of the comparators (IC2D) is connected as an astable multivibrator. Definition: http://en.wikipedia.org/wiki/Multivibrator

C3 is alternately charged via R1 and R10, and discharged via R1 and the output of IC2D. The waveform on C3 vaguely resembles a triangle.

The three pots individually set the trigger voltage level for the three other comparators. The output of the comparator reflects whether this level is higher or lower than the constantly changing triangle wave by either being 0v, or nearly V+ (in your case, 12v).
If near 0v, the MOSFET transistors are turned off, and the LED is dark. If near 12v, the MOSFET is turned ON, and the LED is bright.

Since you have a common cathode LED, the configuration of the output circuit will have to be changed to accommodate. The MOSFETs in the diagram can only sink current, they cannot source current.

Now the question is, where can you get parts? If you have a Radio Shack nearby, or better yet a "real" electronic store that sells lots of different components, I can draw up a modified schematic to suit.

If you need to order stuff from a mail-order or internet order place, that can be done too. Digikey is pretty hobbyist-friendly, and they will ship small orders via USPS 1st Class; that can save you money. They are also authorized distributors for numerous manufacturers, so you can be assured that they are selling "the good stuff" and not counterfeit parts.

You don't have your location in your profile. You don't have to be overly specific, but at least country and state or province would be helpful to people trying to help you.
 

Thread Starter

branden137

Joined Mar 7, 2010
27
SGTWOOKIE---> I am from McAllen, TX. (the tip of texas right before you get to Mexico.

I have a radioshack but i would rather just buy pieces off dikey as you said.

I would love a schematic drawn out and I thank you for being so patient with my inexperience.

After looking at things I understand how this is going together.

Basically pots supply the varying voltage that trigger the switches inside the comparators which supply new voltages that are reduced by the resistors in the way to the LED

So turn the pot and trigger a different switch that then supplies a new voltage to the LED therefore changing the Brightness. With the added benefit that if not enough voltage is added in the beginning that the LED will not turn on at all.
 

SgtWookie

Joined Jul 17, 2007
22,230
Branden,
I actually know a fellow Marine from McAllen, TX. ;) Edit your profile, and stick Tx, USA in there - or McAllen, TX USA if you're proud enough ;)

It is difficult to understand new concepts when one is new to a subject - it doesn't matter what the subject material is. The fun part is when things "click", and you do actually "get it".

However, I'm afraid that you don't quite understand what is going on in the circuit.

The pots supply a voltage level that tells the comparators what voltage level to look for.
If the pot voltage level is less than the 200Hz (+/-30Hz) signal, the output will be low, otherwise it will be high.

The idea here is that the LED will be on for a slice of time, and off for a slice of time. If those slices of time are fast enough, your persistence of vision will not be able to tell the difference.

Movies are a great example of persistence of vision. If it were not for persistence of vision, we would see movies as a long series of photographs, rather than a moving diorama.

I'll work something up for you tomorrow.

Oh, Mouser is a TX company. They might not ship via 1st class USPS, but they are in your state.

Digikey is not in TX - they will ship via USPS cheap, but it may take extra days. You tell us what is most appropriate for you.
 

Thread Starter

branden137

Joined Mar 7, 2010
27
Okay I understand Frames per second and that our eyes can only see 60 FPS.

Prior to coming here I was reading up on using the micro controller to do this stuff using Pulse Width Modulation, but stragely I did not think that was what we were doing actually.

So the LED will basically be flashing so fast you can't tell at a intensity based on input from the pot.

I did not realize that you had these cycles in DC I thought that was something only AC had.

I thank you and I am very proud to live in the USA.

I have been to Mexico, Canada, Japan, and Europe.

And everyone made me grateful to live in the USA.
 

Thread Starter

branden137

Joined Mar 7, 2010
27
Digikey is the company I like.

I forgot to mention it.

The others site is lacking in the user interface functionality.

Thank you once again.
 

Thread Starter

branden137

Joined Mar 7, 2010
27
Sgtwookie- did you end up having trouble putting those things together.

Actually you seem like the type to me that would build it first before sending it out just to make sure it works.

I thank you so much for helping me with this I cannot wait to build it and make a newer sexier computer LED system.

Thanks again

Branden
 
Top