# Automatic train switching? Is this possible?



## [email protected] (Dec 8, 2009)

Hi folks, I am new to the hobby and I am currently planning a shelf/ceiling O scale layout that will travel through 3 bedrooms and a closet. I was thinking about unique ideas for this, and was wondering if the following idea can be wired up and how one would do it:

Basically, can you create a bypass section using a couple Y switches where one side is powered and the other insulated until the switch is thrown? And if so, can one of those "infrared activation units" be used to activate the switches? So then you could have one train drive onto one side, and when it reaches a certain point it would activate the switches and switch power to the other side? Thus, you would have 2 different trains running the layout alternately without user input. 

I thought it would be neat to have the train enter the closet section, and then a different train comes out the other side. 

Please let me know if something like this is possible or not. Like I said, I am new to the hobby and just brainstorming right now. 

Thanks!
Rob


----------



## tankist (Jun 11, 2009)

welcome!

i don't see why not. 100% possible


----------



## [email protected] (Dec 8, 2009)

tankist said:


> welcome!
> 
> i don't see why not. 100% possible


Thanks for the response! So, next questions then : 

- How would you insulate the one section of track when the switch is thrown to the other side?

- Is there any harm in killing power or applying power abruptly on these engines? Will it just get a litte bit of wheel spin or is it bad for the engine? Because switching power from one side to the other would then start the engine up at like 1/2 power or whatever we have it set at.

Thanks,
Rob


----------



## tankist (Jun 11, 2009)

there is such thing as insulated rail joiners. they are plastic and as the name implies any 2 sections connected with these will not share power.

perhaps not to bad but i don't like "abruptness" you speak off. if i ever to do layout automation i would build something like this:
http://home.cogeco.ca/~rpaisley4/AutoStop.html

since you were talking throwing turnouts automatically too, you might as well be interested in Robs (well, he says his name is Rob as well, lol) section about detection ...
goodness, for some reason i can't find it this morning... 

well look through his site, he has lots of interesting ideas


----------



## rob_camp[email protected] (Dec 8, 2009)

tankist said:


> there is such thing as insulated rail joiners. they are plastic and as the name implies any 2 sections connected with these will not share power.
> 
> perhaps not to bad but i don't like "abruptness" you speak off. if i ever to do layout automation i would build something like this:
> http://home.cogeco.ca/~rpaisley4/AutoStop.html
> ...




Thanks for the link! I love this auto-slowdown circuit you linked here. That could certainly solve one part of the equation. 

OK, so I am not seeing this in my head...how would you use these "insulated rail joiners" to insulate one section of track from another and be able to switch the section being powered?

Just so we are on the same page here, this is what I am thinking in my head:


```
__x______a_____A____x_
-------<__x______b_____B____x_>------
|     1                        2    |
|                                   |
|                                   |
-------------------------------------
```
- Train travels through switch 1, enters track section a, and reaches point A. 
- Hitting point A triggers both switches 1 and 2 to change position, as well as switching power to track section b, where the second train sits and will then take off and run the circuit.
- Vice versa when train completes loop and re-enters track b.

I am assuming this insulated connector would go at points (x), but how would these sections be turned on and off?

Weird, this sounds super simple and complicated at the same time to me 

Thanks again! 
Rob


----------



## Reckers (Oct 11, 2009)

Rob,
I'm an acknowledged dunderhead at electronics, but the bigger problem seems to be how you hide an entire train in your closet. *L* For example, if you used two transformers, T1 and T2:

E1ooo> E20000>
------------A----------------------------------------------------------------B-----
T1 T2 T1


Transformer 1 powers the main part of your railroad. Transformer 2 powers only the part in the closet, between A and B. Infrared switches are at A and B. As engine 1 (moving left to right) reaches point A, the switch powers up the T2 segment and E2 moves forward. When E2 ceases to block the switch at B, power to T2 is cut off and E1 stops. T1 is always on; T2 is only on when both switches are blocked. Is that doable? Of course, you still have to find a way to hide the full length of that T2 section in the closet, and time it to get all of E1's cars onto T2 before it shuts down by E2 leaving.


----------



## Reckers (Oct 11, 2009)

For some reason, my E2 engine keeps backing up to the E1 unit in the message. It should be over by B!


Grrrrr! And T2 belongs between A and B....


----------



## tankist (Jun 11, 2009)

the way i see it you will have 3 independantly powered blocks:
1. block A
2. Block B
3. the rest - directly powered.

or instead of isolation you can just use power routing turnouts, such as peco-insulfrog. they will make it so the only powered section is the one set. 
so train goes around , pulls into its siding, sensors detect it and stop it. then some sort of devise detectes no power on rails and flips both turnouts for the other siding. when power is gradually resotred the other train will move since now its the other siding that is getting power.

so now you need some device that will trigger upon power outage. perhaps pair of relays on each line, charging capacitor when power present and releasing its charge through coils of both switch machines as soon as power gone. other options obviously exist

with that said, i don't think such layout will be interesting unless it is unattended display in some store, or something


----------



## T-Man (May 16, 2008)

The problem is a little advanced. You need to decide on your track and transformers. Most switches have auto derailing. You need to decide between three rail and the newer two rail track because they take different cars.
You will need a track detection circuit tied to a relay. You may want to get it working on a ping pong table before it goes in a closet.
After doing a reverse circuit, It will not be easy.


----------



## [email protected] (Dec 8, 2009)

tankist, thanks for the ideas. And yes, this is meant to be a mostly unattended display which will run on a shelf near the ceiling through both my kids rooms. This idea would just make it a little more visual with a switch between 2 different trains running the circuit. 

t-man, I guess I should have mentioned the hardware I am going to be using. I have on order a new MTH PS2 steam passenger train and I will be using Realtrax track. The set comes with a 100W transformer. And yes, I will certainly be setting up and troubleshooting the layout in the shop before installing anything in it's permanent location.

So how do these insulated track sections work? You apply power to a separate section of track, and then the train just bridges the gap to travel from one section on the track to another? Is that the idea?

Can I power both(or 3) sections of track with the same transformer, just using some sort of switch or circuit inline to alternately cut the power on the bypass sections?

Thanks!
Rob


----------



## T-Man (May 16, 2008)

So three rail and AC power it is. I am no real trak expert but all you may have to so is pull the pins to insulate a section since it snaps together. A picture of the end of the track section would be great. Each section has it's own feed. You can keep your grounds commected but the center rail is the key. Now with that feed line it will be tied to a toggle. When you go auto it will be a relay. Next you need to figure out how your switches work. Then attach them to a relay. Gee and you even haven't got to any electronics yet. You may have to go with four switches instead of Y's. They may not make them.
For track detection consider a magnet on the train and a reed switch on the trak. For the most part I can only suggest having never done it.


----------



## tankist (Jun 11, 2009)

doh, O scale again... i guess plastic isolators don't apply.
but then Tman, is there such thing as power routing turnouts for o scale? if so, no need to isolate anything, as as soon as train triggers both turnouts to choose the second route it suddenly finds itsel on unpowered section.

i;m sure turnouts can be modified to be power routing...


----------



## Reckers (Oct 11, 2009)

If he used vintage S scale, he could just tell the hamster when to start and stop the train. Those guys work for peanuts, too.


----------



## T-Man (May 16, 2008)

Anton. You are saying just have a relay operate off the switch? For power it may be better just to have one track section shut off so when the engine gets there it stops. With track detection the relay would start the other train.

Two problems exists. Direct the train path, then stop the train and start the other. By moving a switch is too early in the process for my logic. To me it has to be ready for the approaching train after the second one leaves.
Just an idea How would the power routing work out?


----------



## [email protected] (Dec 8, 2009)

These are some great ideas guys, thanks, and keep em coming!

How would these power routing switches work? I don't see anything like this for Realtrax, unless I am not looking hard enough. Is it possible to take a normal remote switch for Realtrax and somehow modify it to be a power-routing switch? If so, is there a tutorial out there on how to do it? 
Also, to create this parallel track section, what is the closest I can get 2 trains to each other? Do I use an O72 Wye switch and the O72 turns back to make it parallel? Or just normal switches and have the one side curved? O72 for these? 

Looks like I have a couple steps to work on to make this happen:

- First Set up the switches and parallel track sections, and modify them into power routing switches. I think this would allow me to be able to do the train switch manually by just stopping the train at the right spot, flipping the switch(es), and the bringing power back up to start the other train. Obviously need to be careful of train location when switching.

- Next, work on automating this process. Use track detectors to somehow automatically flip the swicthes, thus switching trains. At this point, make sure to keep the trains going slowly so the abrupt stop/start of power is not too bad.

- Finally, integrate something like the auto-slowdown-stop-startup circuit mentioned earlier into the process to slow and stop one train, flip switch, then soft-start the second train.

Now that I see what would have to go into this, I may want to move this section of track out into one of the rooms so I can watch this magic happen instead of hiding it away!

-Rob


----------



## tankist (Jun 11, 2009)

T-Man said:


> Anton. You are saying just have a relay operate off the switch? For power it may be better just to have one track section shut off so when the engine gets there it stops. With track detection the relay would start the other train.
> 
> Two problems exists. Direct the train path, then stop the train and start the other. By moving a switch is too early in the process for my logic. To me it has to be ready for the approaching train after the second one leaves.
> Just an idea How would the power routing work out?


we already established (or so i think) the use of the slowdown/ramp-up circuit for soft start and stop. directing the train path (switching the active platform) only needs to happen when both are stopped (at station). so i was thinking about some separate circuit that will detect power loss (or power resoted) and will trigger the turnout upon it. perhaps it can be a simple latching relay, solenoid of which is powered from mainline tracks, but then it need to be made so starting voltage of that solenoid is lower then that of train so the turnout switches first. or something solid-state and bit more elaborate (i don't like mechanical solutions).


----------



## tankist (Jun 11, 2009)

[email protected] said:


> How would these power routing switches work? I don't see anything like this for Realtrax, unless I am not looking hard enough.


i have no idea how this works outside of HO world (same goes to your parrallel track question). but the concept is that turnout is powered from facing end and both streight and diverging routes depend on this supply (no direct power lead for them). depending on which route the turnout has selected, only that route receives power on both rails (or 3r rail, dough, we talking O here).


----------



## T-Man (May 16, 2008)

Rob
these are completely hand built. If you want to look at some off the self items read up on auto Blocks. This allows two trains on one track, one engine stops the other before they colide. You want the opposite effect, you want to start another engine and have the trigger engine stop.


----------



## [email protected] (Dec 8, 2009)

OK, so I went to the train store and bought 2 Realtrax turnouts and started looking at the documentation. 
In the documentation, they have a wiring concept that is part of the equation here. It says to remove the outer rail connector on the switches, and thus create 2 insulated sections of track off the main line. These 2 sections get connected to the transformer through a double-throw switch, which will allow you to toggle which side of the turnout gets power. Then they say to parallel the turnouts so they can be thrown at once. That's fine and good, but it still is a 2-step process of turnout switch, and power switch. So how would I connect the turnout switches to the power-routing switch to both flip the turnout and power with a single throw? Some sort of relay (terminology?) to trigger a momentary switch when power is applied? I am pretty electronically inept, so I am not sure what to look into.

Agsin, thanks for the help folks!


----------



## T-Man (May 16, 2008)

I read the Lionel version and their switches connect to their DCC setup. Somaybe they can program a switch to work. MTH may have the same setup. I have never done this before. I can only guess what to do. Just so that you understand. You can try and find a momentary relay that would work. SO you activate one relay and then that activates the momentary one. Or see if youcan build an actuator like Anton is going to do. I did copy the MTH manual.This is very specialized to the product.The problem is that the plan is not made.


A thought, if the closet is in the middle why can't you have two trains running. One on each side in a loop with the siding in the closet. One gets to the closet and waits for the second to pass through. Technically they run in opposite directions.This could be done mechanically with track connectors and block signals. MTH must have something like this. My specialty is Lionel. This would reduce your problem to stop the first train. Detect the second train. Determine how you want your switches to work. They are partiallly auto matic anyway. If the switches are rigged opposite they will never collide. Let the auto do the work when the train leaves the switches switch. I think this is the simplest way.


Going back to your first plan the two switches are rigged to feed inner or outer sidings.
Train A is in the outer and goes out. Auto features works and the the other switches to outer position for the return. Train returns activates a relay to killa section of track ahead and powers the other siding. Train a stops. Train B starts AUto derail works,second switch readies for return, and train leaves and returns to inner loop. Activates same relay to kill power ahead and turn on outer loop. Train B stops and A starts and a loop is born. The relay is 12 volt DC to operate unless a simpler contact exist. If the system fails the same train keeps running.


----------



## [email protected] (Dec 8, 2009)

Couple updates on my layout progress:

- Got the train set delivered friday and was able to bench test it a lot this weekend. What I found out:
- Wow, this is a beautiful train, and feels like a tank! Long way from the starter HO set my son has. Very impressed with the quality and 

packaging.
- The engine itself already handles the soft-start and soft-stop duties nicely, so building extra circuitry for that purpose will not be 

needed. A little simpler! Also, I can lock the train into Forward so I will not need to power up and then hit the direction button to go.
- The included MTH layout software was invaluable in helping me layout track lengths and curves to get my 3-room layout planned out. The interface is little weak, but having all the pieces to trial-and-error the layout saved me a ton of time putzing with track pieces at the store. To get the siding lengths right with the O42 turnouts, I had to use a combination of 3.5", 5", 5.5", 10", and 30" pieces. 
I can upload an image of my layout from the software if y'all are interested in picturing what I am setting up.

First thing I did is tear apart the Z controller box and remove the buttons and potentiometer. I then soldered wires to each lead for these so 

I can relocate the controls to a nice wall box instead of the plastic Z controller case. Also, this will allow me somewhere to tap into the 

direction button, etc from an automated circuit if necessary. I am envisioning a nice clean Oak inset wall box with a few buttons and a little 

dial for speed control.

T-man : I like your idea about running both trains opposite and blocking, but my layout is not set up like that with 2 separate loops meeting in the middle. Instead, the siding section is really part of the main loop, so I will only be able to have one train out at a time. I did decide to bring this section to my son's room so we can see the parked train and the action when they switch off.

Now I have to learn about relays so I can figure out how to do the track switch along with the power switch and have it driven off of an IR sensor. I think I am starting to understand a little of how this works. The part I am most confused about is how to set up the relay so that when power is applied it switches the SPDT switch to move power to the other side. Seems like the relay to move the turnout switches should be pretty straightforward.


----------



## T-Man (May 16, 2008)

Sounds like you are making progress. I am not an MTH guy ,but general principles still apply. In your reading, look into the block signal.It normally prevents a crossing collision , by stopping one train as the other passes.


----------



## tankist (Jun 11, 2009)

[email protected] said:


> The engine itself already handles the soft-start and soft-stop duties nicely, so building extra circuitry for that purpose will not be
> 
> needed.


what do you mean by that? is the circuit already built in? or do you mean there is enough flyweel momentum to soften things up?


----------



## [email protected] (Dec 8, 2009)

tankist said:


> what do you mean by that? is the circuit already built in? or do you mean there is enough flyweel momentum to soften things up?


Well, it is not the long multistep smooth stop of that circuit we talked about previously, but it will be perfect for the quick yet soft-stop I am looking for.

So basically, if you cut all power to the engine, it smoothly comes to a stop, even playing the squealing brakes sound as it decelerates and going down to the idle noise for like 10 seconds after the train completely stops. This is a function of the protosound system in the tender car, which is run off a rechargeable battery.

Then, when full power is applied from a dead stop, it smoothly accelerates up to speed instead of just spinning wheels and lurching to full speed.


----------



## [email protected] (Dec 8, 2009)

OK, I think I am starting to put this together in my head, but I need to know the terminology for one of the components I will need for this to work. Basically, what will take the place of the physical SPDT switch which toggles power to the 2 sidelines? 

I am thinking that I have the IR activator which will close momentarily, routing the power to the turnout, switching it. 
I also then have some component which will act as the SPDT, switching its output when applied with the short momentary current, but then staying closed on that side when that input current is removed. So basically an electrically operated version of the mechanical SPDT switch. Does this make sense? I don't know what you would call this piece. I assume it is some sort of relay, but the relays I have been reading about stay closed only when the input current is still applied.

Thanks!


----------



## tankist (Jun 11, 2009)

[email protected] said:


> I also then have some component which will act as the SPDT, switching its output when applied with the short momentary current, but then staying closed on that side when that input current is removed. So basically an electrically operated version of the mechanical SPDT switch. Does this make sense? I don't know what you would call this piece.


its called latching relay. quite a cumbersome piece. i wouldn't use anything like that today however, since we are in the age of awesome semiconductor components.

EDIT:
and it sounds like an awesome locomotive you got there.


----------



## [email protected] (Dec 8, 2009)

tankist said:


> its called latching relay. quite a cumbersome piece. i wouldn't use anything like that today however, since we are in the age of awesome semiconductor components.
> 
> EDIT:
> and it sounds like an awesome locomotive you got there.



So what would I use in it's place? Keep in mind that I am obviously a total electronics lackey


----------



## tankist (Jun 11, 2009)

i would use SR or RS Flip-Flop, same thing (google will bring you to this Wiki page) driving power transistors (either darlingtons or FET's, perhaps indirectly) or opto-siolator of proper amperage

in your case however there is a shortcut. you will need something to do mechanical work anyways - a solenoid actuating the turnouts. and if you still don't like my idea of using the turnouts themselves to double as power switches, well, you can always use a micro-switch to read out turnout position.

i would still use a flip flop latch over that solution and definetly over mechanical latch.


----------



## [email protected] (Dec 8, 2009)

tankist said:


> i would use SR or RS Flip-Flop, same thing (google will bring you to this Wiki page) driving power transistors (either darlingtons or FET's, perhaps indirectly) or opto-siolator of proper amperage
> 
> in your case however there is a shortcut. you will need something to do mechanical work anyways - a solenoid actuating the turnouts. and if you still don't like my idea of using the turnouts themselves to double as power switches, well, you can always use a micro-switch to read out turnout position.
> 
> i would still use a flip flop latch over that solution and definetly over mechanical latch.



Thanks for the info, I will take a look at those flip-flop latches. 
As far as the mechanical work, though, I am using the MTH remote turnouts which already have the solenoid built in. 
I may be missing something, but I don't see a way to use the turnouts as power switches. But that would indeed simplify things a lot. Would this need to be a custom turnout or can you explaing how I modify mine to do this?


----------



## T-Man (May 16, 2008)

I like the idea of a micro switch attached to a switch. That would be a fun project in itself. They can be bought locally.
My DPDT relay in my reverse circuit has a nonpowered position. If that helps.
Any circuitry you use you will need a DC power supply. The track is AC.


----------



## [email protected] (Dec 8, 2009)

I dismantled one of my MTH turnouts, and had some good luck! Inside there are 2 separate microswitches which get triggered alternately on each side of the throw.They are rated at 5A, so I can just use the third pole (NC) to route power through to my 2 insulated track sections. So then when the switch hits one side, it will dump power to the correct side of the track automatically. No relays necessary. Now I just need to pick up a few infrared activators to flip the switch on train entering each siding and I will be good to go!

Thanks for all the help guys!


----------



## [email protected] (Dec 8, 2009)

Argh, I still need a little more help!

I was mistaken in how the infrared activators work. You can control the delay of the voltage output, but this is only the delay which occurs after the IR sensor becomes unblocked. I was hoping that I could have it trigger when a train hits it, and then only throw voltage to the turnout for a fraction of a second to flip the switch.
What I need is something which will, when triggered, just open the voltage output for a fraction of a second and then turn off again until it is retriggered the next time the train makes a complete loop. 
I know there must be a fairly simple solution to this, but I just can't see it in my head. 
Please let me know if you can think of any way to do this. 

Thanks folks!
Rob


----------



## T-Man (May 16, 2008)

I still think you should use the auto derail movement to route the power and not the other way around. Is your IR detector store bought?


----------



## tankist (Jun 11, 2009)

can you please explain how your IR sensor works? input and output voltages, timing, etc.
trigger on sensor open (if i understood you right) can be actually even better


----------



## [email protected] (Dec 8, 2009)

I bought the MTH infrared track activators. They have an aux input (I hooked it up to the 14V constant output of my MTH transformer. The output has both a NO and a NC operation, and outputs whatever voltage is input. Also, it has a dial to change the delay from 0 to 15 seconds, so the circuit will be closed this long after the sensor becomes unblocked.

T-Man, I took the back off the MTH turnouts and looked around a lot. It would be much more difficult to try getting the rails to route the power than just using the microswitches inside. Also, It feels like the connection made on the rails may be a little loose when switched via the auto-derail movement. It just doesn't seem to lock in the other position quite as tightly when the train wheels manually move the switch, so I bet I would get a flaky connection there. 

My next idea would be to scrap the IR activators and maybe use 2 reed switches on the track and a strip of magnet on each train engine. I could wire it so that both reeds need to be closed to send power to the turnout, and place them such that the engine's magnet will be across both reeds for a small time, and then as power is diverted, that engine still coasts a bit to the point where only one or none of the reeds is still activated. I think this could work, but would be a little more putzy to figure out the spacing and such of the reeds and magnets to make sure it still works with engines at very slow speeds. The tolerance would have to be very tight.

I am just thinking there may be some solid state solution that would work better, such as a timer circuit feeding a relay for a 1/2 second or something and triggered by the IR. Ugh, I am at a loss. Back to the drawing board.

At least with what I have now using the power routing through the microswitches, I will be able to at least swap trains manually with a single button press, but still having it full auto is my goal.

-Rob


----------



## T-Man (May 16, 2008)

The 555 timer has many sites some with triggers and itmers. It'sjust that I don't have the experience for it. One was called a Schmit trigger. The Kelsey park school has an electronics club that has some of these circuits.
I am sure there are a few ways of doing it. Keep it up.


----------



## [email protected] (Dec 8, 2009)

*A little electronic component help please...*

Hey folks,
I have been toying around with ideas on how to make this auto-switch setup work, and I have picked up a couple reed switches which should allow me to switch the turnout from one side to the other as the train passes by. The Infrared detectors did not work out after all for this.

What I need now is to finish the power routing part of the setup, and I think I need to use a relay to open power to one side of the track siding depending on whether it is getting current off the microswitch inside the turnout. I looked on digikey.com and I am baffled by all the terminology and can't see which ones I need to order. If someone here has a little electronics knowhow, can you please give me a hand in my ordering? 
Here is what I need:
A relay where the coil is engaged at 12V+ A/C, and is able to handle an 18V A/C load. I am having a hard time deciphering the terminology to find what I need. If someone would be kind enough to explain the component's terminology, or just hook me up with a digikey part #, that would be greatly appreciated.

Thanks again!
Rob


----------



## T-Man (May 16, 2008)

Digikey will answer you if you ask. I use 12 DC relays from Radio SHack. I am not sure if they operate on AC. SOme diodes would filter it out though. I doubt the 18v ac switched would not work on a 12v relay. Time to research. .........My radio shack is only DC.


----------



## tankist (Jun 11, 2009)

or an automotive relay perhaps. here is one for example. this the only one in AC. note - its SPDT , not DPDT 
http://www.newark.com/durakool/dm85-2011-35-5012/automotive-relay/dp/78M6770
please take a look at the data-sheet before.
if contacts are rated for 12V/20A (ie automotive light), i would not hesitate using them for 18V/[pair of trains worth of] A



BTW, i like newark webpage better then digikey (and i really like the "substitute" feature). it seemed easier to find items, they had the cheapest darlingtons i could find. so i decided to give them a try. ordered all the parts needed for my CDU's there minus the caps. unbelievable, they even bothered to package everything in little boxes inside the main box . well apart of the transistors. 30 pc. stack tube is a package in itself.


----------

