Using an Infra Red Remote Control as a DCC Throttle
A simple project that allows an off-the-shelf generic remote control to be used as a DCC throttle connected, in this case, to the MERG CBUS DCC system.
Although the MERG system is used in this example, others can also be used with the right interface, Lenz for example would require an RS485 connection rather than CANBUS.
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.
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 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.
Enter locomotive address or toggle the functions 0 to 9
Select or release a locomotive
Press once to stop loco, press twice to stop all locos
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.