# How can I switch between 2 LEDs using a momentary DPDT switch?

#### rigerman

Joined Apr 25, 2014
40
Hi,

I am new to this forum. Good day to everyone.

I need to switch between 2 LEDs using a momentary DPDT switch. Can someone help me how to accomplish it?

#### rigerman

Joined Apr 25, 2014
40
To add to it, it can simply be a push button switch as well.

#### rigerman

Joined Apr 25, 2014
40
Thanks INWO!

#### rigerman

Joined Apr 25, 2014
40
But if I replace the push buttons with a momentary DPDT switch will the circuits still work? Because when I am toggling the DPDT I am actually reversing the direction of the current. DC 12V in this case.

#### rigerman

Joined Apr 25, 2014
40

#### Alec_t

Joined Sep 17, 2013
12,746
Does a LED have to stay lit only while the switch is held in an 'on' position? Or must it light then and stay lit until the switch is moved to the opposite 'on' position; i.e. there is a latching action?

Edit: I'm guessing this is for a model railway turnout indicator?

#### rigerman

Joined Apr 25, 2014
40
Does a LED have to stay lit only while the switch is held in an 'on' position? Or must it light then and stay lit until the switch is moved to the opposite 'on' position; i.e. there is a latching action?

Edit: I'm guessing this is for a model railway turnout indicator?
The LED should stay lit till the switch is moved to the opposite on position.

You guessed it perfect. The momentary switch throws the turnout in either the straight or diverging direction (depending on position A or B of the DPDT) and the turnout stays there till the switch is reversed. However from a distance, visualizing is very tough and thus an indicator is needed on the control panel.

#### djsfantasi

Joined Apr 11, 2010
8,263

What is the make of the turnout switch? Many of them have extra contacts to drive external LED position lights.

Solenoid coil based machines as far as I have seen, do not require the current to be reversed. In that case, I have wired a regular DPDT switch with one set of contacts driving the indicator lights and the second set wired in series with a momentary pushbutton switch to energize the coils.

If your turnout switch does require current to be reversed, one could wire a small bridge rectifier in parallel with the output - giving you a DC source to drive one of the flip flop circuits presented earlier.

Please let us know the make and full wiring diagram of the turnout switch you are using.

Last edited:

#### inwo

Joined Nov 7, 2013
2,419
The flip flop could get out of step.
This is better.

Replace the switches with a diode connecting cathode to "mechanical part" red and blue respectively.

Which ever (red or blue) goes to ground will turn off that NPN.
Series diodes added in emitter circuit may be a good idea.

#### rigerman

Joined Apr 25, 2014
40

What is the make of the turnout switch? Many of them have extra contacts to drive external LED position lights.

Solenoid coil based machines as far as I have seen, do not require the current to be reversed. In that case, I have wired a regular DPDT switch with one set of contacts driving the indicator lights and the second set wired in series with a momentary pushbutton switch to energize the coils.

If your turnout switch does require current to be reversed, one could wire a small bridge rectifier in parallel with the output - giving you a DC source to drive one of the flip flop circuits presented earlier.

Please let us know the make and full wiring diagram of the turnout switch you are using.
I am using Kato #6 turnouts for N scale. These turnouts need a momentary voltage to throw the turnout in either of the direction. One of the easy solution is to use a two step process as you mentioned, use a normal DPDT for the polarity change and a push button for the turn out supply. I am trying to eliminate the dual process by a single action. That is momentary DPDT.

#### rigerman

Joined Apr 25, 2014
40
The flip flop could get out of step.
This is better.

Replace the switches with a diode connecting cathode to "mechanical part" red and blue respectively.

Which ever (red or blue) goes to ground will turn off that NPN.
Series diodes added in emitter circuit may be a good idea.
So the cathode of the diodes will be grounded as well as connected to the "mechanical part" ?

#### John P

Joined Oct 14, 2008
1,971
Kato turnouts have a unique feature where they're operated by a momentary pulse on a single coil, with the direction of the current controlling which way the solenoid moves. You can see in the picture that there are only 2 wires. A good way to operate them is with an A.C. source and a pair of pushbuttons each in series with with a diode, and you could then take that pulsing high or low voltage and use it to set or reset a transistor latch. But you'd have to live with the situation where the LED might not be right when layout power is first turned on.

#### rigerman

Joined Apr 25, 2014
40
Seems like a complex problem here.

#### SgtWookie

Joined Jul 17, 2007
22,226
Latching relays may be your most simple bet. There are latching relays which have two coils, and latching relays with single coils. Either might work with your situation.

Here is an example latching relay at just over $2/ea when buying singly, offered by Digikey, who is a reputable distributor: http://www.digikey.com/product-detail/en/EC2-12SNU/399-11030-5-ND/4291096 You get a pretty good price break at 50 units - it's good to have spares of the same part type, so keep that in mind if you're planning on adding a lot of switches to your layout. Basically, you'll just connect the coil of that relay in series with a 910 Ohm resistor (to drop the difference between the 12v rating of the coil and your RR's 19v supply) up in parallel with your switch machine's coil/motor terminals, connect your positive LED supply in series with a resistor (say, 2k) to one of the contact set's common terminals, the N.O. contact to a green LED's anode, the N.C. contact to a red LED's anode, and the cathodes of both LEDs to ground. I'll post a schematic, but want to verify if your supply is 19v or something else? Did you want to make a circuit board to mount a bunch of these things, or were you planning on making them separately? Last edited: Thread Starter #### rigerman Joined Apr 25, 2014 40 Latching relays may be your most simple bet. There are latching relays which have two coils, and latching relays with single coils. Either might work with your situation. Here is an example latching relay at just over$2/ea when buying singly, offered by Digikey, who is a reputable distributor:
http://www.digikey.com/product-detail/en/EC2-12SNU/399-11030-5-ND/4291096
You get a pretty good price break at 50 units - it's good to have spares of the same part type, so keep that in mind if you're planning on adding a lot of switches to your layout.

Basically, you'll just connect the coil of that relay in series with a 910 Ohm resistor (to drop the difference between the 12v rating of the coil and your RR's 19v supply) up in parallel with your switch machine's coil/motor terminals, connect your positive LED supply in series with a resistor (say, 2k) to one of the contact set's common terminals, the N.O. contact to a green LED's anode, the N.C. contact to a red LED's anode, and the cathodes of both LEDs to ground.

I'll post a schematic, but want to verify if your supply is 19v or something else?
My supply for the switches is 5V. Kato switches operate fine on 5V DC.

#### djsfantasi

Joined Apr 11, 2010
8,263
Using standard DPDT switches, a momentary pushbutton, and a bicolor LED produces a simple solution. See my diagram below.

#### Attachments

• 4.4 KB Views: 426

#### rigerman

Joined Apr 25, 2014
40
Using standard DPDT switches, a momentary pushbutton, and a bicolor LED produces a simple solution. See my diagram below.

Yes, indeed but when the number of switches is like 20 the 2 step action becomes monotonous during the operation. So my intention is to make a single step action that will throw the turnout and at the same time, indicate it's direction.

#### John P

Joined Oct 14, 2008
1,971
Another approach might be to use a very low-power electronic latch and keep it powered with a battery. For instance, the CD4013 has a max power draw of 1uA at 5V, so you wouldn't be buying batteries very often. I'm not sure how to turn the output into something that will drive LEDs and not draw any battery power when main layout power is off, though.