Model Train-related Notes Blog -- these are personal notes and musings on the subject of model train control, automation, electronics, or whatever I find interesting.

2018-12-01 - SQ12 Mini Camera for Cab Rides

Category Video

I’ve been doing all my “cab ride” recordings using a Mobius Action Cam. A few months ago I tried the RunCam 2 for comparison.
This time I decided to try one of the SQ “mini” cameras series for a change.

Cab ride filmed using SQ12 Camera

I got this SQ12 from Amazon:

Click here to continue reading...

2018-10-12 - CMRS Touch Panels, continued

Category CMRS

This is a follow up on that proof-of-concept I made at CMRS about touch panels for the mainline.

I'd like to elaborate a few points, with some pros and cons, which I had been thinking about when I started the project. Upfront I want to make it clear I am not advocating for one solution or another. I am offering "food for thoughts", pros and cons, and matter of discussion. Some of the discussion involved industries or city names which are specific to CMRS’ layout. A map of it can be found in the link above.

Click here to continue reading...

2018-10-01 - Cameras, OpenCV, and occupancy detectors

Category Train

A lot of my interests when it comes to model train layouts are all about automation. Automation can mean to make the trains move automatically but it can also mean to automate signaling -- displaying semaphores and search lights according to traffic on the layout. The common denominator for both is block occupancy detection, namely to know where trains are on the layout.

An early prototype of camera-based block detection

Click here to continue reading...

2018-09-15 - NCE AIU01 and Motion Sensor

Category NCE

As previously discussed, on the Randall layout, visitors press a button to trigger the trains’ automated sequence. Soon enough, we added a sign asking people to be nice with that button. The sign has nothing to do with the actual electronics behind nor the automation, not even the button itself. Both the button and the software are sturdy enough to survive any abuse.

And abuse there is. The abuse is simply… social. Kids hammer that button like there’s no tomorrow. Does it make trains run faster or more frequently? Nope. One would hope it would be a good exercise in parenting in teaching kids to be reasonable and treat common property adequately, but alas, no.

Eventually Jim and I had enough of it and I decided we could simply use a motion sensor as trigger instead of a hardware button. Back in March, I built this prototype:

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.

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 members 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. For testing, one of the members procured 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. 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

On the Randall layout, visitors press a button to trigger the trains’ automated sequence to start. Very quickly we noticed that sometimes the system would fail to notice the button was pressed.

We use a large button but that’s irrelevant. The issue has to do with how long it is pressed. Most people give a quick short push, and that’s the problem.

The button directly closes the contacts on an NCE AIU01 (Auxiliary Input Unit), which is regularly polled by the NCE command station. The computer runs my Conductor software which polls JMRI for the status at at least 30 Hz. The AIU01 is polled by the NCE Command Station at an appalling low refresh rate due to the NCE cab bus implementation: if an input doesn't trigger long enough (e.g. 1 second), it will be easily missed. In this case, it’s enough to give a short but quick push to the button and most of the time miss the polling window. The event is simply missed.

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

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...

 Generated on 2021-01-20 by Rig4j 0.1-Exp-91c1dac