Please read the general section first!
The MattzoSensorController is designed to receive input signals from digital sensors like reed switches and pass the information on to the Rocrail via the MQTT broker.
The controller connects to MQTT as described in the “General” section.
When a connected sensor has contact with a vehicle, the controller instantly sends a sensor event to the MQTT broker.
When a sensor looses contact for more than 0,1 seconds (configurable), the controller sends the “sensor disconnected” event to the MQTT broker.
Up to nine reed sensors (or other digital sensors) can be connected to the controller. For more information about reed sensors refer to the sensor section.
To facilitate error search and debugging, the controller has an optional LED. The LED lights up when a sensor has contact. Additionally, the LED also shows the connectivity signals when trying to connect to WiFi and MQTT as described in the general section.
The following information is valid for firmware 0.3 and above ONLY.
The following diagrams shows two options for the wiring of the MattzoSensorController.
The first diagram shows the wiring option for the MattzoSensorController with status LED:
The status LED indicates to WiFi connection status, the MQTT connection status and lights up when one or more sensors are triggered. The status LED is very handy in practice. Therefore, this wiring option is recommended.
The next diagram displays the option of the MattzoSensorController without status LED.
Instead of using pin D0 for the status LED, it is used for connection a ninth reed sensor. The option should only be used if you want to connect all of the nine connectible sensors to the controller. As the ESP-8266 has no internal pull-up functionality for D0, a strong resistor between 10 or 100 kOhm is required to pull up the port when the reed sensor is released. All other ports are pulled up by the MattzoController-Firmware.
Please note for both options, that the reed sensor on pin D8 must be connected to 3V3, not to GND on the other end. This is because D8 is actually pulled down, not pulled up.
- I/O board with micro controller. We have used a NodeMCU Amica Modul V2 ESP8266 ESP-12F. Similar modules should work as well.
- Up to 9 reed sensors (details: see sensor page).
- A pull-up resistor (10, 47 or 100 kΩ) for pin D0 (if ninth sensor is installed).
- A LED (if status LED is installed). Make sure that the LED cope with the power supply. Depending on the type of LED, they each might need one additional resistor wired in series.
- 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.
For general setup instructions please refer to the “General” section.
To setup the sensor in Rocrail, navigate to the interface tab of the sensor definition. The MattzoControllerID must be used as “Bus” parameter, and the port of the sensor as “Address”.
The first port has the number “1” (not “0”).
For using the sensor as a wheel counter see next section.
ALL OTHER INFORMATION ON THIS PAGE CAN BE NEGLECTED AND HAS NO MEANING!
Wheel Counting / free@enter
Rocrail has a very nice feature called “Wheel counter”. The idea is that the wheels (i.e. magnets) that pass a sensor are counted. By comparing the number of wheels that have passed the last sensor, Rocrail is able to notice that a train has completely passed a specific sensor on the layout. Rocrail is using that information particularly on “Enter”-Sensors of a block, and frees the block ahead after all “wheels” have passed the sensor. This speeds up train operations on your layout significantly, as the last block is available for other trains a lot earlier compared to waiting until a train has reached the “In”-Sensor of the subsequent block.
To use this feature safely, please make sure that not only your loco, but also the last waggon of your train has a magnet installed. Commuter trains need magnets in the front and in the end.
More details can be found in the Rocrail documentation.