# Any Digital Electronics Engineers Out There?



## Dwight Ennis (Jan 2, 2008)

I need a circuit to power four bipolar red/green LEDs - either two lead or three lead as I have both, the purpose of which is to indicate the route through a double slip switch on the control panel. Each set of points is controlled by one switch machine having a set of DPDT contacts. For any given position of the two sets of points (and hence the DPDT contacts), only one route through the double slip switch is possible.

Here's a diagram...










Power available is either straight 12VDC or, if taken off the power feeders to the switch machines, polarity reversing 12VDC depending upon which way the points are set.

Seems to me that each position - and LED indication - is going to be the result of ANDing either the polarity reversing power feeds to the switch machines themselves, or ANDing a voltage fed through the DPDT contacts. I'd like to do this with solid state circuitry - perhaps four AND gates - and stay away from mechanical relays if possible.

I'd sure appreciate some help on this as I am not a digital circuit designer. Any takers?


----------



## noelw (Jan 2, 2008)

We had the same thing ( analog ) in one place on our Ho tracks around 20 yrs' ago when we were in Ho club, but now no place to use that modular and my Cyn. modular, so sold it off.

Atlas make a relay that looks like a Atlas Remote switch track machine. ( I had 2 atlas relays and 2 Radio shack DP/DT relays to do it.)

I hooked mine up with the same wires that control the R/C Track switch to get the direction I need to show on the panel. Then I pick up a Radio shack DP/DT cheap 12v relay to work the bi LED's . 
There is probably better cir. out there, but I did this 20 yrs ago and working a long time on my Bi LED'S on our control panels.

Just change to larger Relay if using it for Garden R.R. stuff. Mine is for my Ho layout. 
Hope this is what you are lookng for. 

Note: not sure if you are doing Ho or not, but slip switches at that time I did our was nbr 4's and not good on pass cars. Kind of wonder what you have?


----------



## Dwight Ennis (Jan 2, 2008)

Note: not sure if you are doing Ho or not, but slip switches at that time I did our was nbr 4's and not good on pass cars. Kind of wonder what you have? Yes it is HO - a small switching layour in a back room. And yes it is a #4 double slip switch, but as it's a switching layout set in the era of 40' freight cars, there are no problems. I built all the track using fast tracks tooling after a false start with ME flex track and Atlas Custom Line switches and now it runs like a watch.









Still in its very early stages... 























































These were taken when the ME and Atlas track were still down.


----------



## noelw (Jan 2, 2008)

Sure like the building you have.. If I was to re_do the layout, would go to building like tho's. I make mine to fit into 4 6 foot high crates with casters on them that held 3 to 4 modules to give me a total of 95 feet. So had clearance problems that most of the building had to be put in boxes in one crate. Now stuff that is over 8 inch high is stuff that comes off. Even the 300 and some pine trees. Lol. 
Anyway keep showing photos of what you do.. It all can be done the same way in Garden R.R. to. Noel


----------



## noelw (Jan 2, 2008)

Oh.. for got to add. I did some control panels that I use a dial up a yard switch with Yellow LED's on the panel showing where they are with. Then just have two buttons to throw the switch.. By using Cap discharge to set switchs it dail ( Using a three wafer gang Sw.) it up and hit the button one in the direction you want the point to go and bamb... it set. Make it nice to just dail up your yard to set as many Sw. as you want. Just an idea. 
I'm doing that on Wilsonville town in yard layout now too for the area I can't reach. Just look at the panel layout print or diagram and dial up the Switch.

I did some of my stuff on Ho using 555 and 556 chips for set up Switches on using the idea of hi and low setting for dial up for more than one Switch, also, I'm using them for Blocks on the main line that feed in to my computer. It take time to find the cir. run on the computer to troubleshoot the location of the Relay tho.. When you have to find the darn reed switch that is causing the problem to set the relay.. So now just using Relays bank with LED's to fine any problems. 

Guess if we had DCC at the time I built this layout 20 some yr's ago, wouldn't have to use blocks and dial up a track switch.. lol. 
You know.. old tech stuff from old guy. lol.


----------



## Dwight Ennis (Jan 2, 2008)

I'm using Tortoise switch machines so I don't need a cap with a high instantaneous output, but a steady 12vdc on the machine at all times. On the first go-around, I was using stationary decoders and operating the Tortoise machines via the DCC cab. Didn't like that though, so on the replacement section I'm using simple toggle switches on a control panel. As it's a small switching layout, I won't be moving around so no worries about a central control panel. The toggle gives a good visual indication of which way the turnout is thrown (the layout is rather high and it isn't easy to see all the turnout positions), and with the flip of a finger I can throw it another way... which imho beats the **** out of hitting an ACCY button, inputting an address and hitting Enter, then entering a 1 or a 2 and hitting Enter again. I like the KISS principle. Plus it provides a good place to mount the buttons for the electromagnetic uncouplers. 

The building on the left is a kitbash combining two Atlas Middlesex Mfg. Co. kits, and the one on the right is made from DPM modular parts. Needed to take a break after five years of almost nothing but machining, so decided to do this. As my space is VERY limited, I went with HO. Building structures has always been my first love anyway. And I want to get into operations, so I'll be using a car card and waybill system to generate switching movements.


----------



## Rods UP 9000 (Jan 7, 2008)

Dwight 
On my N-sacle layout, I have the LED's wired in series between the tortoise and the toggle. I use the 2 leg bi-color led and it works great. The wiring diagram should be on the instructions with the tortoise. If you can't find it, I'll draw a diagram up for you. 

Nice looking layout. The lighting is awesome. 

Rodney


----------



## Dwight Ennis (Jan 2, 2008)

Thanks Rodney. I don't think that approach will work here. Note that in the top two diagrams, the left two LEDs are the same color despite the left switch machine and points being thrown in the opposite direction. That's why each LED's color needs to depend upon the setting of BOTH the left and right sets of points... which is where AND gates might come in.


----------



## Rods UP 9000 (Jan 7, 2008)

If you are using 4 switch machines and 4 toggles, I think it will work. I'll draw it out tomorrow and let you know. I have a double slip I'll try it out on and make sure it will work. 

I see you are using only 2 toggles, Maybe I need to look a little closer before I post something.


----------



## toddalin (Jan 4, 2008)

Instead of using dpdt switches, couldn't you just use 4pdt switches and use the other two poles to provide the "logic" by way of a wiring matrix? I assume that if you are using the _Tortoise_ machines (gotta love that name), the toggle switches are not momentary.


----------



## astrayelmgod (Jan 2, 2008)

Dwight -- 

To answer your original question, I assume that the toggle switches are all wired so that moving them to the right generates a high leve; moving them left generates a low signal. Simplifications: the switches on each side are always both left or both right, so one can be ignored. The LEDs on the same side are always the opposite color, so one on each side can be driven from an inverter off of whatever drives the other LED on that side. Having done all that, a logic diagram might look like this: 

switches LED color 
left right left right 
1 1 R R 
0 1 R G 
0 0 G G 
1 0 G R 

As you can see, there isn't any way to combine anything, a high sometimes means red, sometimes green. So, you're right, you need four two input AND gates. However, you also need to generate the inverse of each switch to use every place there is a zero. Assuming that the switches are not connected to anything else, you could do that by wiring the switches in anti-parallel fashion, so that throwing both switches to the right generates a high on one, and low on the other. You also need four inverters, one each to invert the output of an AND gate, and drive the other LED in the pair. 

All of the above is to drive one side of each LED. You would need yet another inverter to drive the other side of a two legged device. 

It seems like there should be an easier way to do this, but it's late, and I'm not thinking all that clearly. Other ideas invited.


----------



## Cougar Rock Rail (Jan 2, 2008)

Hi Dwight! 

I would consider using something like a little programmable microcontroller, such as the Basicmicro Atom. On those microcontrollers, each pin (say 28) is capable of acting as either an input or as an output. So you could have an output from each switch machine connected to its own pin, to tell the controller which direction it was (by either being on or off say) then the program you write (it uses a modified version of BASIC--very easy to learn) can do all the "If-then" or "if this, and that.." etc. to figure out what was going on and which colour each one should be. Then the microcontroller can light up the appropriate LEDs from the various remaining output pins available. 

Keith


----------



## toddalin (Jan 4, 2008)

I think that you are over thinking/complicating this. I think that using a different approach, it can be accomplished just using 4 common anode LEDs and 16 rectifier diodes, as well as a power supply for the LEDs. 

Do you power the actual turnout motors using dpdt switches on a panel wired as a "X" for polarity reversal? If so you can use these switches to route the power to the LEDs to produce any color combination you choose with any switch combination. Replace the dpdt switches with 4pdt switches on your control panel. Basically you have four situations so you need four different "points" to tap power from, and each "point" must only be active for a certain switch combination.

Run the anode from the LED power supply to the four LED anodes.

Run the cathode from the LED power supply to the upper common lead of the 1st 4pdt. (We'll use the two lower leads on each dpdt to control the turnouts as usual.) Run the upper right lead of the 1st 4pdt to the upper common lead of the 2nd 4pdt. Run the upper left lead of the 1st 4pdt to the lower common lead of the 2nd 4pdt.

From the upper left lead of the 2nd 4pdt, run four rectifier diodes to the four cathodes of the four LEDs to whichever of the colors you desire. We'll also do this on the upper right, lower left, and lower right leads of the 2nd 4pdt all to the four cathodes of the four LEDs to whichever color you desire. That's for parts and wiring!


----------



## Dwight Ennis (Jan 2, 2008)

I think that you are over thinking/complicating this.I think you're right, so I came at it from a different angle. After looking at it for a while, it dawned on me that the two left-side LEDs are always the same color for a given position of the right-side switch machine contacts, and the two right-side LEDs are always the same color for a given position of the left-side switch machine contacts. So instead of having to wire each pair of LEDs through both sets of contacts or ANDing them together, I came up with a way to wire them using only one set of contacts per switch machine. So I believe I've solved my own problem unless someone finds an error in the following.

Thanks for the feedback guys.


----------



## toddalin (Jan 4, 2008)

A potential error. On all of the bi-color, 3-leg LEDs that I have/use, the + is the common leg, not the -. Makes for some interesting wiring on my 555 circuits that use a common ground/-.

Also, I didn't recognize that the contacts shown were free to use and not already in use. If that is the case, and you have a problem with your wiring, you could use those contacts instead of changing out your dpdts to 4 pdts that control the tortoise (gotta love it) machines, wiring them as I described before.


----------



## Dwight Ennis (Jan 2, 2008)

Thanks Todd. I intend to check one of the diodes before proceeding to see if they are common anode or common cathode. If the former, I'll just reverse the pos and neg, but the wiring will be the same. I intend to use the contacts on the Tortoise machines as they aren't being used for the frogs (I have a Hex Frog Juicer for that on the double slip and the crossing). Thanks for the advice.


----------



## SD90WLMT (Feb 16, 2010)

Hi Dwight, 


Guess my mind just thinks different.... 

The item I noticed in your nice schematics are dpdt swithes, with the toggles running side to side. ....or East & West in direction.. 

Now IF...the toggles run vertically, even the toggles will give clear indication of what combination of flow has been selected. 

Ie.... the left is down 'n the right is up. means a straight run thru... 
So using the LED's provides duped indication also... 
And it LOOKs cool 2!!!!! 

Dirk


----------



## Dwight Ennis (Jan 2, 2008)

Yeah, I guess I wasn't clear that the DPDTs are the contact sets on the switch machines, not toggle switches. Never thought of using the toggles as indicators in this instance even though that's what I'm doing everywhere else. I guess I never realized the correlation until you just mentioned it. At any rate, the panel is already drilled for the LEDs and the LEDs are already purchased, so I guess I'll just trundle on in the same direction. hehehe


----------

