Please read the general section first!


The MattzoLayoutController is designed to receive signal commands from Rocrail via the MQTT broker and set light and form signals to a specific aspect.

Sempahore main and distant signal
Sempahore main and distant signal

Functional Description

When Rocrail requests a signal to change its aspect, it communicates this as a command via the MQTT broker. The MattzoController receives this command and evaluates, if the command is relevant for the specific controller (i.e. if the signal is connected to this controller).

Up to eight LEDs can be connected to the MattzoLayoutController if no port extenders are used. If standard two-aspect light signals with red and green LEDs only are used, four signals can be attached to one controller.


The following diagram shows the wiring of the controller. As an example, four simple signals with one red and green LED each are connected to the controller.

Wiring Diagram MLC with 4 signals
Wiring Diagram MLC with 4 signals

An additional LED can be connected to pin D8. The LED indicates the connection status of the controller to WiFi and MQTT.

If you use Trixbrix signals, check out their special wiring. The middle wire (red) is the common plus terminal (anode) of the LEDs. It must be connected to 3V3 of the controller. The outer wires (black, yellow) are connected to pin D0-D7 of the controller and represent the minus terminal (cathode) of the two LEDs.

Trixbrix Signal

Required components:

  • I/O board with micro controller. We have used a NodeMCU Amica Modul V2 ESP8266 ESP-12F. Similar modules should work as well.
  • LEDs in different colors (red, green, for railway experts also possibly yellow and white) if you build the signals yourself.
  • Possibly some resistors to protect the LEDs from burning off. Resistors with 220 Ω are frequently used for this job. In doubt ask the vendor of your signals or LEDs or check the specifications.
  • Basic stuff like bread board, wires etc.

The controller can be powered up with a simple USB charger over USB or some other power supply of similar voltage that is connected to the VIN and GND pins of the controller.

Power Supply

The controller itself can be easily powered up via USB.

In the wiring diagram, the signals are connected to the 3.3V terminal of the controller. If this is too much for the LED that you are using, add a resistor in sequence to them.

The signals light up brighter if the plus terminal of the signals is connected to VIN (between 4.5 and 5V if supplied via USB) rather than to the 3.3V pin of the controller. We have tried this successfully with TrixBrix signals without breaking them. You are free to try it yourself, but you do this on your own responsibility.

In general, we recommend to check with the vendor of the signals or LED for what voltage the LED is built.

Firmware Configuration

Please read the MLC general page first.

To configure the firmware configuration, you need to edit the controller configuration file (controller_config.h).

In this file, the following sections are relevant:

  • SERVO WIRING CONFIGURATION (relevant only if you use form signals),

The sections are clearly marked in the standard configuration file, and the different parameters are explained with code comments, so you shouldn’t have too many problems to understand what you need to do.

If you are using form signals for the first time, the example configuration file “MattzoLayoutController_Configuration_FormSignals.h” might be of use for you to get an idea of how to configure semaphores.

Rocrail Setup

For general setup instructions please refer to the “General” section.

To setup the signal in Rocrail, navigate to the interface tab of the signal definition. The MattzoControllerID must be entered as “Address” parameter, and the port of the LED as “Port”. This must be done for all signal states (usually only red and green).

The first port of the controller has the number “1” (not “0”).


Signal configuration in Rocrail

Leave a Reply

Your email address will not be published. Required fields are marked *