Skip to content
@MTD2A

MTD2A

Model Train Detection and Action Arduino Libray

The content is aimed at people interested in train control, programming, electronics and mechanics for model railway systems.

I would like to encourage everyone who develops Arduino solutions for model trains to publish their work here, and you can choose whether you want to write your contribution in your native language or English.

Write to [email protected] to become affiliated and join teams.

The library is under construction and Danish documentation and guides need to be translated into English.

Links

Danish G model Railway Association

Digital Command Control

NMRA Standards and Recommended Practices

Massoth Train Control Systems

Arduino home

Arduino libraries

The Pows (Parco)


Arduino C++ source code supporting 12 sensors

https://github.com/MTD2A/Train_Emergency_Stop


Sensor Comparison


Speed

The speed tells how many milliseconds the sensor needs to detect and process. The distance traveled from where the sensor is located, to where the locomotive has moved on to, depends on how quickly the sensor can process and action taken. Up to about 20 cm when train is running fast and the sensor is "slow".

Distance

The distances shown are those supported by the Arduino Nano program. Several sensors can measure longer. However, the measuring angle will typically limit the distances to 50 cm.

Daylight

Most infrared sensors does not work in daylight. Light interference can be significantly reduced by mounting 1-2 cm aluminum tubes or similar blank tubes. At the same time, the measuring angle is reduced considerably, which provides more precise detection. Sensors should not be mounted with vertical tubes, as dust and dirt can get into the tubes, and thus there is a risk that the sensor will not function correctly.

Reliability

Reflection

If dirt gets on the receiver or transmitter units, there is a risk that the circuit will not function correctly. This is particularly risky when mounted under rails. It is possible to use two sensors simultaneously to achieve greater reliability. This applies to a lesser extent when mounting the ultrasonic sensors under rails, as the ultrasound is powerful and penetrating, and the sensor diameter is significantly larger Ø16 mm.

Break beam

Is the most accurate, reliable and efficient train detecton method.

Popular repositories Loading

  1. .github .github Public

    MTD2A

  2. VL53L4CD VL53L4CD Public

    High precision ranging laser sensor and blocking detection

    C++

  3. FC-51 FC-51 Public

    Infrared Obstacle Avoidance Module

    C++

  4. DGMF DGMF Public

    Arduino and other source code use at Danish G model Railway Association

    C++

  5. SEN0503 SEN0503 Public

    DFrobot SEN0503 binary infrared refraction sensor

    C++

  6. SEN0523 SEN0523 Public

    DFrobot SEN0523 binary infrared refraction sensor

    C++

Repositories

Showing 10 of 15 repositories
  • FC-51 Public

    Infrared Obstacle Avoidance Module

    MTD2A/FC-51’s past year of commit activity
    C++ 0 0 0 0 Updated Feb 9, 2025
  • .github Public

    MTD2A

    MTD2A/.github’s past year of commit activity
    0 0 0 0 Updated Feb 8, 2025
  • VL53L4CD Public

    High precision ranging laser sensor and blocking detection

    MTD2A/VL53L4CD’s past year of commit activity
    C++ 0 0 0 0 Updated Feb 5, 2025
  • DGMF Public

    Arduino and other source code use at Danish G model Railway Association

    MTD2A/DGMF’s past year of commit activity
    C++ 0 0 0 0 Updated Feb 1, 2025
  • HC-SR04 Public

    Ultrasonic digital PWM distance meter - 40 kHz

    MTD2A/HC-SR04’s past year of commit activity
    0 0 0 0 Updated Feb 1, 2025
  • E18-D50NK Public

    E18-D50NK / E18-D80NK binary infrared reflection sensor

    MTD2A/E18-D50NK’s past year of commit activity
    C++ 0 0 0 0 Updated Feb 1, 2025
  • SEN0503 Public

    DFrobot SEN0503 binary infrared refraction sensor

    MTD2A/SEN0503’s past year of commit activity
    C++ 0 0 0 0 Updated Feb 1, 2025
  • SEN0523 Public

    DFrobot SEN0523 binary infrared refraction sensor

    MTD2A/SEN0523’s past year of commit activity
    C++ 0 0 0 0 Updated Feb 1, 2025
  • GP2Y0A21YK0F Public

    Infrared analog distance meter

    MTD2A/GP2Y0A21YK0F’s past year of commit activity
    0 0 0 0 Updated Feb 1, 2025
  • MTD2A/A02YYMW’s past year of commit activity
    0 0 0 0 Updated Feb 1, 2025

Top languages

Loading…

Most used topics

Loading…