Pass the remote
Using an Infra Red Remote Control as a DCC Throttle
The Remote Control
A very cheap, generic remote control bought from eBay for just £1.63.
The remote comes with a receiver in the form of a breakout boards that requires a three wire connection to the Arduino, power and one data connection.
There is a readily available IR Remote Control library for the Arduino that provides all the software required to read the remote control.
Solution
The diagram to the left shows the components in the solution. A display has been included to give feedback to show the locomotive being driven, the current speed and the direction.
An Arduino Nano is used as the processor to link the components together and because we are connecting to the MERG CBUS system we also have a CANBUS Interface. To use other DCC systems you would replace the interface box at the bottom of this diagram.
The Prototype
The prototype was built using an Arduino Nano plugging into a breakout board. Since it was to be shown at a MERG meeting I screwed the various modules to a small piece of plywood.
DuPont jumper wires are used to connect the modules, the extra little board you can see mounts a potentiometer to control the contrast of the LCD display.
Mounted next to the LCD is the IR receiver.
Button Usage
Button | Usage |
0-9 | Enter locomotive address or toggle the functions 0 to 9 |
OK | Select or release a locomotive |
Up Arrow | Increase speed |
Down Arrow | Decrease speed |
Left/Right Arrow | Change session |
# | Press once to stop loco, press twice to stop all locos |
Software
The software has to do three things
- Interact with the DCC Command Station over CBUS
- Read commands from the IR remote
- Update the LCD display
Fortunately there are libraries for each of these three things, it is just a case of adding the logic between them. This means what looks like a daunting job is made a lot easy as we benefit from the work of others in providing those libraries.
Anyone wishing to view the software can find it on GitHub by following this link.