Skip to Main Content
Search This Site:



Google Custom Search.


Want to search all TCA sites?
Go here

 

 

Join TCA.

 

 

 

 

 

 

 

 

 


Arduino UNO R3 microprocessor used to control Gabe the Lamplighter

Small Can Be Better: Applying Modern Computer Technology to Layout Operations

By Russ Keil,  TCA 04-56974                                    Fall 2018 

Russ Keil is President of TCA's Atlantic Division, an active worker on the TCA National Toy Train Museum committee, and plays a lead role in the annual convention registration process, among other hats he wears.

He draws on his special computer skills as well as business background.

Russ expresses special appreciation to Bob Lubonski for his support and leadership on the accomplishments described here, as well as to TCA webmaster Jim Alexander for assisting in assembling this presentation.

This describes how we are using small components of modern technology to improve exhibit operations at the National Toy Train Museum, and are extending such work to enhance TCA Atlantic Divison's layouts.

It also demonstrates that just as we have choices ranging from large LGB trains to tiny Z scale, we have a growing number of options as to the size and characteristics of how we control them. Consider, for instance, how various layout controls that used to involve bulky rheostats, transformers and relays are now being manufactured in much smaller ways, and that toy train manufacturers are increasingly placing tiny computer components right on the trains to achieve new effects that gain interest.

Computer technology, increasingly miniaturized, is not just a smaller option, it provides ways to do more things with greater precision. It's the type of thing that younger people are increasingly interested in, and provides a tool for better toy train operation, and attracting future members who are very much at home with computers, and enjoy their challenges.

By way of example, TCA's Atlantic Division has been increasingly successful with its portable layout, setting it up at venues where the non-train public can see it and hopefully get attracted to our hobby. It's intentionally a fun display, with colorful amusement park elements that draw attention. The goal is to keep what visitors see simple, with the complexity that train collectors have to cope with out of sight. These efforts are paying off, with lots of people asking questions.

Behind the scenes, we're using some nifty, small, technology that may challenge us, but will be right up the alley for the coming generation.


Click to view video

One example on our layout is Gabe the Lamplighter, and a tiny microcomputer.

The requirement for multiple button pushes, which is not intuitive and can be a user turnoff, is noted in the Lionel Instruction Sheet, No. 23780 American Flyer, Gabe the Lamplighter Owner's Manual:

NOTE: If you continue to press the button to make Gabe climb the ladder after the lamps have either turned on or off, you may destroy the micro-switch, and Gabe may become stuck. There are two buttons on your controller, red and green. The red button when pushed makes Gabe climb up the ladder at a rate of one rung per push thus making is necessary to push the button multiple times before he reaches the lights. You will need to press the red button approximately 40 times in order to get Gabe to reach the top of the ladder. Be careful not the push the button to quickly in succession as the solenoid will need time to cool. The green button is pressed once to allow Gabe to slide back down the ladder and wait for his next run. You are now ready to start Gabe turning your tower lights on and off.

Gabe is a relatively dumb accessory initially made by America Flyer in the 1950's, and reproduced by Lionel and MTH in the more recent past. It's a tower with lights on the top, a ladder for Gabe to climb and a control box with 2 switches and knob to turn on the spotlights manually.

In original form, the user had to press a button approximately 40 times to make Gabe climb the ladder a single rung at time. Then they could turn the lights on or off using the light knob.  To make Gabe descend the ladder, one pressed the descend button, which dropped Gabe from top to bottom in free-fall. Not wanting little children to think they could free-fall down a ladder safely, I wrote the code so Gabe would descend the ladder one rung at a time. How was this done?

Introducing Arduino

First, we purchased an Arduino Uno R3 microprocessor board with a micro USB (right top), which is smaller than a pack of playing cards, and cost less than $4.00, and also several small relays (right bottom). 

What is Arduino? It can be described as an open source computer hardware and software environment, with a user community that designs and manufactures single-board microcontrollers and kits for building digital devices that can sense and control objects in the physical and digital world.

Arduino products are distributed as open-source hardware and software, which are licensed under the GNU Public Licensing, permitting the manufacture of Arduino boards and software distribution by anyone. Arduino boards are available commercially in preassembled form, or as do-it-yourself kits. They can be purchased directly from the Arduino site, or from other places, sometimes modified. More about that later.

On the Atlantic Division layout, I removed the original control box and replaced it with an Arduino and 3 relays which control the lights, the climbing up and climbing down the ladder. When activated by one push of a button, the spotlights flash several times to draw the user's attention to the accessory. Gabe then climbs one step at a time, reaching the top, the lights are turned on, and he then climbs down the ladder one step at a time.  At the bottom, Gabe rests for a few seconds, climbs the ladder again, turns off the lights and climbs down. The lights flash several times before the accessory goes to sleep waiting for another button push. Kind of basic, but the kids love it!


Air whistle accessory control schematic. Note this uses a daughter board.

The division layout has several other Arduinos (all the Uno R3) for making the crossbucks flash, controlling timing for the power to all of the amusement park rides, operating the hot air balloon ride, and controlling the air whistle. The schematic above was generated by software available free on the Fritzing site.

Arduinos are great for sensing something like a button push or an infrared beam break, and then triggering something to happen like a gate going down. The functionality of many such uses may be very simplistic, but can produce quite effective results. 

Another Example of Applying Auduino and Solving Problems

Dept store.
D-265 Department Store Layout at Museum

Since the Arduinos have been highly effective on the Division's layout, we decided to install some at the National Toy Train Museum. Power to all five tracks on the D-265 Department Store Layout that was added this year, is controlled by a single Arduino and five pushbuttons. A second Arduino controls the Train Orders building.

Are these control foolproof? Do the use "artificial intelligence"? Will we be free of challenges for humans to resolve? No, not at all. (Well, not so far anyway!) For instance,  we were having a problem with the first track on the D-265 layout since it has a hill. If the train timed out on the uphill portion of the track, when it started up again, it was drawing a lot of current and cooking the coil in the 5VDC relays. After some pondering, we decided to use the 5V relays to switch a 30 Amp 12V relay to power the track. That stopped the relays from burning up. We saw similar problems when trains derailed and shorted the track.

The last remaining issue is still with track 1 and the hill. Unless we run a newer engine with speed control, the trains will either stall on the uphill or derail on the downhill depending upon the voltage settings. To fix this, we are planning to use a current sensor to measure the current draw when the train is on a level surface and during the climb. Then when the current sensor measures a decrease in current demand (downhill), I can reduce the voltage to a digital dimmer to prevent the train from derailing. Once back on the level surface, the voltage will be ramped up again.

To assure that I know the train is on the flat track I'm changing the logic for track 1 so that after the timer expires, the train will not stop until it breaks an Infrared beam which will be placed on the flat portion of the track. The beam-break detector consist of two components: an IR Emitter (LED) and an IR Receiver (pictures on last page). An extra lead on the Receiver is connected to one of the Arduino input pins that will give me a 0 when the beam is broken and a 1 when it is seeing the emitter.  These are the same parts we will be using on the Standard Gauge layout ($1.95 a pair).

Indeed, shortly, the Standard Gauge layout at the Museum will get its first Arduino to control the crossing gates, semaphores and dwarf signals. This installation will include infrared beam-break detectors (see example on next page) that will determine the direction of the trains and drop or raise the crossing gates sequentially as well as control the other trackside devices.

Code.
Amusement Park Code
-- The Arduino IDE (Integrated Development Environment) seen above is free. --

Yes, the Arduino has to be programmed! But don't let it scare you!

While I have a background in this field, people can learn how to do it if they apply themselves, making use of a downloadable process, or doing it online. It takes some time, focus and thought, but the results are worth it! (Or get a helpful high-school student to lend a hand!) These devices are capable of performing chores that formerly required much larger and less flexible controls.

Arduino is being used around the world: At universities it is widely adopted in the fields of engineering, the Internet of Things, and robotics, to name just a few. In teaching, it's finding use in high schools and up. For playing, primary schools use toys powered by Arduino technology to introduce physical learning, logic, building skills, and problem solving.

It blows the mind! For a thoroughly mind-expanding introduction, see Massimo Banzi, one of Arduino's innovators, in this video:

A visit to the Arduino website at  https://www.arduino.cc/ will be an eye-opener. If you're interested, spend some time there soaking up the information. They also have a number of tutorials here. Give some thought to how you might play with this technology and learn your way into its use. Give some thought to reaching out to students who very likely will know more about that than you do, but could be exposed to an aspect of toy trains that they'll appreciate!

As if that's not enough change to cope with, there are other miniaturized, more complex computers about the same size that can do many functions that your desktop computer can, even running Windows 10! Take a look at the Raspberry Pi miniaturized computer that kids around the world are also using. Most likely more power in a tiny package than you'll need!    https://www.raspberrypi.org/

Challenging?   Yes!

The way of the future?  Quite likely!

Something for train collectors to consider?  You bet!

 

For additional technical information, article continues here.

Second Decade.
Visit the other members of the TCA Family of Web Sites:
TCA Sites Gateway | TCAmembers | Toy Train Museum & Library | TCA x-change | Toy Trains Mailing List
 Privacy & Legal Notices   © Train Collectors Association   Site Design   Contact TCA