Model Train-related Notes (a.k.a. “blog”) -- these are personal notes and musings on the subject of model train control, automation, electronics, or whatever I find interesting.

2018-09-15 - NCE AIU-01 and Motion Sensor

Category NCE

The original design for the motion sensor was to use an ESP32 with an HC-SR501. The ESP32 would be used to send a sensor activation command to JMRI.

Since I was working on RTAC, it occured to me I could use it to drive a Digispark Tiny via a wired USB connection and the same sensor. Then RTAC could just manipulate a Conductor variable directly over the KV server connection. This has the advantage that it removes the requirement for wifi. One less dependency. Or does it?

Click here to continue reading...

2018-09-02 - Digispark Tiny

Category Arduino

The Digispark Tiny is a probably the most basic and compact Arduino-like I’ve worked with. It’s about the size of an USB A plug. It is powered by an ATTiny85 and offers 1-5 I/Os depending on usage (typically 2-3).

(image source:

Kickstarter Date: 2014.

Example of the Digispark Tiny connected to an USB OTG with a PIR sensor:

Click here to continue reading...

2018-05-20 - Signal quality in Advanced Tomato

Category Misc

I’ll just leave this here for those who use Advanced Tomato on their wifi routers: the “Quality (%)” column in the Device List is not a percentage at all. It’s just a delta from the client’s RSSI to the interface floor noise in dBm.

From, line 248:

2018-04-21 - Mobius Action Cam vs Runcam 2

Category Video

The latest video I did was an update of the full “cab ride” layout tour of the Randall Museum layout.

In the past I’ve used the same camera as for all my previous cab rides, a Mobius Action Cam. When I tried to use it after a year of inactivity, I realized the battery is dead and won’t hold a charge for more than 10 minutes. I can order a new battery, but maybe it was worth looking at what had changed in the domain in between. Let’s look at the Runcam 2.

Click here to continue reading...

2018-01-21 - Turnouts Touch Panel for JMRI at CMRS

Category CMRS

Some folks at the CMRS train club (the Carquinez Model Railroad Society, in Crockett, CA) desired to have large touch panels that members could use to toggle switches on the mainline. One of the guys procured various 32-inch touch panels and I wrote a quick experimental software to display the mainline on it and control turnouts based on touch.

The touch panels rely on the main JMRI server to trigger turnouts on the mainline.

This post documents my first prototype demonstration for this project. This was going to be an iterative process as I expected to incorporate feedback later. Eventually nothing happened as this was seemingly never presented to the memberships or their engineering meetings. Still what I came up with is fairly easy to reuse for other layouts -- I’ve implemented something similar at Randall just after, so I’ll explain how it is implemented in the hope others want to use that or get inspired by it..

Click here to continue reading...

2017-10-31 - NCE AIU and short trigger events

Category NCE

This is for Randall but I might just enjoy it myself too… The NCE AIU suffers from an obvious polling refresh rate issue: if an input doesn't trigger long enough, it will be easily missed.

Question is what would be the simplest circuitry possible to make an input trigger longer?

From the NCE AIU pdf:

Click here to continue reading...

2017-04-12 - Powering a LED off DCC

Category DCC

Very interesting discussion here:

Summary, TL/DR: We can power a LED directly from DCC, just add a resistor to limit to about 10 mA (or less if too bright).

Suggestion is "nice to have" a reverse parallel diode to limit the reverse voltage on the LED:

However another comment indicates it's enough to compute R to be within the specs of the reverse voltage of the LED (assuming I have the specs).

Click here to continue reading...

2017-04-10 - Layout #3 “Test Track”

Category Train

I tore down my previous layout #2 since it didn’t have a purpose anymore -- originally it was for the kids to play with and for me to play with cameras recognition of trains and automation. I’ve done my part, and the kids didn’t show interest anymore. Being a 4x9”, it was still taking valuable space in my small room. Time to update.

What I cared for is having a workbench and a simple test track on top of it. I came up with a very simple L-shaped workbench design. The workbench is designed to not have any legs in the way and lots of storage space underneath. For the test track, I have a bunch of EZ-Track around so I just used that. It’s suitable for minor switching. I won’t add any scenery, it does not look like a shelf layout since it’s a workbench.

Click here to continue reading...

2016-12-01 - IR Sensors

Category Train

The IR reflective TCRT5000 sensors (specs) are being somewhat obnoxious. Original planning was to mount them under track, pointing upwards, in reflective mode.


  • As planned, they are easily hidden between ties.
  • Current usage is reasonable enough to tap it from the NCE AIU01's 5V supply.
  • Data sheet indicates that in reflective mode, distance is ideally up to 2-15 mm. That does not seem to be a problem when the reflective surface is a truck or tank, assuming the surface is reflective to IR.

In practice, I found the following issues:

Click here to continue reading...

2016-10-11 - JMRI Logix

Category Train

Looking at JMRI Logix, this is a non-script click-o-drome if-this-then-that.

Conditions range from block, sensors. Actions are signals, turnouts, scripts or warrants.

Conditions can act when set or on change.

No direct throttle control, maybe indirectly via warrant scripts to run "auto trains".

One possibility is starting a script when some condition happen.

Seems interesting for people who don't want to write scripts. Tons of clicking to get things done.

Seems ideally suited for simple linear decision trees, not for free-form scripting.

Examples would be signals or turnouts set depending on block usage.

For my automation purposes, it seems fairly weak and I’ll design my own software that uses a text file for configuration. Somehow it makes non-tech people very nervous and Windows users especially seem to enjoy clicking ad nauseum in poorly designed modal dialog boxes instead of having a single text file script they can look at quickly.

 Generated on 2018-09-18 by Rig4j 0.1-Exp-cb8b174