Skip to main content

I have a legacy subway which I love. However, one thing I don't like is that there's no way to automate the operation of the set like the MTH sets have. ie, program the route, set it auto mode and let it run. Is there any way to have this kind of functionality with the Lionel set? Currently, to automate the operation somewhat, I threw together a recording in which, the set moves plays the next stop announcement then stops, opens the doors, play the current station stop, then the set moves again and repeats. A few issues with this:

1. It's inconsistent. When creating the recording, at some stops, I didn't stop the train in the same spot. 

2. The whole route can't be played in one recording. I have the train run 16 stops of a 29 stop sequence. I therefore, have to press the record button again and have the train continue along the route. 

3. No automatic reversing. When the set gets to the end of the route, I have to manually hit the direction key to have it run the other way and go back uptown. 

Again, I ask, is there any way to automate the operation of the set? (similar to how the MTH sets operate). I saw a document about the legacy command protocol and wondering if a script could be written to do what I seek. I'm in school for Computer Science and know a bit about programming in Python and Visual Basic (Not sure if those are of much use here) Thoughts on this? Also, does anyone know the language(s) Lionel programs in? 

Original Post

Replies sorted oldest to newest

Matt, it would be possible to program automated operation by sending commands to the Legacy base through the serial port.

However, you would probably need to have some hardware to detect the train at each stop. This might be doable with the LCS sensor track, but I don't know anything about that system.

However, it would not possible to detect the train with an isolated 3rd rail or an infrared sensor, have an Arduino read those inputs, and then use the Arduino to send the appropriate command to the Legacy base. I have automated my entire layout with such a system. The most challenging part would be interfacing your train detection to the Arduino, but it is not too difficult if you like tinkering with electronics. The Arduino is essentially programmed in C++.

Matt, it would be possible to program automated operation by sending commands to the Legacy base through the serial port.

However, you would probably need to have some hardware to detect the train at each stop. This might be doable with the LCS sensor track, but I don't know anything about that system.

However, it would not possible to detect the train with an isolated 3rd rail or an infrared sensor, have an Arduino read those inputs, and then use the Arduino to send the appropriate command to the Legacy base. I have automated my entire layout with such a system. The most challenging part would be interfacing your train detection to the Arduino, but it is not too difficult if you like tinkering with electronics. The Arduino is essentially programmed in C++.

Thanks for the info. "However, it would not possible to detect the train with an isolated 3rd rail or an infrared sensor, have an Arduino read those inputs, and then use the Arduino to send the appropriate command to the Legacy base. I have automated my entire layout with such a system." Did you mean to say, it is  possible to use an Arduino? Also, I forgot to mention, I do have a raspberry Pi, could the same thing be accomplished?

Last edited by Trainlover9943

Hi Matt - oops, editing error;  it would be possible"!

I've not worked with a Pi, but I think you could do the same thing as long as keep the Pi's 3.3v supply in mind when interfacing to the command base (RS-232) and the track occupancy sensor of your choice.

As an example, here is a track occupancy circuit I use to get a clean 5v logic signal from an isolated third rail on the track. You could probably use a simpler circuit if you wanted to clean up the signal in software, or use an infrared detector.

sensor

Attachments

Images (1)
  • sensor

Hi Matt - oops, editing error;  it would be possible"!

I've not worked with a Pi, but I think you could do the same thing as long as keep the Pi's 3.3v supply in mind when interfacing to the command base (RS-232) and the track occupancy sensor of your choice.

As an example, here is a track occupancy circuit I use to get a clean 5v logic signal from an isolated third rail on the track. You could probably use a simpler circuit if you wanted to clean up the signal in software, or use an infrared detector.

sensor

Cool! I'll have to get the materials together and get to work. Writing the program may be a challenge though. 

You might find this simple Arduino code helpful. It shows how to transmit Legacy fixed 3-word (9-byte) commands, based on the description on pp. 10-11 of the Legacy protocol specification.  This example uses subsystem 2 for triggering dialogs; you would use subsystem 4 for subway stops as shown on pp. 15-16. 

For starting and stopping the train you would use the 3-byte engine or train commands as described in pp. 8-9 of the protocol.

Attachments

You might find this simple Arduino code helpful. It shows how to transmit Legacy fixed 3-word (9-byte) commands, based on the description on pp. 10-11 of the Legacy protocol specification.  This example uses subsystem 2 for triggering dialogs; you would use subsystem 4 for subway stops as shown on pp. 15-16. 

For starting and stopping the train you would use the 3-byte engine or train commands as described in pp. 8-9 of the protocol.

Cool stuff. Thanks! Was that document made by you or someone else? Also, was it in C++ or another language? 

Add Reply

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