Skip to main content

I want to use an Arduino to send TMCC commands to my various TMCC engines, just like I can with my TMCC handheld controller.  Emulate my TMCC controller with an Arduino.  How do I get the TMCC RF parts to do this?  Cannibalize an existing TMCC controller?  Anyone tried to do this?

Original Post

Replies sorted oldest to newest

Both these ideas can be realized by connecting an Arduino to the DB9 serial port of a Base-1, Base-1L or Legacy Base. The TMCC and Legacy command specification is freely available. Note that to work with the full Legacy command set, an LCS SRE2 module is required. The SER2 is compatible with the Legacy and Base-1L, but not the original Trainmaster/Base-1 command base.

get the spec here: http://www.lionel.com/lcs/LCSP...er/styled/index.html

I thought that the DB9 port only allowed the TMCC base unit to talk to the TMCC controllers (ASC, BPC, etc.) but not to the engines via RF.  I want to be able to communicate with the engines via the Arduino.  Maybe I need to use the third wire that the Action Recorder uses.  Can you send me a link to a TMCC spec that might explain all this?

Hi Don - it's pretty easy to read and write TMCC or Legacy commands to and from the command base serial ports.  As Rudy mentioned, a SER2 is the most convenient way to go. Do keep in mind that the earth ground (ground for the command base) is supposed to be isolated from layout common (outside rail).

If you take a look at this link, you can find some of my Arduino projects. "Train Control" is a very complex system that automates train control, controls switches, signals, and accessories, and communicates with JMRI running on a computer.  But you will find examples of how to send TMCC, Legacy, and DCS commands over the Arduino serial port.

"Uncoupler Monitor" is a much simpler program that listens to the serial stream from the command base, and activates a relay module in response to commands directed to ACC 1-8.  Essentially a cheap and customizable version of the ASC.

For layout control I like the Arduino Mega, because it has four hardware serial ports. For accessories like the uncoupler monitor I like the Arduino Pro Mini, which is very small and costs less than $10. I am fiddling with transmitting commands from the Legacy base to HC-12 radio modules, with Arduino Minis in rolling stock picking up the radio commands (like a cheap and customizable Mini Commander).

 

I've been working on an Arduino-based project that controls my trains via Legacy, very much as Professor Chaos has done.  As Rudy says, you'll need an SER2 but the programming is pretty easy and Prof Chaos has been kind enough to share what he has done to help you get started. 

To send Legacy commands, you'll need the Legacy spec which requires (or used to require?) becoming an LCS Partner -- which is simple enough but you'll need to sign an NDA.

Here are the videos that Professor Chaos made that really inspired me on this project: https://www.youtube.com/channe...1UcTotGFTEih-nNVzL_w

I'm using 7 Arduino Megas, and my software monitors the location of all trains, throws turnouts, reserves and releases sections of track, blows the whistle, makes announcements, control accessories, and slowly accelerates and decelerates each train as it departs and arrives.  I've provided more detail in other posts, so if you're interested you might search my older posts.

Attachments

Images (6)
  • IMG_2118: Relays connect to track occupancy sensors
  • IMG_2239: Relays throw turnouts.  The "Train Control" Arduino connects via serial cable to the Legacy base.
  • IMG_2241
  • IMG_6405: Four of the seven Arduino Megas
  • IMG_6409: Shift registers used on control panel buttons and LEDs
  • IMG_7846: Control panel LEDs show what the Arduinos see: turnout position, train locations, and block occupancy.

You do not need to be a LCS Partner to get the Legacy Spec.  The TMCC and Legacy Specs are available in one document on Lionel's LCS page.  Now to get the the specs for all of the LCS modules and the format of the commands on the LCS bus, you will need to be an LCS Partner.  But if you just want to send Legacy commands you do not need to know anything about LCS, but you will need a SER2.  The SER2 is the only thing that will accept Legacy formated commands.  If you want to send them over wifi and use the LCS Wi-Fi module, then you will need to become an LCS Partner, like myself. 

If you are only going to use TMCC commands and not Legacy, then you don't even need a SER2.  You can connect directly to the Base-1's DB9 serial port.  In fact, I don't think it would work if you went through a SER2.  If you did I don't think the Base-1 would be able to recognize the commands.  As far as I know the Base-1 can only recognize native TMCC commands, and that would not be what it would be receiving if you went through a SER2.  I don't think any LCS module would work with the Base-1.  Rudy can confirn that.

If you have a hard copy of the TMCC manual,  then you have everything you need.  If you prefer an online copy you can search for it on Lionel's site under "Support".  I don't think the manual has ever changed though.

Harvy posted:

If you are only going to use TMCC commands and not Legacy, then you don't even need a SER2.  You can connect directly to the Base-1's DB9 serial port.  In fact, I don't think it would work if you went through a SER2.  If you did I don't think the Base-1 would be able to recognize the commands.  As far as I know the Base-1 can only recognize native TMCC commands, and that would not be what it would be receiving if you went through a SER2..  I don't think any LCS module would work with the Base-1.  Rudy can confirn that.

Correct, the original Base1 aka Trainmaster Command System is not compatible with and of the Layout Control System/LCS modules. Base1L and Base2 aka 990 Legacy Control System will both work with all LCS modules.

Based on the original poster's needs, no SER2 required.

Don Furgerson posted:

Thanks Harvy for the link to the TMCC Manual.  It has the general TMCC info that I already know.  Now I need to know the protocol for talking from the Arduino to the DB9 port on the TMCC Base Unit.  Where can I get that additional level of detail?

All of the information is in the attachment starting on page 36.  Let me know if you need help deciphering  it.

Don, the documentation for the protocol is here.

If you look in my Train Control program under the _interface tab, you will see routines for transmitting TMCC and the various kinds of Legacy commands.

I find it useful to have all the routines deposit commands in a circular buffer; another routine called from loop() sends commands out the serial port if at least 30 milliseconds have elapsed since the last command sent.

Add Reply

Post

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

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