Skip to main content

I currently have a turntable with15 stubs.  The controls for it are on my control panel which has a drawing of the stubs. On each stub line I have both a mini DPDT switch connected to a bi-color led that I use to manually turn on/off power to that stub. The bi-color led is red when no power and green when on. 

I am rewiring the layout and I would like to eliminate all these switches and use a rotary switch instead.  I would still like to have a bi-color led on each stub.

What I need for the rotary is:

- capacity for 15 positions

- has the functionality to change rotary positions without applying power to each stub as I turn the rotary from i.e., position 4 - 7.  I do not want the rotary to apply any power to positions 5-6 but only when I reach position 7.

- I still want to have individual bi-color leds for each stub that hopefully could be triggered from the same rotary switch.  I hope this makes sense.  I just don't know enough about rotary switches and terminology to know what to search for to accomplish what I am trying to do.

Note - I have both an old school type control panel that I use in addition to using DCS/AIU for control  I want to continue to have the ability to operate either from the control panel or using DCS.  

I am open to any alternative solutions.  It does not need to be a rotary switch.  One solution I thought about using was a flat touch digital keyboard connected to an arduino microprocessor.   While that would be a fun project it would be unnecessarily complicated. 

Thanks,

Ed

Original Post

Replies sorted oldest to newest

1. Is your present use of Double-pole switches such that one pole switches track power and other pole switches LED color?  Or are you using the two poles to switch both center and outer-rails to completely isolate the stubs?

2. You say, "I want to continue to have the ability to operate either from the control panel or using DCS."  So are the 15 stubs presently under AIU accessory output control...and if so do you have external relays (external to the AIU)?  With this method do the red/green indicators still work and if so how are they wired in?

3.  I can understand how a touch-panel might be unnecessarily complicated, but are you comfortable wiring up and writing sketches for the Arduino?

Last edited by stan2004

Gregg,

That is a possibility.   I wonder how that works when you are in DCS command control. All power to the stubs is normally off.  What happens when I select a stub via the rotary that has a PS-2 engine on it and  the stub gets turned on with 18v. Will the system automatically detect a command engine and start up in that mode.   I will have to check that possibility out.

 

Stan,

1. The DPDT is currently being used to toggle power on and off as well as changing led color.

2. I currently do not have any of the stubs wired to the AIU.  My plan was to have the AIU trigger relays that opened and closed power to the stub.  I have not gotten that far along with that portion of the project to know exactly how it needs to be done along with the led indicators.  I do have most of my switches programmed however I need another AIU to finish those.

3. As for the Arduino.   I spent a good part of my career developing software.  Admiddedly that was a long time ago.  I have since experimented  with writing sketches.  More accurately,  I have experimented modifying existing sketches to accomplish what I wanted.  But  if that doesn't work for me then I have a nephew who is an IT guy capable of writing sketches.  Since he is in line to inherit most of the trains I think he will most happy to help me out. 

But I am still thinking it is overkill for the task.  

Thanks all for the help

Ed

Gregg,

That is a possibility.   I wonder how that works when you are in DCS command control. All power to the stubs is normally off.  What happens when I select a stub via the rotary that has a PS-2 engine on it and  the stub gets turned on with 18v. Will the system automatically detect a command engine and start up in that mode.   I will have to check that possibility out.

 

The engine will start  up in conventional mode just the same as if the engine was parked on a toggled off siding.

However if you  can dedicate  a tiu  channel to the turntable /shop area,The toggle  could go on the input side of the tiu channel and each time it's turned on the watch dog signal would go out keeping the engine silent. It's also a good place to park a lash up. They have to see the watch dog. (yes there is a work around)

To select an engine... select the track with the rotary. then power up with the master toggle which now also controls the watch dog.

Last edited by Gregg

Radio Shack makes a 12 position single pole rotary switch.   15 position is a lot!    And a single pole would not activate the LEDs.   There  used to be some around in the old days that had multiple banks on wafers for each position.  

In either case, I don't know of any that do not power each position as you rotate the switch.    I am not an expert on this however.   It does seem like 2 switches, one for the power and one to rotate might be needed.

On my layout I have 18 positions, and I just put a small on off toggle on each one.    You would probably need a double pole toggle for each one to do that.

 

 

http://www.electronicsurplus.c...contacts-2pole-18pos

This is probably a low-current rated switch, and you would be advised to contact the manufacturer or distributor to determine the actual current rating. You might need to add a relay to each output lead.

Note that it is also a shorting switch, so using a separate master on-off in series with the feed to this switch is imperative to avoid two spurs being activated at the same time as you turn the switch. 

 

Last edited by Arthur P. Bloom
Gregg posted:
...

However if you  can dedicate  a tiu  channel to the turntable /shop area,The toggle  could go on the input side of the tiu channel and each time it's turned on the watch dog signal would go out keeping the engine silent...

This seems the simplest/straightforward method.  However, the 2-step process, 1. select track w/rotary, then 2. throw track power toggle Gregg describes might get a bit awkward in the DCS-remote scenario.  That is, step 1 could require multiple button presses to move thru the DCS-remote menu to de-select the old stub...then select the new stub from 15 choices.  Step 2 would again require navigating the DCS-remote menu to find the accessory port which toggles power to the TIU input.

Dropping to a 1-step process (where you only need to select the desired stub) is where the Arduino could be of assistance.  As you say, "overkill" comes to mind, but an Arduino could detect a change in rotary switch position, then instantly kill track power, then wait until the rotary switch settles on a stable position, then re-enable track power to send out the DCS watchdog.  Relays would be involved but you've probably seen the eBay multi-relay modules which work out to less than $1 per relay (10 Amp SPDT relays).

Untitled

Separately, if I understand your wiring configuration correctly, using relays may eliminate the need for double-pole switching (one pole for switching the actual track voltage, other pole for switching red/green LED voltage). 

In any case, I suggest first settling on the power switching issue first...then dealing with the red/green indication issue later.

Attachments

Images (1)
  • Untitled

 That is, step 1 could require multiple button presses to move thru the DCS-remote menu to de-select the old stub...then select the new stub from 15 choices.  Step 2 would again require navigating the DCS-remote menu to find the accessory port which toggles power to the TIU input.

 

You lost me Stan..... I would only  use the remote to start up the engine..

..The toggle would supply the power to rotary to whatever track selected   with the dcs  watch dog signal. No remote or aiu  evolved for that.

Gregg,

I'm describing the case where Ed would control the selection of stub using just the DCS-remote (via 15 AIU outputs).  In other words there is no rotary switch.  Likewise, in this scenario I'd assume there is no separate "master" toggle switch.  So this function would also be under control from a 16th AIU output.  Navigating the DCS-remote menu to deselect, select, enable, etc. when there are 16 ports might be tedious?

Or I at least I thought that having "everything" under DCS-remote control was in the picture. 

Arthur P. Bloom posted:

... i guess you need to use a relay on each output lead, as I mentioned as an option.

Yup.  Dual-pole 15+ throw high-current switches are insanely priced...over $100 from what I can tell.  I think relays are looking to be part of the solution.  The dual-concentric rotary might be a hassle to work with to find a "single" knob to use just one of the switches...but the price seems right.  I found this single-pole eBay rotary which might have a shaft for which it's easier to find a mating knob.

Untitled

A bit more expensive but I guess the point is there are rotary switches out there that should work in this application if willing to go the single-pole option and use relays.

I figure one idea would be to get at least a 16T switch so that the extra position could be used to put it into AIU remote mode.  In other words a rotary switch position which does not activate any of the 15 stubs...so this is the position to set the rotary when going to DCS-remote mode where the DCS-remote selects the stub via the AIU.

 

 

Attachments

Images (1)
  • Untitled

First off thank you all for the great discussion of various solutions.  I already learned a lot from  the input.   

It's pretty clear that doing what I wanted is a tad more complex than I envisioned.  (This has become the norm for me).

Although a good idea, I do not have a TIU channel to dedicate to this project and I really don't want to buy another TIU just for this.  

If I understand this correctly,  I need to use relays along with the rotary switch to operate the stubs.   As Arthur has stated dual pole rotary switch prices are pretty crazy.  Since I will have to use relays anyhow, I think I'd like to go the  arduino route using a touchpad to select and activate the associated relay for each stub. I would not use DCS for any control of the stubs.   I already have an Arduino and a dozen relays.  The only outlay would be for more relays and as Stan pointed out the relays are very cheap.  The big attraction to me is it would be much easier to use the numeric touchpad to select and activate the associated relay to power to stubs on/off.  Seems like using the touchpad to activate stubs would be a lot easier than scrolling thru multiple menus and options on the handheld.   Not using DCS also eliminates the need to purchase an additional AIU that I would need to handle all the stubs. 

Thanks,

Ed

 

 

So as I understand it, you don't have a TIU channel you can dedicate to the turntable stubs...and will have the Arduino enable 1 of 15 relays to apply an already "active" TIU output to a stub.  Since this will not automatically apply the watchdog, the accepted practice is to immediately send a DCS command to signal the PS2 engine on the stub that it should power up under command control (i.e., be silent until started up).  Without this command (or the watchdog) the engine will start up in conventional mode with sounds, lights, etc..

As this is a discussion, there is another somewhat amusing practice used by some guys.  Since you have an Arduino controlling relays, whenever you activate a new stub, you can have a relay temporarily attach an MTH DCS Remote Commander (DCSRC) base to the track voltage. 

dcsrc base

The DCSRC base generates a DCS watchdog signal when it initially receives power.  In this way your PS2 engine will startup in command mode without needing to quickly grab the DCS-remote to send a command.  So the Arduino would momentarily enable a relay to power the DCSRC whenever a new stub is activated.  The DCSRC would generate the watchdog which would keep the PS2 engine silent and in command-mode.  The Arduino would then disconnect the DCSRC after, say, 5 seconds.  Now you can "leisurely" reach over, pick up the DCS remote, start up the PS2 engine, and carry on.

This probably only makes sense if you already have a DCSRC lying around from a Ready-to-Run or DCS Starter set; or I think you can find a used one fairly cheap on eBay.  May seem like it's from the Twilight Zone but if you already have a DCSRC and the Arduino is in control, your out-of-pocket would be another $1 relay!

Attachments

Images (1)
  • dcsrc base
Last edited by stan2004

Stan,

I actually do have a DCSRC left over from a RTR set sitting in a box.  That really is an amusing solution to getting it powered up in command.    I would never have thought about that idea in a million years given my lack of expertise.

I am going to go that route.  

Again, thank you, and everyone else for all the ideas.  It is much appreciated.

Thanks,

Ed

 

Yikes, This is much more complicated than it should be... I don't understand why you would need relays with the rotary . If it is  because the rotary can't handle the current then  buy one that will . I would think it would be still cheaper than buying 15 relays.

The only reason I mentioned putting the toggle before the tiu channel  was to get the "watch dog"   however the toggle can go  on the output side . This way the channel is not tied up to the shop area and other trains can operate as well on the same channel.

Anyway.. I like Stan's  DCSRU thing idea... Lets us know how it goes ED....

I'm curious how much  "watch dog" dcs signal it puts out compared to a tiu channel. Hopefully the same??

PLCProf posted:
Gregg posted:

Yikes, This is much more complicated than it should be... I don't understand why you would need relays with the rotary . If it is  because the rotary can't handle the current then  buy one that will . I would think it would be still cheaper than buying 15 relays.

 

I think a plain old 3 amp rotary switch would be fine. This is about turntable stubs, you are not going to do anything more than move one engine very slowly for a short time, and with no load! The biggest current draw will be the smoke unit! 

That is exactly what I do. A single 12 position 3 amp rotary switch for turntable tracks and another for the adjacent yard tracks; with a 2 position center off toggle to apply power once the correct track is selected. No fancy LED's or lights to detect when power is on; if the engine starts up it has power! If its a DCS engine I then just start it up from the handheld remote. Has worked great for over 15 years. The KISS principle.

Rod

Ed Walsh posted:

...I am open to any alternative solutions.  It does not need to be a rotary switch.  One solution I thought about using was a flat touch digital keyboard connected to an arduino microprocessor...

Assuming we're still discussing alternatives, here's another idea IF an Arduino or similar is in the picture.  Rather than a keypad to select the stub, you could use a so-called incremental or quadrature rotary encoder.  As with the keypad, you need relays to switch the actual high-current track voltage to the selected stub.

quadrature encoder

An incremental/quadrature encoder like this has only 2 digital outputs that the Arduino can decode to determine position.  The switch might have, say, 20 detents or positions per revolution.  The Arduino would track the actual angular step and indicate it using the red/green LEDs.  

Since the Arduino "knows" when the rotary switch position changes, it can control the extra relay that disables/enables track voltage to generate the watchdog signal via a DCSRC.

While DCS-remote operation of stub power may be over-the-top, the incremental encoder introduces a curious twist which might make it practical without having to come up with 15 or 16 AIU additional ports.  Here's how.  The Arduino would be controlling the 15+1 relays anyway.  (15 stubs, 1 master power).  You could use just 1 AIU switch port to tell the Arduino to rotate the virtual switch CW or CCW.  So practically speaking you navigate the DCS-remote to an AIU switch port labeled "Turntable" (or whatever).  Then repeatedly press the Straight or Turnout button to increase or decrease the stub number in the same way a rotary switch increases or decreases the stub number with each click.   This is vastly simpler that navigating the DCS-remote to select and control 16 AIU accessory ports!  As before, the Arduino would instantly kill track power using the 16th relay as soon as a change was detected.  And then after the Arduino detects no activity from the single AIU switch port for, say, 2 seconds, it would re-enable the 16th power relay and the (optional) DCSRC could generate the watchdog.

In my defense, you did say "I am open to any alternative solutions."

Attachments

Images (1)
  • quadrature encoder

Stan,

I am always amazed at all of the things I know absolutely nothing about, i.e. "Incremental Encoder Module" until reading your post.

That is a great alternative and actually solves a couple of issues with using a keypad.  I always wanted the stub control placed on the part of the control panel that has the round table mapping.  The keypad presented a couple of problems. Mainly it was looked too large on the control panel given its size.  The other issue was routing the necessary cable thru the control panel and extended about 3 feet over to where the arduino will be placed in the control panel. The biggest plus is that the module only takes up 2 input pins on the arduino.  I haven't worked out yet, the practical side of the arduino triggering 1 of 14 stubs.    I'll work on the input side for now.

As others have  already said, there are easier, less complex ways to accomplish this.  Truth is I think this will be both challenging and fun to implement, fun being  the big attraction.

Thanks,

Ed

GRJ, not sure I agree it's a problem as long as Ed uses a "round" knob rather than a "pointy" knob.  That is, he only needs to look at the red/green LED indicators which are presumably placed in a circle somewhat representing the potential turntable positions.  One of the lights will always be "green" indicating the active stub.  When the system is first powered up, all the lights can be "red" indicating no active stubs with the Arduino not driving any stub relay.  The sketch can initialize its internal active stub to any of the 15.  So as soon as he starts clicking the knob CW or CCW, one green LED can turn on and go from there. 

In fact, IF the Arduino is put in control of driving the red/green LEDs, he could write the sketch to turn an LED yellow (by driving both red and green) during the settling time when the rotary encoder is clicking CW or CCW to indicate the "tentative" stub before the relay is actually activated for the stub.  Then when the relay is finally turned on and actual track power is applied, the LED would turn from yellow to green. 

With an Arduino, the possibilities are endless.  As Ed says..."fun being the big attraction."

Ed Walsh posted:
... I'll work on the input side for now.
Wire management and avoidance of a spaghetti jungle is indeed an issue with control panels.  After you sort out the "input side" on selecting the active stub, I figure you'll move on to the output side.  Earlier I alluded to the concept of one-wire selecting from red or green in the bi-color LED.  I assume from you were using the double-throw feature of your DPDT switches to select between red and green...in other words two-wires.
 
The "starve the green LED" method is nothing new in model railroad electronics commonly used in turnouts to light up either the red or green LED using one control wire.  This takes advantage of the different voltage of green LEDs (~3V) and red LEDs (~2V).  It's been discussed many times on OGR so I won't repeat the explanation.
 
The new idea relevant to the current discussion is to generate yet a 3rd color if the Arduino gets to control the red-green bi-color LEDs.  Using a single "digital" control wire from an Arduino to a bi-color LED, you can generate red, green AND yellow.  Here's a short video showing the concept:
 
In the "starve the green LED" method, the bi-color LED is normally green.  Adding a single control wire as shown in the video enables red or green; the added control wire is slowly alternating between 0V (red on) and 5V (green on) simulating what would come from an Arduino digital output.  By increasing the frequency of change, the red and green eventually "blend" to make a solid yellow and no one's the wiser that it isn't just a yellow LED!  So from a single control wire going to the red-green bi-color LED, you can generate red, green, AND yellow.
 
So what and who cares?  Well, even if you don't use yellow, this can simplify the mess of wires going to the control panel (15 instead of 30 wires if you were presently running separate wires to each stub's bi-color LED).  But if experimenting with the Arduino is part of the fun of the hobby, here are two ideas:
1. As you said, you want the 15 stub bi-color LEDs lit red for stub off and green stub on. 
When rotating the switch (whether a conventional rotary or an incremental encoder), the Arduino can light the "tentative" LED yellow to show the stub that is about to turn on if you don't move to a different stub within 1 second (or whatever).   When the Arduino actually powers up the stub, then the LED turns from yellow to green.
2. To Gregg's most recent point, if the Arduino is in control of the stub power relays, a yellow LED could be used to show the stub under control.  A momentary on/off button would be added to toggle the power to the stub under control.  When the rotary knob is changed, the yellow LED would move to show the new stub under control but the previous stub would remain on/off (green/red).  This means you can have any number or combination of stubs on at a given point in time.

 

Last edited by stan2004

Stan,

One of the man reasons I am re-wring the layout is that up until now the track plan such as it is, has been in a state of change while I was trying different things.  Those changes also required a bunch of wiring modifications and I knew the wring would need to be redone once everything was finalized.  Saying my current wiring is a spaghetti jungle does a disservice to all other spaghetti jungles. So eliminated wires is always a great idea.

There have been so many great ideas that frankly I am a little overwhelmed sorting thru them.    I am going to go with the arduino solution.  I am sure I will have more questions but first I need to get myself educated on some of the suggested ideas and components. 

A BIG thank you to everyone who contributed ideas and suggestions.   I have learned a bunch just reading the ideas.

Ed

 

 

 

Gregg posted:

 

Food for thought... Toggles will allow having more than one track  powered up at a time including the turntable deck.  Can you do that with a rotary?

 

Well no, you can't actually. But why would you want to? After all, this is a toy train layout. I don't need a steamer "firing up" for hours; 10 seconds or so is just fine. And I can only move one engine at a time onto and off the turntable. Same with the yard; I only need one siding live at a time. So a rotary switch works just fine. But each to their own. To me, keeping it as simple as possible has merit, and makes troubleshooting a bunch easier. But that's just me.

Ed, we will all be interested in how the Arduino project works for you. Please keep us posted.

Rod

Rod,

I will definitely update this post as I move forward.  

 I first have to educate myself on the "how-to" side for some of the components and ideas folks have provided.  I have ordered some of the parts so I can see which works best for me. 

While some folks would have a perfectly good reason to have more than 1 stub fired up, I simply don't need that capability.

Frankly my brain can only deal with 1 loco at a time.   When the kids are over and I run 4 or 5 trains at once my eyes begin to glaze over after a minute or so.  

Fortunately I have found there is a mediicinal component of Kentucky sour mash that eliminates the eye glazing problem.

I am going to try and keep this project as simple as possible from the start.  I have no doubt that complexity will follow.

I am so grateful for everyone's help.  I am always amazed at the depth of member's knowledge and willingness to help.  That's what makes this forum a great place.

Thank you,

Ed

Rod Stewart posted:
Gregg posted:

 

Food for thought... Toggles will allow having more than one track  powered up at a time including the turntable deck.  Can you do that with a rotary?

 

Well no, you can't actually. But why would you want to? After all, this is a toy train layout. I don't need a steamer "firing up" for hours; 10 seconds or so is just fine. And I can only move one engine at a time onto and off the turntable. Same with the yard; I only need one siding live at a time. So a rotary switch works just fine. But each to their own. To me, keeping it as simple as possible has merit, and makes troubleshooting a bunch easier. But that's just me.

Ed, we will all be interested in how the Arduino project works for you. Please keep us posted.

Rod

It's  nice to be able to charge a engine's battery occasionally on another stub track or be able to turn off power to the turntable deck in case of a derailment. .

I'm not trying  to convince anyone one way or the other and have used both methods.  

The rotary also  pretty much guarantees a good dcs  signal as it only has to supply the signal to one track.

Looking forward to ED's project.

 

Gregg posted:
...The rotary also  pretty much guarantees a good dcs  signal as it only has to supply the signal to one track...
This is an interesting point.  If using the relay method - and depending on the placement of the control panel relative to the turntable - the size of the wire bundle carrying track voltage can be reduced.  That is, if the rotary switch carries actual track voltage, then a bundle of heavy gauge wiring must run to/from the control panel.  Of course this potentially long wire bundle also carries the DCS signal.
 
OTOH if using the relay method, presumably the relays would be placed close to the point of use.  So now the wire bundle to/from the panel carries low-current "control" signals rather than high-current "power".  And these control signals would not have the DCS signal on it.

 

Just to throw something out there, if using an Arduino, or similar, to control things, you could instead use two arduinos.  One in the control panel to take input from the rotary switch and/or DCS, and to run a display of some sort.  Then a second located at the turntable that controls the relays.  doing this you would need only 2 wires for track current running to the turntable, and 2 low current wires sending data back and forth between the two Arduinos.  No huge bundle of wires needed.  

JGL

gunrunnerjohn posted:

Cranking up the complexity of the system a bit there JGL.

Not really much more complex, really.  in one case you have a single Arduino reading inputs, and when they change, sending new outputs to the relays.  In the other case, instead, you have one Arduino reading inputs and sending commands out with a serial command, then a second Arduino that is reading incoming data from the serial and changing relay outputs when you it receives commands to do so.  The wiring is easier, less messy, and less expensive.  On the other hand you'll need to add a dozen lines of code to your sketch.  

If you want "complex" if someone were to hire me to build a turn-key solution, I would use an inexpensive 2.4GHz transceiver  between the relay module and the 'control panel'  In effect I would build a box with LEDs for each spur to show if they are powered or unpowered, and if the knob is currently set to that track.  there would be 2 more buttons marked on and off to toggle power in whatever spur is selected.  (A simple version that only can power one spur at a time would not need the buttons.)  You could stuff battery in the controller and make it completely wireless if you wanted.  

I'd probably also add a 99 cent RS-232 module and a set of cables that would allow control from both TMCC and DCS by tricking the systems into thinking the control box is a TMCC engine.  Depending on the set up already in place there is little reason not to index the turntable as well, but that actually does get complex-ish.  

I love when solutions are more complex Fun!

JGL

Realize that the rotary may be the weakest link if you are running track voltages through it.  If you draw excessive current (two engines or full lighted passenger set etc) or have a short, the switch contact spring(s) can become warm/hot over time and lose their tension.   Hassle to replace switch.  Better solution are relays.  I have plug in 10A relays that I can turn on or off for sidings or unplug for trouble isolation.  If relay contacts should fail, I can replace it.  I see relay boards above but assume relays are soldered in, which is better and you could replace a bad one, assuming the solder pads don't lift/vaporize in unsolder/solder process.

Add Reply

Post
×
×
×
×
Link copied to your clipboard.
×
×