# Need help with lighting up LEDs conditionally

Discussion in 'Homework Help' started by rigerman, Aug 21, 2015.

1. ### rigerman Thread Starter Member

Apr 25, 2014
40
0
So here is the situation.

I have 2 LEDs. One blue, one yellow. I have 2 power sources of 3V and a switch.

+
3v------------------LED 1
-

+
3v------------------LED 2
-

When the switch is on, LED 1 is on LED 2 off. But when switch is off, LED 2 should be on and LED 1 should be off. With a condition, if the polarity of the LED 1 power is changed, LED 2 should be on drawing current from it's own source.

2. ### WBahn Moderator

Mar 31, 2012
20,229
5,755

Since this is Homework Help, I'm going to guess that this is a homework problem that you are supposed to try to figure out. So then you need to show your best attempt to try to figure it out.

What kind of switch do you have?

Do you not have any resistors or other way to limit the LED current?

When you talk about the polarity reversal condition, is that with the switch one or the switch off? The wording makes it sound like LED 2 should normally be pulling power from the source associated with LED 1, is that the case?

3. ### rigerman Thread Starter Member

Apr 25, 2014
40
0
Sorry, I must have posted in the wrong section. It is not exactly a homework. I need a circuit for this for a small project of mine of an architectural model of coal mine.

The switch is a normal double pole on off switch.

The polarity will be reversed with the switch off.

LED 2 can have a separate power source, but I am not really much of an electronics guy.

4. ### WBahn Moderator

Mar 31, 2012
20,229
5,755
By "normal double pole on off switch", do you mean a double-pole, single-throw switch (look up that term and compare it with the switch that you have).

Let's try to nail down the specs a bit tighter.

You have two power sources, each 3V DC, two LEDs, and a single switch.

When the switch is in the ON position, you want:
1) LED 1 to be on and LED 2 to be off

When the switch is in the OFF position, you want:
1) IF the power for the first LED is properly polarized, you want LED 1 to be off and LED 2 to be on.
2) IF the power for the first LED is reverse polarized, you want LED 1 to be off and LED 2 to be on, put pulling power from it's own source.

Do you see how this implies that LED 2 must be pulling power from LED 1's source if the power for it is properly polarized? If that's not the case, why have the condition.

What do you want to happen when the switch is in the ON position when the power for the first LED is reverse polarized?

5. ### rigerman Thread Starter Member

Apr 25, 2014
40
0
Okay I will explain. This is for the underground mine lights that work on the carriage signals.

Situation 1 - Carriage is stalled. No power.

------------------------------------------------------------------------------------------
Situation 2 - Carriage is going down.

----------------------------------------------------------------------------------------

Situation 2 - Carriage is going up.

----------------------------------------------------------------------------------------

So when the power to carriage is off, it can still light the yellow LED. But as soon as the carriage is powered, either of the blue lights is turned on depending on the polarity.

Hope I am being able to explain the situation.

6. ### WBahn Moderator

Mar 31, 2012
20,229
5,755
If anything, I'm more confused. You said you had two LEDs, now it sounds like you have four. Is your diagram depicting the LEDs on two different levels and is the gray box supposed to be the carriage? And it sounds like under some conditions you want both a yellow and a blue LED to go on.

7. ### rigerman Thread Starter Member

Apr 25, 2014
40
0
Actually if 2 of the LEDs can be managed, the other 2 can be managed, as they just work on the other polarity of the DPDT. The yellow and blue LEDs are upper and lower level. Grey is the carriage.

Case 1: DPDT Center off position - Both Yellow is on. No power to carriage.
Case 2: DPDT Up position - Upper blue is on. Lower yellow is on. Carriage has power.
Case 3: DPDT Down position - Lower blue in on. Upper yellow is on. Carriage has power with reverse polarity.

8. ### WBahn Moderator

Mar 31, 2012
20,229
5,755
Now we've added another new piece of information -- that this is not only a DPDT switch, but that it has a center-off.

Why do I have the feeling that there are still more shoes to drop?

Is this the complete specification that you need? That you have only need to turn on the LEDs as described based on the position of the switch? Or is this switch being used for something else as well?

If there aren't any other items of footwear, the following should do what you have described in your last post:

Notice that a single supply and a single SPDT switch with center-off is all that is needed.

When the switch is NOT connected to a particular side (so it is either connected to the other side OR it is in the center-off position), then current can flow down through the Yellow LED but there is no path through the Blue LED due to the normal diode. When the switch IS connected to a particular side, the Yellow LED is shunted by the normal diode and so can't get the required voltage across it to light up. The normal diode.

The resistors are sized to give the desired current in each diode when on. You can actually use a single resistor for both Blue LEDs, but you can't do that that for the Yellow LEDs.

If the colors were reversed you could (potentially) simply the circuit by relying on the fact that the forward voltage of the yellow LED is typically significantly less than that of the blue LED, but you can't play that game with the color choices you have.

rigerman likes this.
9. ### rigerman Thread Starter Member

Apr 25, 2014
40
0
Thank you. I will implement this tomorrow and let you know how it went. Yes that is all I need. No more footwear

10. ### rigerman Thread Starter Member

Apr 25, 2014
40
0
Worked like a charm WBahn! Exactly what I needed. Thank you so much. I do have another query related to the carriage movement circuitry, (it is a different circuit) can I post it here.

Mar 31, 2012
20,229
5,755