LED Changeover circuit

phil2580

Jun 27, 2011
2
Joined
Jun 27, 2011
Messages
2
Hi All,

I'm a bit rusty on my electronics knowledge, so please forgive me.

I'm looking for a circuit (~12v DC input) to drive 12 LEDs (6 blue, 6 red) via a potentiometer such that when the pot is set at it's lowest resistance, the blue LEDs will be illuminated, then as the resistance is increased, the blues fade and the reds illuminate.

Any ideas?


Thanks,

Phil
 

phil2580

Jun 27, 2011
2
Joined
Jun 27, 2011
Messages
2
Thanks, but I'm ok with how to drive LEDs...the problem I've got is how to get the current split based on the pot setting.

Basically, I'm after the following end-result....

With the pot at 0% (i.e. it's lowest resistance), I want the blue LEDs lit, and the red LEDs off.

With the pot at 50%, I want both LED's at approx. half brightness,

With the pot at 100% (i.e. it's highest resistance), I want the red LEDs lit and the blue LEDs off.

Thanks,

Phil
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
The easiest way would be to use something like a 555 set up as a fixed frequency variable duty cycle oscillator (you use 2 diodes to separately control the charge and discharge path)..

When the output is high, turn on the red LEDs. When it is low, turn on the blue LEDs. As you vary the duty cycle the LEDs will smoothly change from red to blue.
 

TBennettcc

Dec 4, 2010
292
Joined
Dec 4, 2010
Messages
292
Brilliant, Steve.

Would you need a NOT gate (e.g., a 4000 series or a 74 series IC) to drive the LEDs that would be triggered LOW?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
depending on the combined voltage drop of the diodes you may be able to have them all in series with the mid point connected to the output of the 555 (each leg requires its own current limiting resistor). As the 555 's output goes from rail to rail, it provides the full voltage to one string of LEDs or the other.

This *may* leave some residual glow in the LEDs, and is somewhat sensitive to supply voltage, however this would only be an issue when the 555 is not connected, which should be never.

The other option is to control one string of LEDs with an NPN transstor and the other with a PNP transistor. care must be taken to ensure that you do not cause large currents to pass through the BE junctions of both.

Even more simply, a P and N channel mosfet could be used. With this there is no issue of connecting your supply rails together via a pair of BE junctions :)
 

TBennettcc

Dec 4, 2010
292
Joined
Dec 4, 2010
Messages
292
Could you maybe draw up a schematic, Steve? I'm having trouble visualizing what you mean... (although, I'm still quite new to a lot of this stuff, so it doesn't take much! :D )
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
This is the idea

attachment.php


In practice the 6 blue LEDs would have to be 3 strings of 2, and the red could be 2 strings of 3. The resistors should be calculated as if the LEDs see the full supply voltage.

A bipolar 555 can drive significant current, so the output capacity won't be a problem for LEDs running at 20 mA or so.
 

Attachments

  • Scan-110628-0001.jpg
    Scan-110628-0001.jpg
    10.2 KB · Views: 447

TBennettcc

Dec 4, 2010
292
Joined
Dec 4, 2010
Messages
292
Wow. Okay. I had to go do some more research. I'm a very visual person, so sometimes I really have to see things in order to understand them.

Found these two pages:

http://www.kpsec.freeuk.com/components/ic.htm#sinksource

and

http://www.kpsec.freeuk.com/555timer.htm#output

So, this concept works because of the voltage difference between V+ and the 555 output, and the 555 output and ground. When the 555 output is high, the 555 output voltage is (at least very close to) V+. Because the potentials are (nearly) the same, (little to) no current flows. Same with the 555 output going low.

Brilliant.

In practice the 6 blue LEDs would have to be 3 strings of 2, and the red could be 2 strings of 3.

Why would the LEDs have to be broken up like that?

The resistors should be calculated as if the LEDs see the full supply voltage.

...why wouldn't the LEDs see the full supply voltage?

How would you do it with the transistors? With the MOSFETs?
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Why would the LEDs have to be broken up like that?

You need to ensure that the sum of the forward voltages of the diodes is less than your supply voltage. Assuming you have something like a 12V supply, 2 blue LEDs will work, three may not. Whilst you can probably put 4 or more red LEDs in series at this voltage, it is far simpler if you have strings of the same size (easiest to ensure a similar brightness) so for 6 LEDs, you can choose 1 string of 6, 2 of 3, 3 or 2 or 6 or 1. The ones which fit the best are as I suggested.

...why wouldn't the LEDs see the full supply voltage?

There will be some voltage drop by the transistors used as the output drivers of the 555. It will be quite low at low currents, but don't bargain on having an *exactly* rail to rail swing. At the currents you'd be looking at, the specs suggest that something between 0.4 and 0.75 volts would be dropped when the output is pulled low, and up to 1.7 volts when pulled high.

See the electrical characteristics on page 4 of the datasheet.

How would you do it with the transistors? With the MOSFETs?

OK, with mosfets you'd do it like this:

attachment.php


Essentially you do it the same with bipolar transistors, however you need to note that with bipolar transistors both BE junctions are forward biased and separated only by the 2 base resistors. The naive solution tying the bases together and using a single resistor to the 555 will cause massive currents to flow and the sudden death of (probably) both transistors.

I used a separate gate resistor with the mosfets, but it would be possible to eliminate them entirely without any real problems (although gate resistors are required in some cases).
 

Attachments

  • Scan-110628-0002.jpg
    Scan-110628-0002.jpg
    13.7 KB · Views: 530
Top