An Inexpensive Servo Controller with Dead-Rail Control

OK, you converted your locomotives to dead-rail (battery power, radio control) in part to eliminate the hassle of wiring the tracks and its attendant complications (polarity reversal on loops, etc.). But what about controlling other elements of your layout, including servos that have many uses, such as track switches and semaphores?

This post shows you how to make a low-cost (about $30-$40) servo controller (for up to 10 servos) that can be controlled with the same throttles you use for dead-rail control of your locomotives. The servo controller is based on this excellent Instructable: DCC Accessory Decoder Using Arduino Nano. Please read through this link to familiarize yourself. The significant difference between this post and the Intructable is we will obtain our power through a power plug or USB cable and receive our DCC from a ProMiniAir Receiver. I’ll give you those details below.

Components

What you need:
Arduino Nanohttps://www.amazon.com/dp/B09KGVDXZY?psc=1… (<$7.00ea).
Arduino Nano Servo Breakout Boardhttps://www.amazon.com/dp/B07VQRCC8F?psc=1… (<$2.50ea). You can connect up to 10 servos, each with a different DCC address, if you want.
Servoshttps://www.amazon.com/dp/B07L2SF3R4?psc=1… (<$2.00ea).
Power: A wall-wart 9V DC power supply (~$7.50). You can use a “Type C” USB cable for power (and data/programming connection), which costs about $5.00 for the cable and power converter.
Receiver: A bare ProMiniAir Receiver – no amp is needed. Please contact me for this low-cost item ($14). The PMA Receiver gets +5V/GND power from the breakout board and sends +3.3V Logic DCC received wirelessly to the Arduino Nano (via the breakout board’s Pin 2), which contains the DCC accessory decoder firmware.

Configuration

Physical Configuration: Mate the Arduino Nano into the Arduino Nano Breakout Board. Power is provided by either a 9V power converter that uses wall power or a USB connector that also provides a data link for downloading the firmware and establishing a serial connection for configuration.

The detailed connections from the Breakout Board to the ProMiniAir Receiver and the servos are shown below. The ProMiniAir Receiver connections 1) provide power to the ProMiniAir Receiver and 2) receive +3.3V logic DCC produced by the ProMiniAir Receiver. Up to 10 servos may be connected to the breakout board.

Closeup of connections to the ProMniAir Receiver and the servos.

Firmware and Configuration: Obtain the open-source software from the instructable URL (free). After loading the firmware into the Arduino Nano via the USB connection with the IDE of your choice (I use the Arduino IDE), you use the USB serial connection to configure the servo’s DCC address and motion parameters. This step is described in the Instructable.

As described in the Instructable, configuration is performed using the USB serial link. For the demo, I used the Arduino IDE serial monitor to enter the following commands to configure servos 3 and 4 (the number refer to the pin groups labeled on the breakout board, so the 10th servo is on pin group 12):

s 3 37 40 0 0 \n
s 4 37 40 0 0 \n

These commands are broken down as follows:
s pin-assignment dcc-address swing-degrees invert(0=no) continuous(0=no)

Demo

The photo below shows the components of the demo. The WiThrottle smartphone app communicates with the WiFi-equipped EX-CommandStation (see the inset in the image below) that is integrated with a ProMiniAir Transmitter that wirelessly transmits DCC commands to the ProMiniAir Receiver connected to the Breakout Board. This Transmitter is available on eBay by searching for “ProMiniAir”. Power is provided by a 9VDC power converter using wall power. A USB cable connected to your computer or a USB power conversion plug can be used.

Overview of Servo Controller.

A ProMiniAir Transmitter connected to a standard DCC Throttle, also available on eBay, will, of course, also work. Because the ProMiniAir Receiver is compatible with Airwire throttles, they can also be used to wirelessly control the servos using the “ACCY” (ACCessorY) button.

All DCC throttles and throttle apps can control both locomotives and DCC accessory decoders. The details vary from throttle to throttle, but they ALL can control accessory decoders. Below is the demonstration. Note the “Turnout” has been selected with accessory DCC address 37.

Wrap Up

I hope this post shows you that dead-rail control extends to other components of your model railroad: dead-rail is not just for your locomotives!

A Low-Cost WiFi-Equipped DCC Base Station for the ProMiniAir Transmitter

The new, stand-alone ProMiniAir transmitter integrated with a WiFi-equipped EX-CommandStation

Many model railroaders enjoy using a hand-held throttle or smartphone app that connects to a centralized DCC command station that sends DCC over the tracks to decoder-equipped locomotives, and some “dead-railers” enjoy a similar experience using specialized hand-held transmitters such as the CVP Airwire or Stanton Cab throttles. These dead-rail throttles are expensive and sometimes hard to find due to supply chain problems. Other hand-held dead-rail throttles only support their proprietary receivers and “vendor-lock” users because they have no interoperability with other dead-rail vendors 🙁

On another page, I showed how easy it was to use a smartphone equipped with a “wiThrottle-compliant” app in conjunction with the ProMiniAir transmitter to control your dead-rail locomotive(s) fitted with a variety of receivers such as ProMiniAir, Tam Valley Depot DRS1, CVP Airwire, Stanton Cab, QSI Gwire, and NCE. The downside was that you must invest in a WiFi device for the DCC base station connected to the ProMiniAir transmitter. Many folks pushed back on the additional cost and infrastructure to use their smartphone app for dead-rail control using the ProMiniAir transmitter.

I searched for a way to provide a low-cost way to use your smartphone in conjunction with the ProMiniAir transmitter, and this post shows the low-cost solution that I offer for sale.

The solution: I came across a low-cost way to create a small DCC base station equipped with WiFi at a very active group, DCC-EX, and I will describe how I configured this base station to use a smartphone to control dead-rail locomotives equipped with ProMiniAir, Tam Valley Depot, CVP Airwire, QSI Gwire, NCE, or Stanton Cab receivers.

The wiThrottle-protocol smartphone apps that will work with this solution include (this list is from DCC-EX):

The critical point is that the ProMiniAir transmitter, coupled with the WiFi-equipped EX-CommandStation, is an entirely self-contained solution for $49.99 on eBay (search on eBay with “ProMiniAir” to find this device). All you need to do is apply power and then connect with a smartphone throttle app for mobile control of dead-rail.

If you don’t want to go through the details of the solution, you can jump to the Instructions below.

The Solution

The DCC-EX team has developed an open-source, low-cost DCC controller EX-CommandStation. Here is the DCC-EX team’s description (reprinted from here):


An EX-CommandStation is a simple but powerful, DCC Command Station that you can assemble yourself and which is made using widely available Arduino boards. It supports much of the NMRA Digital Command Control (DCC) standards, including

  • Simultaneous control of multiple locomotives and their functions
  • Control of accessory/function decoders
  • Programming Track
  • Programming on Main Track

It includes advanced features such as:

  • wiThrottle Server implementation,
  • General purpose inputs and outputs (I/O) for extensibility, and
  • JMRI integration

The primary intention of the EX-CommandStation is to receive commands from multiple throttles and send out DCC on tracks. These throttles can be “wired” or “wireless:”

  • USB
  • WiFi
  • Ethernet
  • Bluetooth
  • JMRI

With the WiFi-equipped EX-CommandStation, you can use a wiThrottle-protocol smartphone app that connects to the EX-CommandStation via WiFi. Then the EX-CommandStation’s +3.3V logic DCC output is not sent to a “motor shield” to power tracks but instead serves as a direct input to the ProMiniAir transmitter for dead-rail control. It’s that simple; the technique was easy to implement and is low-cost ($49.99 on eBay, instead of paying for a WiFi device that connects to a commercial DCC throttle, a total of over $200).

Instructions for Using the ProMiniAir Transmitter/WiFi-Equipped EX-CommandStation with a Smartphone

What you need:

  1. A smartphone loaded with the wiThrottle-compliant app. See the list above.
  2. A properly configured ProMiniAir Transmitter/WiFi-equipped EX-CommandStation. We provide this.
  3. A locomotive(s) equipped with receivers compatible with the ProMiniAir transmitter, such as:
    • ProMiniAir receiver
    • Tam Valley Depot DRS1 receiver
    • CVP Airwire receiver: CONVRTR 15/25/60, G-3/4
    • Gwire receiver
    • Stanton Cab receiver
    • NCE D13DRJ wireless decoder

Steps:

  1. Plug the USB power into the PMA Tx/WiFi-equipped EX-CommandStation, which turns on the ESP32 WiFi transceiver to broadcast information for your smartphone to pick up, boots up the EX-CommandStation itself, and powers up the ProMiniAir receiver and the OLED displays. You can connect a USB battery pack to the ProMiniAir transmitter/WiFi-equipped EX-Command station for “take it anywhere” capability.
  2. Go to the smartphone’s WiFi settings:
    1. If you have a home router, turn off auto-join, which prevents your smartphone from jumping to your home router rather than the DCC-EX WiFi router.
    2. Select the EX-CommandStation’s WiFi router. The router’s name is “DCCEX_123456,” where “123456” is a unique series of numbers and letters (the “MAC address” of the WiFi transceiver).
    3. When asked for a password, enter “PASS_123456”, where “123456” is the exact string of numbers and letters in the router’s name. You will probably need to enter the password only once since your smartphone will probably remember the password.
    4. The “fiddle factor:” Sometimes, the smartphone will complain it cannot connect to the DCCEX router or that the password is incorrect. Ignore this complaint (assuming you entered the password correctly) and try connecting again. The smartphone will often successfully connect once you select the DCCEX router again.
    5. You might want to turn on the auto-join option for this router so that your smartphone will automatically try to connect once the WiFi-equipped EX-CommandStation is powered up.
  3. Once connected, go to your throttle app:
    1. When asked for WiFI router configuration, set the IP address to “192.168.4.1” and the port to “2560“.
    2. Once your throttle app connects to the EX-CommandStation, you can select your loco(s), etc.
  4. Turn on your dead-rail locomotives, and control them with your smartphone app!
  5. Once finished with the throttle app, you can go back to settings and re-select the auto-join option for your home router.

So here is the “proof of principle” demo. The photo below shows the prototype solution: a low-cost EX-CommandStation with integrated WiFi connected to a ProMiniAir transmitter. The video shows the iOS “Locontrol” app connected to the PMA Tx/EX-CommandStation with WiFi to control a dead-rail locomotive equipped with a ProMiniAir receiver and a DCC decoder that controls loco speed and direction, lighting, sound, and smoke. The Locontrol app is excellent because you can record video while controlling the locomotive.

The solution is a low-cost EX-CommandStation with integrated WiFi connected to a ProMiniAir transmitter. Up to five smartphones with WiFi throttle apps send commands to the WiFi receiver connected to the centralized command station, generating DCC output that the ProMiniAir transmitter sends to onboard locomotive receivers. NOTE: In current versions, Pin 18 instead of Pin 7 is the +5V DCC data connection to the PMA transmitter.
Detailed connections
Video of using the iOS Locontrol app with the PMA Tx/EX-CommandStation with WiFi to control a dead-rail locomotive equipped with a PMA receiver and DCC decoder

Programming on the Main (PoM) or Service Mode

OK, these smartphone throttle apps are great, but they have a limitation: they can’t currently send commands in PoM (OPS) mode or Service Mode to change the value of configuration variables “CV” in a decoder. This capability is necessary when you need to change the configuration of the ProMiniAir transmitter (whose default DCC address is 9900), such as the wireless channel (CV255 = 0-18) or power level (CV254=1-10). Of course, you might also need to make CV changes to your dead-rail locomotive’s DCC decoder using PoM (OPS) mode, too!

See the DCC-ex.com site for a full list of DCC-EX commands that you can send to the EX-CommandStation and ultimately to the dead-rail locomotives or DCC accessories.

You may NEVER change the ProMiniAir’s configuration, but you might. How to do this?

Solution #1

Both iOS and Android have apps that come to the rescue: TCP/IP to Serial Terminal and Serial WiFi Terminal. The apps provide a wireless connection to the EX-CommandStation to reconfigure the ProMiniAir transmitter (or receiver, for that matter!) or your dead-rail locomotive’s DCC decoder in PoM mode.

Since I own an iPhone, I’ll show you what to do using TCP/IP to Serial Terminal.

What you need:

Steps:

  1. Select the app and enter the IP address and port number, and then connect:
  2. Test using the status command, entering <s> (case sensitive):
  3. See the response:
  4. Enter the command to change the value of CV 255 at address 9900 to a value of 5 by entering <w 9900 255 5> (case sensitive):
  5. Verify that the ProMiniAir transmitter Channel, which is at DCC address 9900, has changed to 5:

The steps for using the Android app Serial WiFi Terminal should be similar.

Service Mode setting of CVs is also possible. The Service Mode command for changing the CV number CVnum to a value CVval is <W CVnum CVval>. The “W” must be uppercase. Changing the DCC address is even simpler: <W new_address>. Care must be used, since PoM commands will be used by all “listening” receivers, regardless of their DCC address!

So, there you have it, a wireless way to control a WiFi-equipped EX-CommandStation in Programming on the Main (PoM) mode (OPS mode) and Service Mode. While we need these apps to send PoM commands to reconfigure the ProMiniAir transmitter, you can enter any DCC-EX Command! Have fun!

Solution #2

If you have a Windows, macOS, or Linux computer or laptop, you can interact with the WiFi-equipped EX-Command station, including reconfiguring the ProMin Air transmitter. The technique is based on the “curl” program.

What you need:

  • A Windows, macOS, or Linux computer or laptop.
  • A WiFI-equipped EX-CommandStation

Steps:

  1. Connect the EX-CommandStation’s USB cable+USB converter to power. This powers up the WiFi-equipped EX-CommandStation and the ProMiniAir transmitter with its LCD.
  2. On your computer, select the DCCEX_123456 wireless router and, if asked, enter the password PASS_123456, where “123456” is a unique string representing the MAC address of the ESP8266 WiFi transceiver integrated with the EX-CommandStation.
  3. On your computer, start up a “terminal” session. A terminal session allows you to type in commands.
  4. Enter the following command curl telnet://192.168.4.1:2560. This opens a simple telnet-protocol connection between the computer and the WiFi-equipped EX-CommandStation at address 192.168.4.1 port 2560, the default EX-CommandStation address and port.
  5. Your command line will now wait for you to enter the text transmitted to the EX-CommandStation! As a test, type in <s> and press RETURN, and you should see a response such as
    <p0>
    <iDCC-EX V-4.0.0 / MEGA / PMA_Tx G-a26d988>

    If using curl on Windows, you may need to press RETURN then ^Z (CONTROL+z) and then RETURN again to “flush” out the response from the EX-CommandStation.
  6. OK! Now let’s change the ProMiniAir transmitter’s channel to “5” by using a PoM (OPS) command (DCC Address: 9900, CV#: 255, CV value: 5): type in <w 9900 255 5> and press ENTER. You will not see a response (sigh), but if you look at the ProMiniAir transmitter’s LCD, you will see the following:
  7. You exit the session by hitting < control>+C.

Pretty simple!

Solution #3

This solution is NOT all wireless but demonstrates how to use the Web-based WebThrottle-EX to control the EX-CommandStation.

What you need:

  • A computer or laptop
  • A WiFi-equipped EX-CommandStation
  • The USB cable that came with your EX-CommandStation

Steps:

  1. Connect the USB cable from the EX-CommandStation to your computer/laptop. This connection provides power and a data link to the PC.
  2. On your computer or laptop’s Chrome web browser, navigate this link: https://dcc-ex.github.io/WebThrottle-EX. An excellent throttle application will start, and the DCC-EX team has excellent instructions for using this application. We will concentrate on our narrow goal: getting OPS mode instructions to the ProMiniAir transmitter.
  3. Select the “Connect DCC++ EX” button to activate the USB serial connection to the EX-CommandStation.
  4. You will see a pull-down menu of USB ports. Select the serial port you think is correct, and if it is, the log window at the bottom will cheer your success. If not, try another USB port from the pull-down list.
  5. Now look at the Debug Console and ensure Debug in “ON.”
  6. In the “Direct Command” entry, type in a “direct” command. In our example, we want to send an OPS mode command (“w” for write) to DCC address 9900 (the PMA transmitter) to change CV 255 (channel selection) to the value of 3 (the channel we want to transmit on): w 9900 255 3.
  7. Press “Send,” and you should see the log window indicating the send. You should also see the PMA Tx’s LCD show a changed value, now with a new channel!
  8. Disconnect the USB cable.
  9. Use your smartphone to connect the ProMiniAir Tx/WiFi-equipped EX-CommandStation as described above.
  10. Have fun controlling the locomotive(s)!

Of course, if you maintain the USB cable connection, you can play with the WebThrottle-EX to control the dead-rail locomotive! The DCC+EX website has excellent instructions for using WebThrottle-EX. The traditional locomotive control capability and the powerful direct control capability are valuable and fun.

An important point: These instructions are ONLY for reconfiguring the ProMiniAir transmitter or changing the CVs in your DCC decoder. Under regular smartphone throttle app use, you do NOT need to connect anything other than the power to the WiFi-equipped EX-CommandStation to activate the ProMiniAir transmitter!

Final Thoughts

While I called this approach for using a smartphone app with the ProMiniAir transmitter a “compromise solution,” if you think about it, with a more centrally-located ProMiniAir transmitter coupled to a small, inexpensive WiFi-equipped DCC base station, you achieve good layout coverage because the base station is acting as an optimally-located “repeater,” potentially reaching more of the layout than your smartphone app. This approach is a valuable “division of labor:” the smartphone gives you the mobility to enjoy different vantages, and the central transmitter covers the layout optimally. So, maybe this approach is better than a “compromise solution,” after all.

Advantage of an optimally-located central transmitter versus a local transmitter.

Dead-Rail with Smartphone Apps for CVP Airwire, Tam Valley Depot, Gwire, and ProMiniAir Receivers

Typical configuration using smartphone/tablet throttle app with dead-rail

Introduction

Numerous excellent posts (here and here) describe how to use a smartphone to control model railroad locomotives, frequently using a “standard” DCC throttle or “station” as an “intermediary” that interlaces DCC commands from multiple sources and applies the resultant DCC power/signals to tracks that are picked up by one or more locomotives’ wheels electrically connected to a DCC decoder.

After reviewing these posts and understanding how this technique works, it’s a nearly effortless step to replace “DCC on the tracks” with wireless DCC transmissions to multiple locomotives. This “dead-rail” (battery-powered, radio-controlled) technique allows multiple locomotives to be simultaneously controlled from multiple throttles, be they smartphone apps or “standard” DCC throttles.

To be more specific, with minimal effort, it’s possible to use smartphone apps, such as WiThrottle, in conjunction with standard DCC throttles to control multiple dead-rail locomotives equipped with RF receivers from CVP (Airwire), Tam Valley Depot (DRS1 MkIII and MkIV), QSI (GWire), and OscaleDeadRail (ProMiniAir). Using other apps is also feasible, but I will confine this post to my personal experience and give you a specific example of how I accomplished this goal.

What’s Required

Of course, you will need to load a smartphone throttle app such as WiThrottle, and other apps are also for Android and iOS. For communication from the smartphone app to a standard DCC throttle, I selected the Digitrax LNWI WiFi Interface that connects via LocoNet to my Digitrax DCS52. Similar solutions are available for NCE DCC throttles using WiFiTrax and numerous other DCC throttle purveyors.

Finally, a ProMiniAir transmitter (abbreviated PMA Tx), interfaced to the DCS52 Track Right/Left output by a DCC Converter, is used as the dead-rail transmitter. This transmitter is compatible with multiple dead-rail receivers such as CVP Airwire, Tam Valley Depot (Mk III and Mk IV), Gwire, and the ProMiniAir.

The ProMiniAir transmitter is not merely a passive component in converting track-DCC to wireless DCC transmissions. It attempts to add a sufficient number of DCC “Idle” messages to the transmissions to keep CVP Airwire receivers “happy.” Otherwise, CVP Airwire receivers will not likely respond correctly to wirelessly-transmitted DCC. This feature makes the ProMiniAir transmitter unique among similar products that convert track-DCC to wireless DCC transmissions.

Putting it Together

The photo below shows the connections. If you think about it, the only aspect that is different from using track-based DCC and dead-rail is that the Track Right/Left output from the DCS52 throttle is connected to the ProMiniAir wireless transmitter (via the DCC converter that provides the ProMiniAir with 5V power and logic-level DCC) rather than to actual tracks – that’s all!

The connections for simultaneous dead-rail control by a smartphone app and a standard DCC throttle

I will now walk you through the steps I used to create the demonstration below.

Connect the ends of the LocoNet cable to the LNWI and the LocoNet port on the back of the DCS52. Plug the power into the LNWI, and connect the smartphone to the network provided by the LNWI. Then select the WiThrottle app, which has excellent instructions for choosing a locomotive’s address and configuration. In our case, we use the app to select DCC address #5000, a Z-5 with a ProMiniAir receiver connected to a Zimo MX696KS DCC decoder.

You connect to the LNWI’s WiFi server on your smartphone with SSID Dtx1-LnServer_XXXX-7, where XXXX is a unique number for each LNWI unit. Upon opening your WitThrottle app, it usually automatically connects to the LNWI; if manual configuration is necessary, you connect to address 192.168.7.1, Port 12090.

Then we use the DCS52 throttle to select our Cab Forward with a ProMiniAir receiver connected to a LokSound 4 L decoder at DCC address #4292. Once you turn on track power (which sends DCC to the ProMiniAir transmitter instead of the tracks), the DCS52 throttle will start interlacing DCC commands for locomotives #5000 and #4292, sent out wirelessly by the ProMiniAir transmitter. See the photos below that demonstrate this interlacing.

The PMA’s LCD shows the wireless transmission of a DCC packet to locomotive #4292 originally from the DCS52 throttle
The PMA’s LCD shows the reception of a DCC packet from the smartphone app for subsequent wireless transmission to locomotive #5000

Demonstration

Once you power on the locomotives, they listen and respond to DCC commands that match their DCC address, as shown in the video below.

Demonstration of the Z-5 (#5000, left) controlled by the WiThrottle app and the Cab Forward (#4292, right) directed by the DCS52

Conclusion

I hope you will agree that allowing one (or more!) smartphones/tablets and “standard” DCC throttles or control units to control multiple locomotives by wireless is not complex at all, and that’s part of the power and appeal of dead-rail.