Sep 2013 30

Simulating Railroad Crossing Lights

Everyone has seen a railway crossing before, and if you're a railfan you've probably spent more than a few hours stuck behind them waiting for their infernal blink-blink-blink to stop so you can continue chasing your train!

How do you make your model crossing blink like that though? The simple answer would be a 555 timer in astable mode with some set and reset triggers. But that would be easy, and when you're an software engineer everything looks like a software problem. So instead, we attack the problem with a sledgehammer and use an Arduino.

Kidding aside, there are very valid reasons why you might want to use an Arduino for such a simple problem. Suppose you're using the excellent Arduino CMRI library to connect your layout to

Read full post...
Sep 2013 23

Addressing many LEDs with a single Arduino

A fun little side project of mine is Arduino C/MRI, a library that lets you easily connect your Arduino projects up to the JMRI layout control software, by pretending to be a piece of C/MRI hardware. Hence the name.

A common problem when using Arduino C/MRI is dealing with lots of inputs and outputs. As an example, lets wire up a simple non-CTC crossing loop here in New Zealand. It is about as simple as you can get:

Each end consists of:

A turnout. We'll need 1 digital output to drive that. A route indication signal on each leg of the turnout. We'll need an LED for red, and one for green (technically it'd be blue here in NZ). That's 3 pairs of outputs = 6 more. A push button ...
Read full post...
Sep 2013 22

Driving many outputs with Arduino C/MRI

A fun little side project of mine is Arduino C/MRI, a library that lets you easily connect your Arduino projects up to the JMRI layout control software, by pretending to be a piece of C/MRI hardware. Hence the name.

Hello World

The basic "hello world" example is fairly straightforward, wiring up a JMRI light to a physical LED on the Arduino board.

#include <cmri.h> CMRI cmri; void setup() { Serial.begin(9600); // make sure this matches your speed set in JMRI pinMode(13, OUTPUT); } void loop() { // 1: main processing node of cmri library cmri.process(); // 2: update output. Reads bit 0 and sets the LED to this digitalWrite(13, cmri.get_bit(0)); }

It's easy enough to extend this example to handle 5, 10, even 15 outputs... if you have an Arduino Mega, you could have a LED on...

Read full post...
Sep 2013 20

Making snow

To prepare my module for snow I started the slow process of building up a base for the snow. To start with I wanted the snow nice and level with the tracks, as per the original inspiration photo. I grabbed the nearest caulking gun and squirted out big fat beads along the track, then with a putty knife and some water smoothed it off nice and level.

To simulate piles of plowed snow, I crushed up some dried plaster and embedded it in the caulk while still soft:

To disguise these mounds I mixed up some sloppy plaster and drizzled it over the top. Much sanding, filling, more sanding, painting, smoothing, sanding followed. At the same time, I experimented with snow materials:

Woodland Scen...
Read full post...
Sep 2013 20

Illuminating my first city building

In between making points, I've been playing with some of my recently acquired buildings. I decided to tackle a small one initially to get the feel for things. First step was to dismantle the building, something Kato have made fairly easy. I dug out some LED strip tape, which unfortunately had green LEDs. It was a simple enough job however to desolder them and solder on some tiny replacement white LEDs.

While at it, I put some blue LEDs into the end spot so that the stairwell would be a different colour. Then I drilled holes and made space for the lights and mounted a row for each floor. Some more holes at the back to run the wires down.

Read full post...
Sep 2013 15

City scene takes shape

It's official: the long-rumoured, oft-hinted, city scene has finally started to take shape.

Trackwork

The Utrainian Workshops have been busy churning out points for the complicated yard ladder trackwork; that is, the tracks that will route trains from two main lines onto one of eight platform lines. To further complicate matters, the station trackwork is all located on a curve to maximise the available space for the station platforms.

For the first set of points, I drew out the plan full size and used pieces of flexi-track and a length of metal to trace out the curves and track centrelines. I then traced these onto other bits of paper and painstakingly built up the points over these rough outlines.

Read full post...