Arduino model train projects

Slowly but surely there are more and more Arduino model train projects being submitted.

This is how Tim solved a problem with his turnouts:

“Al – I was inspired by a story you published about using servo motors to control turnouts. I did some research after reading this story and considered that using servos might be a viable option to replace the traditional solenoid motors in my current model railway.

I currently use the stud and probe method with nuts and bolts through my baseboard in the design of the track (photo below).

Solenoids were relatively expensive and due to the age of them, there were occasions when they would get stuck.

However, the method of controlling these servos seemed cost prohibitive given the cost of the controllers used to activate them. It seemed to me that the maximum numbers of servos that could be controlled by one control panel was 12 and they were expensive to purchase.

Arduino model train projects

After doing further research (and with the aid of my extremely talented son) I believe that I have come up with a very cost effective solution.

Firstly I purchased an Arduino mega for about AU$14.00. It has 54 inputs meaning that it can control 54 separate servos.

I have hooked the Arduino up to three PCA 9685 16 channel PWM servo drivers. These cost about AU$8.00 each. As the name suggests each board can control 16 servos. They can be hooked up in series so that the full 54 inputs of the Arduino can be used.

The servos cost about AU$2.00 each and with the costs of a power supply, dupont jumper cable connectors (so I could make my own wiring) and aluminium channel to house the servo, each turnout worked out to around about $5.00.

I used a straightened paper clip to connect the servo to the tie bar of the turnout to act as the lever to change the direction of the turnout. There are many internet articles about fitting servo motors.

Arduino model train projects

My son has written some sketches (programs) to control the servo for various Arduino model train projects.

The first sets the servo at 90 degrees.

The second is to control a single servo – it is very useful to determine the angles required to change the point from straight ahead to turn.

The third sketch is to control up to 48 separate turnouts using the PCA 9685.

The input for each servo is the ‘stud’ part of the existing control set up with the probe being connected to the ‘ground’ input on the Arduino. Each time there is a connection between the stud and probe the servo moves in the opposite direction that it last moved.

Previously I had 2 studs per turnout – one for each direction. I now have one per turn out – each ‘press’ changes the turn out to the opposite side. The same results could be achieved by using press buttons although the wiring would be a little harder given that every button would need to have a common ground wire (this is achieved in my system with the probe)

The sketches (particularly the last one) allow for individual angles to be provided to each individual servo and the speed of the servo to be adjusted so that they change as fast or as slow as the modeller desires. They are down loaded to the Arduino and once downloaded the Arduino executes the program each time a button is pushed.

Replacing existing turnout motors was very simple. After removing the existing motor, I put the paperclip through the tie bar from above. I put a 90 degree bend in it so that it wouldn’t fall through. The aluminium channel was fitted from below the baseboard. I passed the paperclip through the appropriate hole and temporarily stuck the channel to the baseboard with a piece of doubled over electrical tape. After checking that moving the paperclip from side to side operated the turnout, the aluminium channel was secured to the baseboard using 2 screws.

I then put a ‘z bend’ into the bottom of the straightened paperclip, attached the servo motor and pushed it up into the aluminium channel. After checking that the servo worked the top of the paperclip was trimmed back to the tie bar level.

The LEDs have been wired to the side of the turnout. The inner rails of the turnout have been isolated so that the LED only comes on when the blade of the turnout is closed. That way I can see the direction and know that the blade of the turnout is closed.

This might impact on some business of the companies that have made turnout controllers but this system is far cheaper and thanks to the sketches already written it is very easy to install and control servo motors.

Hope this can be of assistance to the wider modelling community.

Regards,

Tim”


Now on to Cassio.

I don’t really publish pics on their own, but this one had me looking at it for a while, so I thought, why not?

You can see Cassio’s last post here.


“Hi Al , just had a day out up in North Yorkshire to see some Steam.

Thought some of the members might enjoy, as I say some saying they see too much of DMR with trains running.

Regards

Dave”



I often ask whether I’m posting too much of Dave’s stuff. I have to say the people who say ‘no’ are in the majority by a country mile, so I’ll continue to with Dave’s Model Railway.

That’s all for today.

A big thanks to Tim – I’m seem to be getting more and more Arduino model train projects, like Keith’s and John’s.

That’s all for today folks.

Please do keep ’em coming.

And don’t forget, if you want to take your first steps towards your own layout, the Beginner’s Guide is here.

Best

Al

PS Latest ebay cheat sheet is here.


N scale hotel

Paul’s been in touch with his N scale hotel scene:

“I have a brief video of my layout (at least a portion of it) that I would like to share on your site.

I live in Arizona and took 5 years building it after details both common and unique to Arizona and just made the video to share my most recent addition of computerized n scale neon signs.

I’m a retired aerospace engineer (still working with electronic companies in my retirement) so the electronics plus the extreme detail have always appealed to me.

Best regards,

Paul”

N scale hotel tunnel

n scael hotel

n scael farm



Now on to Heinrich (You can see his last post here).

“Good morning from South Africa again!

Al, I would like to share the latest developments to my Karoo themed layout. A lot of credit must go to Johan, the builder of my layout.

Regards,

Heinrich”


A big thanks to Heinrich and to Paul for sharing his N scale hotel scene.

That’s all for today folks, please do keep ’em coming.

And if today is the day you take that first step towards your own layout, the the Beginner’s Guide is here.

Best

Al

PS Don’t forget the latest ebay cheat sheet is here. Still going strong.


Model train helix

Gary’s been in touch with his model train helix:

“Al:

Have never emailed you before but am slowing working on my double deck HO layout now that I am supposedly retired.

It’s an approximately 10’ x 18’ space in my basement. The levels are about 16” apart from top of level 1 to bottom of level 2, but the helix needs to go up to 19” to get to the top of level 2.

The model train helix is a 26” radius curve (as big as I could go) resulting in a 2% grade, which should be very manageable for my locomotives.

The supporting structure, as you can see, is threaded 3/8” rod with home store tie plates acting as the shelf for the end of the curves. They already have numerous holes drilled in them so I will use those to bolt the plywood roadbed to the plates.

Everything seems to be very stable so far, but have yet to run any trains. Each curve covers 120 degrees, so there are three pieces of ½” sanded plywood curves per level.

The construction allows me to automatically super-elevate the continuous spiral by simply raising the outside nuts a bit over the height of the inside nuts, nothing will have to be done to the track work itself. I read if you were going multi-level you needed to build the helix first, so that’s what I did.

I am modeling the Missouri Pacific De Soto subdivision during the late 60’s and early 70’s from Riverside to Cadet, MO and the extension to the Pea Ridge iron mine. I grew up in De Soto, the home of Missouri Pacific’s car repair shops.

I am still finalizing the track plan. Current idea is to start in Riverside on level 1 go through Horine (interchange with Frisco) then up the helix to De Soto.

Once I get all that done, I hope to go to layer three to get to Pea Ridge.

The De Soto subdivision run’s from St. Louis, MO to Poplar Bluff, MO as part of the Arkansas division – St. Louis to Little Rock. II will be using NCE DCC.

I hope you enjoy my model train helix and I am happy to answer any questions.

Gary

Hillsboro, MO USA”

model train helix

model train helix

model train helix

“Alastair,

I commented on the recent blog entry regarding coal loads.

My neighbor was throwing out black styrofoam packed around furniture legs, which I grabbed. I then bought a used coffee grinder from our local thrift store. K-Cups have made these almost obsolete.

After filling the hopper, I spayed the top with hairspray. I can easily pull a long train of filled hoppers with a single Diesel engine.

Love your Blog

Marvin”

coal freight HO scale


Now on to Jim – who has been kind enough to answer some questions on his last post, which is here.

“Hello Alastair

Several of the people who responded to my latest work on Starrpoint, had some questions regarding several areas, NCE SWITCH8 MK2, the BI-COLOUR LED work and my transfer table.

First lets touch on the NCE SWITCH8 MK2. GEORGE ZAKY wanted some information on what goes into installing one. So for George here is my reply:

Here is a picture of the NCE SWITCH8 MK2 board

When you look at the board, you will notice several terminal blocks on the board. The one at the upper right is for power. This is where you place the power wires either from the track, or from a separate power source.

To the immediate left of the power terminals is the selector switch for DC or DCC operation, which ever you are using.

To the extreme left of the board is a terminal board with three screws. These are only used if you plan on using toggles to throw the turnouts as well as the automatic system. I never use these since I only use the automatic system for the turnouts.

On the bottom of the board there are 2 banks of 8 terminals. It is here were you wire the turnouts. They are numbered 1 a b, 2 a b and so on until you get to the end of 8. You need two wires from the turnout, one for closed and one for thrown. The best way to wire the turnouts for proper alignment is to look at the turnout you are going to wire.

Now for tortouise switch machines, you only use terminals 1 and 8. So take a wire from terminal one of the tortouise and connect to terminal 1 a, take a second wire connect that to terminal 8 at the tortouise and connect that to terminal 1 b and then at the NCE SWITCH8 MK2 board. You now have one turnout wired. The rest follow the same wiring pattern.

Now you will notice two buttons on the board as well. The one on the bottom centre of the board allows you to toggle between the wiring points. A LED will light indicating the terminal selected. You will also notice that in the upper window a number will appear indicating the terminal is selected.

Now for the fun part of all this, you can program all of the turnouts with individual numbers. To do this first push the center button on the bottom and select the turnout you want to program.

Next push the button on the upper left corner, this is the programming button. You will notice that a flashing “P” will appear, indicating you are ready to program the selected turnout. You will need your DCC throttle to program the turnout. You can use any number you wish up to 3 numbers only. Push SWITCH on your throttle, select the numbers you wish to use for that turnout, and you will notice on the throttle either a “T” of “C” appear on the throttle screen. Simply choose the opposite alignment and you have now completed your first turnout programming. Congratulations.

ROLAND ALDRIDGE commented on using the BI-COLOUR LED’s for the turnouts. I did use them for all of the switches, however the way you mentioned and noted on the instructions from Tortouise I had issues so the way to solve the problems was to first wire all of the turnouts with the power wire on a continuous loop. All eighteen turnouts were wired in series, with only one wire to the main panel and connected to a DC power source. This eliminated the voltage drop at the turnout power. Next RED and GREEN wires from the tourtouise were brought back to the main panel and connected to the individual BI-COLOUR LED’s. You are right there was a lot of wiring doing it this way, but found it beneficial. No issues with the turnouts.

MARKUS MUETSCHARD wanted information regarding the WALTHERS TRANSFER TABLE.

Well let me tell you, I was devastated the day the transfer table stop working. I found the issue to be with the electronic board that controls everything on it. I contacted WALTHERS, and HELJAN ( who originally made the transfer table for Walthers ) to purchase a new board. None are available. So now what needs to be done? I did not want to remove the table and have to fill in the space with wood. And I could not use a turntable to utilize the buildings in the Diesel area. I had to find a way to make it work. So I put on my electronic thinking cap, and came up with a solution. A DC power pack could be used to control the movement of the transfer table deck. So that solved that problem. But what about the lighting? AH there was the ultimate headache. There are two lights for the table and one that blinks indicating the table is moving.

So what to do? Well there was only one solution, design a electronic board to control the lights. Here is a picture of the board that I designed and built to handle the light issues

The board contains two transistors, one NPN and one PNP. Three resistors are necessary, 1K, 100 meg and a 47 ohm. A 2.2 ohm capacitator, and a four terminal wire connector.
And it works. Now I can use the Transfer Table again with added excitement.

I hope the information and answers to all of the above questions are helpful.

Jim Sr
Starrpoint RR”

A big thanks to Gary for sharing his model train helix, and to Marvin and Jim.

When it comes to a model train helix, I’m always reminded of Lawtrences helix.

That’s all for today. Please do keep ’em coming.

And don’t forget the Beginner’s Guide is here if you want to take your first step with your own layout.

Best

Al

PS Latest ebay cheat sheet is here.