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

Sketch plugin to automatically update image layers using JavaScript

One day a few of my peers on the creative team came to me with a request/challenge – could I build a Sketch plugin that streamlines keeping image assets up-to-date in their comps? After a few iterations, I believe I settled on a solution for them, see the [narrated] video below for details.

  • assign local/remote URLs to image layers
  • data is saved at the document level and persists (see sketch file format for more info about this)
  • upon menu item click, or document open, grab layer object via saved layer ids and update image data with associated URL
  • no need to iterate through layer hierarchies (slow/wasteful), no need to rename layers, no need to keep directories in a specific structure
  • Document Settings – for saving data
  • Actions – for listening for document open, etc.
  • From Native – for getting document from action context

If you have any further questions about this, please reach out!

More info – https://developer.sketch.com

Another plug-in: