Skip to main content

This project was a follow-up to the one I posted here, about using a Moteino radio module to transmit TMCC commands to a compact board that would control the MTH signalman caboose. The MTH caboose has very little space for a remote control board, so I was looking for something that would provide the remote control functionality of an ERR Mini Commander in a smaller space (and at lower cost). The system I came up with used one Moteino module to read TMCC commands from the Legacy Command base over a serial line, and then use the RFM69 radio link to send those commands to a module installed in the caboose.

The original version required some modifications to the caboose to power the board, and required a separately powered serial interface to the Command Base to transmit commands over the radio link. I decided to improve the setup by (1) powering the remote board directly from track power, using the existing plugs in the MTH caboose, and (2) for the master board that transmits the TMCC commands, providing an optional plug-in interface to the LCS system over the PDI bus.

Here's the new board. It uses a Pololu regulator to supply 3.3v to the Moteino, and I managed to squeeze 440 uF of capacitance in to keep the system powered through momentary interruptions. One plug connects the board to track power, and the other plug delivers power to the caboose motor, under the control of an SSR activated by the Moteino. (To keep the board as small as possible, the SSR is actually under the voltage regulator.)  The board then fits on top of a Moteino to achieve a low-profile stack that will fit in the MTH caboose:

The separate regulator bumps up the price a little, but the system will also work with the Anarduino Mini Wireless (915 MHz CW model), which is available on eBay for $15.00.  So the total price of each installation is about $25.00.  Here is the Moteino version installed in the MTH signalman caboose, and an Anarduino installed in a Lionel merchandise car:



Here's the schematic and BOM for the remote board.  This version uses a SSR to control the output, but it would be pretty easy to design one with a triac or transistor output if you wanted to regulate the AC, or deliver DC.

If you want to make this board yourself, the Gerber files can be found here.

The next posts will describe the board that sends TMCC commands to the remote boards, and the Arduino sketches that run it all.

Attachments

Images (5)
  • mceclip0
  • mceclip4
  • mceclip1
  • mceclip2
  • mceclip3
Last edited by Professor Chaos
Original Post

Replies sorted oldest to newest

To transmit TMCC commands to the remote nodes, we need something that will read output from the Command Base and send those commands over the RFM69 radio link.  If you have a serial connection to your command base, like a SER2, you can use that to interface with the serial data.  But then you need to power the transmitting board with another supply, and worry about whether you're shorting the Command Base earth ground to track common. So I designed a simple interface that plugs into the LCS PDI interface, and powers the transmitting Moteino from the LCS 12V supply. The board is just a plug for the PDI cable, and a RS-232 to 3.3v TTL converter.  I used the ADM3203ANZ because it was cheapest, but any MAX3232-type chip that can run on 3.3v should work as well.  (We need 3.3V because the Moteino runs on 3.3v).  

Here's the PDI interface board, and installed as a shield on the Moteino:

Gerbers for this board are here.

The next post will describe the software end of things.

Attachments

Images (3)
  • mceclip0
  • mceclip1
  • mceclip2

The system works like this:  there's a  'master' Moteino that's connected to the TMCC serial line or LCS PDI bus. Because I'm using the Radiohead "reliable datagram" protocol, which requires the receiver to acknowledge the message, I wanted the master to only send messages when it reads a TMCC command destined for a remote node on the system. (Otherwise, the system would spend a lot of time waiting for a reply from non-existent nodes).

So, each remote node (that is, installed in an operating car or elsewhere) sends a registration message to the master node when it powers up, which includes the node's TMCC address. The master node keeps a list of the nodes that have registered, and only passes on TMCC commands that are addressed to registered nodes.

The software on the master end is pretty straightforward:  read TMCC commands coming in from a TMCC serial line or Legacy PDI interface, and pass those commands on to the registered nodes.

On the receiving end, after the nodes send their registration messages, they wait for TMCC commands addressed to them, and turn on the remote board's SSR when commanded. In this version, the nodes only respond to AUX1 presses, but you could change the program to a more complex control sequence if desired.

Nodes can be programmed as ENGs or ACCs, and have three modes of control:

  1. Toggle, in which AUX1 toggles the input on and off.
  2. Momentary, in which the actuator stays on as long as AUX1 is being held down.  I use this mode for the Lionel merchandise car.
  3. Fixed, in which the actuator stays on for a pre-programmed length of time. I use this mode for the MTH caboose, since the caboose motor needs to be activated for about 4 seconds until it closes a microswitch and completes the rest of the cycle on its own.

I think that covers it.  If you're interested, the master sketch is here, and the node sketch loaded in the remote cars is here.

As compared to the ERR Mini Commander, the board I've designed is less capable, since it only provides an on-off delivery of track power to the output. But it would be fairly easy to design a more complex Moteino shield that included several outputs, including trials for variable voltage control. The system also requires you to install a master node, to transmit TMCC commands over the radio link. On the other hand the cost of the system is considerably less, and you can easily change the sketch in the nodes to achieve whatever kind of complex behavior you want.

Right now if you're using the LCS PDI connection, the master board has to plug into the end of your PDI bus, since it doesn't pass the PDI commands along. If there's any interest I could design a version with two serial ports that could plug in between LCS modules.

Currently the behavior of the node is fixed when you upload the sketch into the Moteino/Anarduino.  It could be possible to make a version that emulates the Mini Commander's "SoftSet," and can be programmed for a new TMCC address or mode with TMCC commands.  But since anyone using the system has to be able to program their own nodes, I don't know if that would be worthwhile.

I've used this system for low-cost control of operating cars, but of course you could use it to wirelessly control accessories, switches, lights, etc. with minor modifications to the node design.

Hi John - I overlooked the need to add the Moteino boards!

It should work if you add the following to the list of "Additional board manager URLs" in the Arduino preferences:

https://lowpowerlab.github.io/...wPowerLab_index.json

Does that fix it?  I am having some trouble compiling on a new machine but I think it may be an Apple silicon problem.

Last edited by Professor Chaos

I guess it insists on having the board connected to select it?  I added that previously, but it's still insisting I select a board.  However, I can't find that board in the board selection menu.  Below is everything I can select, I find no way of coaxing this into adding the board.  I've always used this with a recognized Arduino board, usually the Uno or Nano, so I never ran into the issue of trying to add a non-standard board.

 

Attachments

Images (3)
  • mceclip0
  • mceclip1
  • mceclip2

I found it this time by searching on it, I'm using 2.0.4.  I was trying to scroll through the list, and didn't see it.

Got a little farther, but clearly I'd have to spend more time to pull out all the radio stuff, I want to create a code base to read serial data directly from the locomotive serial data feed.  I'm not sure I can unwind all the extra stuff in any reasonable amount of time.

Add Reply

Post

OGR Publishing, Inc., 1310 Eastside Centre Ct, Ste 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×