Automated Model Train

Fun

This is the last post in this series and I will focus on other things in the future.

I finally have my setup working and had quite a lot of fun with it. There were a lot of issues that needed to be fixed, but this is normal for any project. All the small parts worked well but putting them together with each other revealed some side effects that were not expected. One of them, and the one that kept this project interesting, was that the 74HC595 was randomly switching the relays. This problem started to happen over time and when certain engines (the small ones) passed over some of the Switch Points. This somehow created a feedback, and the 75HC595 switched relays randomly. It took me some time and trial and error to figure out that the latch key input to the 74HC595 was the main culprit. I needed to put a filter before it (please see updated post about the module) as well as a capacitor between the 5V input and GND. This finally solved that issue. The other aspect I was struggling with and had some fun figuring out was the layout I would like to have.

As is the tradition, I only really have a go on the model train over XMAS and therefore didn’t have a fixed installation. This is why I used a big flat cardboard box as a base, which was good as I rebuilt the loop a couple of times until I was happy with the setup. The temporary cardboard setup looks a bit messy, but it actually works extremely well for project work.

Signals

The Märklin Z Signals Model 8940 have an inbuilt switch to connect (or disconnect) a 8589 Track (see POST). The signals are switched the same way as the Switch Points, so there are not really any problems connecting them to my relay array. It also looks much better.

Automation

As I wanted to automate the model train, I firstly automated the stopping of the trains before the Signal, therefore, I used ST1 to switch SG1 and SW1 as well as ST2 to switch SG2 and SW3.
When an engine has triggered the switch, the signal will switch, and with that, switch off the power to the track just before the signal. It will also change the Switch Point to isolate the track. This will allow for me to run multiple trains on the same track, as one can be stopped on a side track, while the other train can pass by. This worked extremely well, and the only thing I had to look after was SW3 or SW1 to control the trains.
The next was to use switch ST3 to open SW3 and SG2. This makes it possible to run two trains clockwise without interference from me, would take a round, and each train would pull into the side track and stop.

Here are the files:

The XMAS Holidays are well and truly over, and summer is coming, so all other projects have to hibernate until next winter.

Previous
Previous

Minimum Linux for VMware Admins

Next
Next

VIDM upgrade to 3.3.7