Model train crossing/bridge controller using an Arduino Mega using C/C++

One of my favorite things about the model train hobby is getting to experiment with my love for hardware and code. One day I was playing with a crossing system I bought from a big retailer and quickly became frustrated with its shortcomings, I literally had an “ah hah” moment when I realized I could create my own, pretty easily.

The video below describes in detail why I decided to build my own, and how I went about doing it. I go over different “activation methods” and why I chose to go with sonar over voltage or light.

One additional thing I did was add a BLE chip so I could control the whole system with my smart phone (luckily I know a good iOS developer to build the app).

Grossing Gates, Turnout, and Signal Bridge

Components used:

  • Arduino Mega
  • Sonic sensors (HC-SR04)
  • NJI Crossing Gates (NJI 1164) & NJI dwarf
  • Adafruit Bluefruit LE UART Friend – Bluetooth Low Energy (BLE)
  • Innovative Train Technology Products HQ-300 (Sound module)
  • Tolako 5v Relay Module for Arduino (Works with Official Arduino Boards)
  • SMAKNĀ® 5V Active Low 2 Channel Relay Shield Module for Arduino UNO 2560 1280 ARM PIC AVR STM32 Raspberry Pi
  • BLMA 3 track modern signal bridge
  • Circuitron 6000 Tortoise Switch Machine
  • Misc. servos (crossing gate and car stopping mechanism)
  • Rare earth magnets (interrupts the reed switch in Faller car)
  • Faller – Car System Start-Set MB Sprinter
  • Adafruit Speaker – 3″ Diameter – 8 Ohm 1 Watt [ADA1313]

Faller car system