Skip to Main Content
Search This Site:

Google Custom Search.

Want to search all TCA sites?
Go here



Join TCA.










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

By Russ Keil,  TCA 04-56974  Return to Main First Page  Return to Previous Page

Amuseument Park.
Breadboard Setup of Amusement Park

Working with Breadboards

Since most Arduino projects begin as prototypes using a breadboard, I assembled a simple example using the amusement park board layout and code. To get a feel for how it works, first click the image above for a larger view, and print it out. Then follow the explanations below.

The breadboard, available in many sizes, has two sets of +/- rails on each side of the board. When a wire is connected to either +/-, on either left or right sides, the entire vertical row will have the same charge. Similarly, each ROW, numbered 1 to 30, are connected in two segments of 5 sockets (a-e) and (f-j), (e.g. Row 1, columns a-e will have the same value as the wire plugged into one socket in this range, but columns f-j will not). This makes is easier to make multiple connections on the breadboard. Columns a-j are not interconnected.

I used a 9V battery to power the board and another 9V battery to power the light bulb connected to the relay (instead of 14VAC power to the amusement park). I have push buttons mounted on a test board to make it easier to test my projects.

The two switch legs (wires running to the push button) are connected to the Green terminal block on the breadboard. Pressing the bottom button, in this case, will result in a HIGH or 1 to show on Pin 2 during a digitalRead() of the pin (buttonPin). If the button is held down for 50 ms, (the debounceDelay) the code will trip the relay via a digitalWrite() to Pin 7 (relay1) and allow power to flow to the bulb for the 15 seconds (runTime). As you can see from the picture, the breadboard is not ideal for installation on a traveling or event fixed layout. If 1 or 2 wires are pulled out, the project will not work properly.

You can follow the code and the connections on the above example. On the left side of the Arduino, the white wire is connected to pin 2 which is buttonPin in the code. The black wire is on pin 7, which is the relay trigger (relay1). On the right side of the Arduino there is a blue wire connected to GND, while the Red is connected to 5V. Both of these wires connect to the - & + rails on the left side of the breadboard.

There are three connections on the bottom side of the relay (Vin, Gnd and In). There are jumper wires in place from the breadboard +/- rails to the 3 pin Male portion of the wiring harness. 5V is connected to Vin (Voltage in), and Ground goes to Gnd. Arduino pin 7 (the trigger) is connected to the In pin. The female plug is connected to the relay.

On the top of the relay are three terminal connectors. From left to right are: the Normally Open (NO), Common (COM) and Normally Closed (NC) connections. In this example, I have 9V+, from battery #2, connected to the COM terminal, while the NC terminal is connected to one side of the light socket. The other side of the light socket is connected to 9V- on battery #2. When the button is pushed, the relay is triggered, and voltage will flow from the COM to NC terminals and bulb lights. In this example there is no connection to the NO terminal.

While all this may seem challenging, playing around with a simple setup like this is a great way to make mistakes, learn, and have fun. Once the basics become second nature, more complex setups are possible.

Protecting the devices

These are very small devices, and benefit from careful mounting and protection, expecially if they are going to be moved around. Plexiglas comes in handy here.

I have drawn most of the common components I use in AutoCad, as seen in the illustration above. This makes it much easier to drill the holes for each piece when I mount the components on Plexiglas. For the AD layout, a plexiglass cover is also installed over the boards.

Sensing and Doing

We close with a picture of something we mentioned on the previous page. Feedback to systems is an important part of creating appropriate actions on the layout. In fact, there are a large number of components that can be conneccted to let you do amazing things with thise microcomputer systems, on layouts and elsewhere.

Infrared Receiver (top) and Emitter (bottom)

Infrared sensors can be used to detect passage of trains so that gates and lights can be triggered. Other available sensors detect water, tilt, light, motion, heat, gestures, and even speech. And there are even servos, solenoids, fans, gears.... If you've ever assembled a Heathkit, a science kit, or similar device, or played with computers, you'll soon find new uses for these amazing components, and won't have to spend a ton of money doing it!

Yes, it's a whole new world, but one that train operators can benefit from getting involved in!

Return to Previous Technical Page          Return to First Page

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 ListTCA National Convention
 Privacy & Legal Notices   © Train Collectors Association   Site Design   Contact TCA