Hi all,
I have recently completed another model train control project. This time, it has to do with traffic automation.
The vintage Märklin H0 track system I use provides a series of special track sections (contact or switching tracks) that are used to control accessories, they work differently but the end result is the same: a passing train will close a circuit that establishes a connection to ground, which activates connected accessories (turnout, signal, light bulb etc...).
This is used to automate traffic. If planned well, one can get to a point where trains run themselves on a block system, but things get quite complex rapidly and generate a huge amount of wiring. To avoid collisions, the special tracks need to be placed strategically, most of the time several meters away from the target accessory. Wire spaghetti heaven! Additionally, things are not easy to re configure, as it usually involves a lot of re patching.
I had already developed a Nodered/Tasmota wireless solution for the manual controls of accessories, and I decided to expand the functionality a bit. I designed ESP8266/MCP23017 sensor modules to which all the contact and switching tracks are connected. The sensor passes all contact information via MQTT to Nodered. Nodered in turn processes the information and uses it to change signals and turnouts by sending relevant messages to the wireless switches controlling the signals and turnouts.
This eliminates the need for long wire runs, and makes the configuration much easier. on my current layout, I removed 75% (30m) of wiring, not a bad ratio.
I have designed a dashboard tab to manage all this, based on scenarios that use a different set of configuration data, so I am able to reconfigure the layout at the push of a button.
The nodered part was done with zero coding, using default NR nodes and parameters.
Here is a little YouTube video about this:
Thanks for your attention...