Union Project: Installing Roadbed and IR Block Detectors

N Scale Dystopia
40 followers
In this episode, let's review roadbed installation and my first attempt at programming and installing IR detectors using Arduino controller boards.
For anyone interested in some of the code I developed for the IR detectors, you can find it here:
https://github.com/nscaledystopia/IR-Detector-Arduino
If you are interested in 3D printing your own IR detector 'holders,' you can download the STL files here:https://www.myminifactory.com/object/3d-print-ir-detector-holder-248135
#nscale #arduino #modelrailroad
-----
Instagram: https://www.instagram.com/modelrailroader/
Welcome back to the Union Project. In this episode I'll review how cork roadbed installation became
a sudden crash course in Arduino controller programming and infrared block detection.
Let's get started. In the last video I shared my cookie cutter bench work design and installation.
I talked about using builder grade materials to keep costs down and my approach for mapping
track placement and assembling the upper and lower decks of the bench work. With this bench
complete I was eager to start laying track and running trains. However, I first needed to install
roadbed. In the past I have used two basic roadbed types, foam roadbed and cork roadbed.
Foam roadbed is easy to work with, effective and affordable. It also does an excellent job
of noise dampening. The only drawback I find is that it's very flimsy. It hasn't much structure
so it conforms to any surface and amplifies its imperfections.
My sub roadbed was builder grade plywood with gaps and flaws that needed to be corrected and I
decided that the stability and rigidity of the cork roadbed would be a better way to overcome
these imperfections. Installation was straightforward. Each cork section was split and flipped to create
beveled edges. I applied a generous coat of carpenter's glue along the center lines
and clamped everything in place using push pins. I installed the roadbed over the course of two
weeks, stopping only when I ran out of pins. It was satisfying to see the track plan come to life.
I could finally see how the staging yard and the bathhurst fly under looked and I was really
pleased. I started to install some tracks when I remembered I needed to split the roadbed where the
east and west modules joined. This isn't a modular layout but I am building it like one if I ever
need to disassemble it. It was at this moment I realized I hadn't considered the staging yard's
visibility. When designing the layout I made a point of ensuring the staging yard wasn't beneath
any of the top deck tracks. They were intentionally beneath the city. The city area is removable so
derailments are accessible. I had solved the access problem but I had never considered the
fact that I would have zero visibility as to the location of the equipment in the staging yard.
I needed some form of block detection. Of the options available I decided to try
infrared detectors and Arduino controllers to indicate the locations of trains. I had already
decided to use Arduinos to control my switch machines so it made sense to use the same
devices for block detection. There are many fantastic Arduino tutorials online so I'm not
going to go in depth of how I built my detection system but I will take a brief look at the
components and my approach. I used an Arduino controller, IR detectors, LEDs and resistors for
my block detection circuits. Hey everyone, real fast video. I just started laying track in the
staging yard level of the layout and as I'm getting towards the west side of the layout I need to be
able to know when to cut the power or stop the hidden passenger trains down here. So I need to
do some sort of occupancy detection so I have decided to try Arduino. This is brand new to me.
I haven't used Arduinos before and I'm having a ton of fun and so the bottom line is I'm using
two IR detectors to create two indicator points along the line. As a train enters into the staging
and it crosses the first IR detector it'll give me a flashing red light to know that there is a train
now moving through that staging track and when it gets to its stop point somewhere around here where
I need to basically park it it will have crossed both IR detectors which will now give me a solid
red. So train enters into the hidden staging automatically gives me a flashing red light as it
proceeds and when it hits its stop point solid red and I know that's where to stop the train.
Anyway, good stuff. The software programming is straightforward. I defined a series of variables
that would capture the state of the IR detectors as well as the stages of the detection sequence.
Running within the software loop the first block of code records the state of each of the detectors
and records that information to the corresponding array value. The second block of code takes that
information and activates the indicators. LEDs illuminate based on the state of the detector
and the progression through the indication sequence. I wanted an easy way to mount the
detectors beneath the layout so I designed and 3D printed small collars that allowed the sensor to
fit snugly within a plastic sheath inserted into a five-eighths inch hole beneath the track.
I installed 10 IR detectors over four staging tracks which required two Arduino controllers.
I temporarily attached the indicator LEDs to the frame and after some troubleshooting everything
worked as expected. When the train enters the block and crosses the first detection point
it shows a flashing light indicating it's now passing through that siding.
Once that same train crosses the second detection point the LED switches from flashing to solid
indicating that the train has reached its stopping point and it's clear of the points
on both ends of the staging track. Once the train leaves the siding and the second IR detector
returns to an open state the LED indicator turns off signaling that now the siding is clear and can
be occupied again by another train. This was an unexpected project but I'm grateful I remembered
it before I needed to lay more track. Now that I have a better understanding of how Arduinos work
I'm eager to integrate them into the layout. Next time we'll review basic track installation,
my experience using fast track jigs, and how I'm using Arduinos and servos for point control.
Thanks for watching. We'll see you next time.
