The following diagram shows the overall architecture of the MattzoBricks Train Automation System:

Overall Architecture of the MattzoBricks Train Automation System

The following sections describe the components of the overall architecture.

Rocrail

Open Source Software for controlling model trains. Used as the backbone of train automation in our platform.

Here is a short list of things that Rocrail does:

  • Create and manage the logical plan of your LEGO train layout,
  • allocate blocks for your trains,
  • calculate and set routes, switches and signals,
  • open and close boom barriers,
  • execute time tables and schedules,
  • start and stop your trains,
  • react to sensor events,
  • many other helpful things…

MQTT Broker

Message Broker that transports commands from Rocrail to the trains, switches, signals and boom barriers, and feeds back information from sensors to Rocrail.

The MQTT Broker acts as the central communication pipeline between all components.

The most common MQTT broker for personal computers is a free software called “mosquitto”, which we also use for our own layouts. Any other MQTT should also do. The broker may run on the same computer as Rocrail, which makes deployment quite easy.

Additional hardware besides a Personal Computer is not required.

MattzoControllers

A MattzoController consists of a microcontroller and usually some other additional electronical components. Depending on their specific type, they serve different purposes, e.g. controlling train motors and lights, flipping switches, settings signals or transmitting sensor events back to the MQTT broker.

Trains and MattzoTrainControllers

A train is something that moves with one or more motors on your layout. From a logical perspective, it doesn’t really matter if your train has cars or not. Of interest is only if the train may change direction.

Train are controlled by MattzoTrainControllers. The specific type of train controller depends on the LEGO power and control system that you are using.

More info: here.

Switches and MattzoSwitchControllers

You certaily know what a switch is. The difference to a LEGO standard switch is, that the switches we use in automated train layouts are motorised, usually by small servo motors.

Switches are controlled by MattzoSwitchControllers.

More info: here.

Signals and MattzoSignalControllers

Signals are basically an assembly of 2, 3 or 4 LEDS. They are controlled by signal controllers.

More info: here.

Level Crossings and MattzoLevelCrossingController

Level Crossings consist of Boom Barriers and flashing lights. They are controlled with MattzoLevelCrossingControllers.

Support for Level Crossings is in development.

More info: here.

Sensors and MattzoSensorControllers

Sensors report positions of trains back to the automation computer (Rocrail).

Check out everything about sensors here.