See my video of an NXT computer being used to automate the stopping and starting of trains at stations.
About this creation
This is a fairly simple way to automate the stopping and starting of trains at stations using an NXT computer. In this MOC I have 2 trains travelling in opposite directions around 2 loops of track. There are 2 platforms on each track that the trains will stop at automatically, wait 10 seconds and then start again. Here is the video of the automation in action.
How It Works
I used NXT light sensors to detect the presence of the trains at the platforms. There are a total of 4 light sensors - one at each of the 4 platforms. I have set each of the light sensors to generate light. When the train goes past the generated light is reflected off the train and the light intensity reading is higher than that of the ambient environment. This is the trigger the NXT program uses to cut power to the tracks and stop the train. I should also mention that the extra long cables that connect the light sensors to the NXT came from Mindsensors and are not available from The LEGO Company.
To control the power to the tracks I started with a standard 9V speed regulator to supply power. Instead of powering the tracks directly I ran the electrical output thru a pole reverser with a small electrical connector and then to the tracks. I used the pole reverser because I could use a simple axle connection to mechanically connect it to an NXT servo motor. Having done all this, the NXT program can simply turn the servo motor forward 45 degrees to power the tracks and then turn it backwards 45 degrees to cut power. I used 3 of these arrangements in my setup. 2 of them power each of the 2 loops of track, the 3rd is used to turn on and off the canopy lights at one the stations.
If you are interested in seeing any more detail on my trains or stations, they are all available on MOCPages as well. You can click on the following links to access them.
Hi Andrew! This layout is really neat! I was looking at a "non" LEGO way to pause the trains automatically and then I found your "LEGO" way to do it. I have 2 questions (maybe more:)
1. Is there a way to program the sensor to let the train pass the sensor a couple of times and then pause the train on the 3rd pass?
2. Would you be able to send me more info on laying out your set up? My email is timallwein@yahoo.com Thank you!!!
Very good idea to use NXT things to automate or control LEGO buildings. You inspired me to think about building an autmatic defense system for my battleship.
Nice looking trains and stations btw :-)
minus 1 point for looking at the cables ;-)