Arduino train turnout control Create massive train traffic on your own model railway! Nov 28, 2019 • 26838 views • 24 respects toys remote control Components and supplies 7 On my last photo you will notice that I have put the Kato turnout control wire with a plug on my two center positions so the turnout could just be plugged into the switch, this is not necessary but it was just to show that it could be done if you choose. The Jan 2, 2017 · This one uses the above Bachmann turnout (arduino servo control article coming soon), a arduino nano, two IRL520 MOSFETS, two resistors, and two diodes. Added my loco, and able to control it on a little stretch of track. The booms are controlled by small servo-motors. I would like to do all the switching with 1 Arduino Jan 15, 2015 · To control multiple servos with one Arduino, your sketch would need variables for each servo to hold its pin id and unique divergent angle. I learned how to identify a turnout to JMRI, and how to add it as a ServoTurnout to the myAutomation. I do not plan on using the Arduino as a position indicator, I’m going to use DPDT switches to control the Arduino and the turnout indicators. I'm sure this can be done from a button but my first lack of knowledge is how can I get the signal from my DCC network to the Arduino? Will the signal be sent from the LocoNet or will this be sent on the rails? I figure it's the LocoNet. Apr 13, 2015 · Hi there, I am new to Arduino programming and have found a sketch that does what I need to switch various servo motors connected to various turnouts (sets of points) on my model railroad layout. DCC-EX is a team of dedicated enthusiasts producing open source DCC and DC solutions to run your entire model railroad layout. Arduino/ESP library to control model train turnouts. The code uses a stud and probe method to send the commands to the Arduino using CD40 Learn how to create a slow-moving turnout actuator with position indicator lights using an Arduino microcontroller. I am a beginner. This system uses electromagnetic coils to switch. A structured array contains all information, such as pin addresses for the I/O devices, as well as the information for the timing. Sep 16, 2022 · Model Train Turnout Control Projects Programming Greatnorthern September 16, 2022, 7:12am SwitchMachine library The SwitchMachine class defines the three I/O pins on the Arduino device which will operate a single turnout through one half of the driver, either the L293D or the TB6612. The first 1,000 people to click the link will get a full year of Premium membership toModel Railroad Academy for only $1. I'm building a rail model layout, and I'd like to manage the turnouts and signals through an Arduino Uno R3. Sep 2, 2025 · In the single turnout example, the turnout was all controlled by an arduino based on sensor feedback. Control system This manual uses train control through the Arduino Train DEMO 2 mobile app. Oct 26, 2022 · Good evening! I would like to automate my model railroad with Arduino, and am looking into automatically switching the turnouts. Apr 23, 2019 · Servo Control Although the prior article went over some of this before, I will recap some servo basics for this article. Define a turnout in JMRI and a sensor for feedback. I would appreciate advice on coding and wiring to achieve this. The final product can be used to control the servo. Feb 5, 2019 · In this project we’re going to put together a simple Arduino train crossing! While practically this project is simply to help you learn how to use buttons, LEDs, and servos in your Arduino project, this train crossing (also called a level crossing) project could be adapted to model train sets with very little work. Arduino. Try Arduino Academy for FREE! The diodes protect the MOSFET from inductive spikes when the solenoid coils fire. What I need to control: 12 turnouts, driven by a single coil, DC polarity controlled. PCF8575 for the control panel. I’m keeping is simple. modelrailroadacademy. I have an ATX Feb 13, 2015 · 36 control "blocks" - no direct DCC control, but the ability to "turn off" power if a train passes a signal at Red/Stop including double track and single (bi-directional) track areas - from a programming perspective one block per direction. I am nearing the completion of the control box. Our easy to use, ready-to-run and do-it-yourself products use either our own custom hardware or off-the-shelf Arduino and similar technology. If you are not Aug 31, 2018 · I have put together an Arduino Mega 2560 with a 16 channel x 12 bit Servo PCM shield to power my 12 Turnouts which include a double slip turnout and a 3-Way turnout. I have developed a Arduino based circuit that uses IR sensors and shift registers to detect train position and then uses an h-bridge circuit to send forward/reverse DC power to throw track switches (turnouts) to divert the train down one track or another based on the Arduino programming. The tutorial also covers two remaining types of actuators. Three options are available to suit almost any situation. From an excellent tutorial by Geo Bunza in the Model Railroad Hobbyist Magazine forum. The idea was to later adapt the sketch from 12 servo's to 24, once I had got it up and running to enable me to use one toggle switch to control one servo to operate/switch one set of points. Jun 2, 2019 · Users browsing this topic marklin-users. Jun 7, 2025 · I add remote control to 6 Peco switches on my HO scale Model Railroad Layout in an area where I hadn't planned ahead to do so. The power must be between 9 and 12v, 700 mah, with a pulse duration between 100 and 200 ms. Oct 14, 2024 · Supports a variety of signals with different aspects. Nov 2, 2021 · It seems all I can find online are people wanting to convert their turnout switches to digital. In this example with the DigiX and the 5 turnouts, the control is done via JMRI -- I have a custom program that emulates an NCE bus (for JMRI) or an SRCP bus (for RocRail), receives the commands from JMRI or RocRail and then sends them over Oct 19, 2021 · Arduino - Points/turnout/accessory Control V2: Updated 19 Oct 2021: new PCB v3 (Jun 2021) available with added memory push button to set the first turnout address. Our free and open source EX-CommandStation software is supported by numerous third party hardware and apps like JMRI, Engine Mar 6, 2017 · The Arduino works very good and I can tweak each turnout individually. Things that you will need;1. Our step-by-step guide includes instructions on adjusting turnout position, speed, and approach warning light blink rate. The Arduino Uno, seen here, is one of several brands and types of Arduino microcontrollers available Aug 18, 2016 · I located the original thread when searching for a way for the Arduino to control numerous points/turnouts for a model railway layout. The only trouble is I cannot work out how to program a computer interface to control it, I kind of want a image or the track plan as the background with buttons to change The Arduino I'm using is a Uno which costs <$20AUD and has 20 I/O pins, so theoretically can throw 6 turnouts per board as I've coded it (2 pins for the switch, 1 for the servo control wire). Jan 19, 2025 · I'm just starting out in DCC-EX, and have configured my CSB1 Command Station. Of the three wires that stick out from the motor casing, one is for power, one is for ground, and one is a control input line. Some, especially old switch machines, will require an increase in voltage to 14 - 16 volts. Mega is recommended2. To increase the voltage, you can use the DC-DC Voltage Step-Up Converter Module for Arduino. We would like to show you a description here but the site won’t allow us. Jun 25, 2025 · Hi all. It lets you easily set the limits of rotation and one doesn't have to be Arduino Oct 4, 2024 · This project is the continuation of the “Build a working display case” project in our October 2024 issue. Feb 17, 2025 · Hello, As my unitrack layout is getting a bit complex, I decided to drop the "one turnout / one switch" idea to control several turnouts at a time so that one switch now defines a given pathway for a train, thus controlling potentially a fairly large number of turnouts (say from 4 to 10 typically. 49: https://go. It described how an Arduino Pro Mini (a low cost Arduino board) could be wired and programmed to respond to function keys on a DCC controller. Jan 17, 2021 · Hello. The schematic is as follows: Become the Maker you were born to be. (baby steps). I want to keep the old way of switching my turnouts (analog) using the kato switches for my #6 N scale turnouts. I have managed to get one servo with push button control working using the following sketch which I copied from the web but have been unable to get a second servo with push button control to work. As I've ended up making these pretty much ad hoc, I don't have a clear schematic written down. Jan 7, 2020 · Get the trains running on time. h file. Also contains code to control the signals from sensors such as point (turnout) direction and track occupancy. Uses* IR reflection as sensors but could equally use light sensors or IR transmission sensors (one each side of track),* arduino pro mini as the CPU,* 1602 LCD (16 characters and two lines for output, used in 4 bit parallel mode),* 5V regulator Dec 30, 2024 · I have converted my Kato turnout controls to DPDT momentary toggles using the method described on Mike Fifer's site (DJs Trains video) and they all work very well this way. This second part details the physical and software infrastructure Randy built to control his working display case using an Arduino Nano. The three pins associated with a single turnout are: “black” and “red” pins, which will control the corresponding wires on the KATO turnout May 4, 2023 · How to Control Multiple Model Railroad Turnout Servos | Full Arduino Sketch Run-through Jul 14, 2020 · I've been working on a way to control servos for turnouts and other uses that is inexpensive and doesn't require using an Arduino or expensive commercial servo controllers. PCA96853. Servo brackets to mount the ine Nov 15, 2013 · What is MRServo? MRServo-1 Control Board MRServo is a low-cost, low-profile, slow motion model railroad switch machine using small and inexpensive RC servos to control the turnouts on your layout. The details of John’s project are described below. We are showing how to control more than one Kato turnout with a single arduino. Apr 25, 2014 · Modified radio control servo motors operate the remote control turnouts on Jim Lomison’s HO layout. In addition to moving the points, I also want to change polarity of the frogs and show the position of the points with LED's on the control panel, at the same time. I don't want to do that. I am going to use a red and green led for each signal (stop/go lights) so I was thinking 3 wires to a signal A GND, +green and +red. PCA9685 for to control the turnouts servo's and the relais. More advanced programmers will want to create something like an array of data structures to organize pertinent data about the servos. I took Dave Bodnar's cheap servo tester/controller idea and modified the circuit a little. Multiple turnout control via serial communications: See step-by-step and code from Geoff Bunza here. Of course, my current goal is to build a node for the OpenLCB project to control points via servos. Includes information about how to use, features, materials, assembly and a video demonstration. The first, MRServo-1, is the simplest and least expensive. How to make a slow moving turnout motor to control 1 or 2 turnouts with an position indicator LEDs on each leg. I want to operate model railway turnouts with servos and push button control using Arduino Uno revision 3. As An easy way to control servos for realistic slow moving turnouts using a low cost SG90 servo and Arduino Nano. It uses two types of I2C io-expanders. I'm not a native English speaker, so I apologize in advance. May 19, 2025 · This lesson shows some of the issues when using Arduino controlled Mosfets to control solenoid turnout motors. 5 The Arduino code has been updated accordingly using the NMRA standard packet for turnouts (also based on a study of Lenz / Atlas Compact data packets for turnout control). net community | Forum » The Projects & Workshop area » Model railroad wiring » the solenoid turnout mekanism and arduino Forum Jump Aug 4, 2013 · Hi, I am thinking about creating an arduino controlled signal system for my model railway. I imagine you are going to control them with an Arduino. He uses servos in his aircraft, and they sell for less than $10 each. Servos require a microcontroller; however, the microcontroller is not limited to just controlling servos. I'll probably build a few, thanks. In this video I will demonstrate a process for routing control for your model railroad layout with Arduino. Can I source a DPDT momentary push button switch and use it in the same manner as the Automatic turnout control using Reed switches is a great way to control turnouts and prevent derailments. Jun 17, 2024 · There are many ways to use an Arduino on a model railroad. In the attached sketch I want to be able to set individually the close pos and open pos in degrees for each servo attached to the servoPins, but at this stage of my knowledge, I dont know how to do it Jul 18, 2023 · This model railroad switch and signal control can easily be realised with an object. This opens up a wide world of control options for animations, sound and other options on a DCC equipped model railroad. PCB v3 version Jun 2021 also has a push button to store the accessory address. Make your schedule. All is good. Turnout Control —A frequent motivation for modelers to explore microcontrollers is the desire to use common off-the-shelf micro servos to run turnouts. We cover the mounting bracket and the Arduino Program used to control the rate the turnout changes and other accessories dependent on turnout position. Nov 26, 2016 · Can someone outline using Radio Control (R/C) Servos for actuating turnouts? I've seen servo mounts for doing this; but, am unsure of how to wire and how to actually move the points with a servo. When the arduino receives a request from JMRI to thrown the turnout (via whatever network protocol you have chosen - see above), have the arduino throw the turnout and set the sensor. Controlling a Kato turnout with an Arduino and power transistors (was Re: Kato double crossover power requirements) Robert Myers 11/27/20 #9982 Dave, Can you post a circuit diagram for the power transistor method? 200msec pulse worked for me, too. Now adding my first automated turnout. Apr 25, 2016 · Does anyone have any experience with using an Arduino to control servo motors to move the points on model railroad turnouts (specifically in HO scale)? I have built a small switching layout with seven (7) turnouts. All my locomotives are Digital Command Control, and First arduino project; a train speed measuring unit. See the image below: I started reading on some switching, but I can't find the right information for me. Turnout Control Using A Momentary Contact Button What’s In This Page About controlling turnouts and optional position indicator lights using momentary contact buttons. Some of my track Be sure to subscribe! Today we are doing an update to an arduino model railroad sketch that I did quite some time ago. I understand I need a separate power supply to power the Tortoise, but w Apr 28, 2020 · Very nice idea and one that could be used for other items than turnout control. With the right code it's easy to control Brief explanation of how I am controlling my turnouts using Arduino Mega and PCA9685. A Servo is a small device that incorporates a two wire DC motor, a gear train, a potentiometer, an integrated circuit, and an output shaft. In fact, one Arduino could control numerous train crossings (even more with Jan 24, 2019 · A basic model train layout containing a passing siding with a train running around and stopping in an automated sequence. These tiny, inexpensive, programmable computers can perform functions such as controlling signals, routing turnouts, and running animations. Jan 19, 2017 · I know I can get the Arduino to control the servo and that in turn can control the turnout. In this video I go in detail through the Arduino sketch I created for my first set of turnouts controlled by servos. To use this on the finished assembly, hold this butto… Dec 14, 2022 · Using Arduino to make a model railroad turnout decoder #Arduino Let’s Learn Together shows the most common actuators that are available to control a model railroad turnout: solenoid actuators DC motors servos and how to interface the first ones with Arduino, using relays or MOSFETs. But, as I am newer to this digital world, I fear Useful for any sized layout, either DC or DCC, this is a slow motion turnout control using push buttons to operate the turnouts from a control panel or facia Feb 21, 2013 · Hello, I'm working on an automation system for my hobby model train system, n-scale. Welcome back everybody! Be sure to Subscribe!In this video we take a look at how to control Kato turnouts with an arduino! It's actually a lot easier than Use an Arduino to easily control a Kato/Tomix turnout/switch motor - madleech/TurnoutPulser There is a program (sketch in Arduino terms) available that uses an Arduino to directly control turnout servos using the built-in library (see this blog post for the source), although it appears from later postings that the author changed his approach to use a driver card along with the Arduino. I have a very old railroad system, so-called 'Trix Express'. I am (finally) going to get serious about making a control panel and was thinking I would like push button control rather than toggle. Any Arduino boards and your model railway set. I needed a means to throw multiple switches to set routes through a hidden staging yard. The turnout position triggers the LEDs Apr 1, 2019 · A classic switch machine for change direction the turnout is connected to the outputs of this chip. Turnout motors always seemed a bit pricey to me until I learned about servos from a friend who’s a radio control (RC) enthusiast. Computerised turnout control will allow you to automate any movement over your layout. Jun 17, 2019 · Arduino based – Level Crossing Control – by John Cornell Inspired by some of some of Geoff Bunza’s work, John Cornell used an Arduino Uno to control level crossing (grade-crossing) booms and LED flashers.