Arduino Application: Using a TV Remote to Trigger Events on a Model Railroad

I was surfing around the Internet looking for additional ways I could incorporate an Arduino into my model railroad. I had already used an Arduino, as described in this Forum, to control both crossing gates and flashers at two separate road crossings. What caught my interest were several Internet articles about using a TV remote control with an Arduino.
One in particular, at http://howtomechatronics.com/tutorials/arduino/control-any-electronics-with-a-tv-remote-arduino-ir-tutorial/, is an excellent tutorial explaining the technical aspects of IR remotes and contains a number of examples using the Arduino. The Arduino is used to translate the infrared signal from the transmitter to numerical codes that correspond to the pushing of each button on the remote. Fortunately, as with many Arduino libraries, someone had already worked out the hard part of counting and transl

I apologize for the formatting of the comments in my Arduino code. I still haven’t figured out how to get this right when copying Word text to the Forum.

Option 1:
You do have the option of playing back wave files with the SD card reader version of arduino. You can use any audio rip from youtube of trains for background sounds.

Option 2:

I had some left over computer speakers from a 5.1 setup. I thought about hooking into JRMI and running their 3D sound set that allows up to 256 sound streams using OpenAL Soft 3D Positional audio, including doppler shift, movement reverb, mountains. Reading a com port for the arduino is no issue.

I was actually playing with it this weekend. Turned down low it’s quite believable. The authors of JMRI were clever to think of this.