It’s always nice to have a mobile handheld speed control. Some modern Command Stations have network capabilities and iOS or Android throttles are available. However … many of us prefer to have a physical knob in our hands in stead of swipe on a screen.
A very nice solution is the Mobile Control (ESU, Piko). It connects via the network, has a host of functionality, but it sets you back a whopping €300.
The Roco / Fleishmann Multimaus can be had for around €90,- (or maybe €60,- second hand). Since it generates DCC, it must be connected to the ‘DCC sniffer’ input of your Command Station (provided it has such an input).
This DCC sniffer input on my ECoS made me wonder about a low cost do it yourself solution. What if we could use an Arduino to generate DCC? Well … we can! Several Arduino DCC encoding solutions have already been published on the internet. I adopted one of them, added a bit of code and here it is … a handheld throttle for just €6,-.
REMARK 1: the throttle described here sends out a DCC signal, therefor it will only work in cooperation with Command Stations that have a so called ‘DCC sniffer’ input. The ESU ECoS has this input. Others may have it too, please check your CS specifications.
What the throttle does:
Speed of a loco can be controlled with the large knob.
Forward / backward is changed when the knob is rotated fully to the left and the knob switch is activated. The LED’s show the direction: forward = green, backward = red.
The loco address can be changed via push button 4. Consecutive presses step through a list of given addresses. There are no visuals that show which loco is selected. For an Arduino hobbyist it would not be difficult to add some LED’s for this, or even an LCD a display that shows current loco address and current speed step and direction.
Lights, F1, F2 can be switched on / off via push buttons 1,2,3.
SCHEMATICS:
HARDWARE NEEDED: (prices based on Aliexpress)
– 1 Arduino Uno or Nano – €2,70
– 1 DCDC up-converter – €0,90
– 1 npn transistor (a BC547 will do fine)
– 1 red and 1 green LED
– 3 1k resistors
– 1 4k7 resistor
– 4 push buttons €1,60 (per 10)
– 1 10k potentiometer (*) with built in switch – €1,50
– 1 knob for the potentiometer – €0,10 – €5,00
– a piece of wood or a fancy plastic case that can serve as the housing
(*) It depends on your personal preference if you choose a linear or a logarithmic one. I chose logarithmic, it makes control of low speeds more accurate, which is nice for shunting work.
POWER SUPPLY options:
– USB cable connected to a PC or a mains USB power adapter.
– A 12V DC power adapter.
– 9V battery, held inside the throttle housing, means one cable less running from it.
SOFTWARE: this is link to the SOFTWARE DOWNLOAD.
Move the folder that’s inside the libraries folder to your Arduino libraries folder.
Move the folder RB_DCC_Throttle_28 to your Arduino sketches folder.
To configure the loco addresses, modify these two lines:
byte max_locs = 5;
byte LocAddress[] = {23,32,52,64,125};
Only short (one byte) addresses are allowed. Take care … use the address that you configured as the ‘loco sniffer address’ in your ECoS (or other command station).
REMARK 2: The DCC output of the throttle is not AC, it is a signal between 0V and 20V. Most DCC sniffer inputs have an internal opto-coupler. If the throttle does not work when connected, then most probably the opto-coupler does not see a positive voltage. Swap the DCC sniffer wires and all should be OK.
Have fun!
This is great what I would like build is multi channel control with 4 controls. Or would it be simpler to have 4 single throttles driving one DCC controller and motorshield
LikeLike
Can the software also be downloaded outside of dropbox?
LikeLike
Very interesting project!
How hard would You say that it would be to adapt this into a LocoNet throttle? I assume that the physical interface isn’t too hard to design, but are there libraries for LocoNet comunication?
LikeLike
Addendum:
I found this interface circuit: https://mrrwa.org/loconet-interface/
LikeLike
Yes there is a Loconet library. I’m working on a Loconet throttle and there is a prototype that works with the DR5000, alas not yet with Digitrax. I have too little time at the moment to continue the project.
LikeLike
Good to hear.
My thoughts are something like this: https://www.dropbox.com/s/a5ipkrabbkaxu4p/Schematic_Analog%20DCC%20throttle_Sheet_1_20200121110830.pdf?dl=0
with a display like this: https://learn.sparkfun.com/tutorials/using-the-serial-7-segment-display/all
LikeLike
Hi there really impressed! not sure you still look at this but this would be a really useful set up if it worked directly with a motor shield maybe with a nano. this would make a very cheap customisable controller for a single or low number of locos, i have been desperately looking for a cheap dcc throttle for some very simple layouts I have been just looking for the final piece can you help? Thanks M
LikeLike
In the Video, from 3:10 to 3:13, Rudy says: “It is a little bit Medieval, but it works!”
– Rudy, you are a FUNNY man.
Rudy, as far as I can tell, your IDEAS have sparked a lot of activity by other Railway/Railraod Modellers. So, I wouldn’t worry about the way Version Zero of the hardware looks!!!
Some people ‘Invent’, and others ‘Enhance’. Keep up the great work Sir!!!
LikeLike
Can you use the output signal to drive a motor shield?
LikeLiked by 1 person
An Arduino output can drive a servo motor input signal, the servo power comes from a 5V supply. I don’t know your ‘motor shield’ but assuming it is one of the types that makes it easier to plug your 3 pin motor connectors in, I would say yes.
LikeLike
So if I am correct your program issues DCC++ commands with a decoder address attached so that a decoder can respond when addresses by your program? That is interesting: this means you could use this as a mobile controller such as the ones developped by David Bodnar: http://www.trainelectronics.com/DCC_Arduino/DCC_Booster/
In your setup the DCC signal output can then be fed to a motorshield on top of the Arduino; instead of a power booster you would then need a capable (2A+) power supply into your handheld unit or else connect your handheld unit to a remote booster which receives the signal from your unit and feeds this into the tracks…
Let me know if this sounds feasible please?
If so your setup opens a lot of possibilities with open source systems.
LikeLike
Yes, all your ideas sound feasible. The Arduino indeed sends out DCC commands for a certain address. Right now one of the push buttons is used to step through a list of hardcodd addresses so you can even control multiple locs. A further enhancement coild be to add an lcd display and maybe a nicer way to select locs. Other push buttons are used to toggle functions like light or sound. With a proper power supply and an H-bridge power FET circuit a mini DCC control can be made for very little money.
LikeLike
I see an issue with the use of pin 3: a motorshield uses that, and pins 11,12,13 for dir and pwm. So your program would need to have pin 3 changed to another input: maybe pin 2?
An alternative would be to keep your program but use a pro mini instead of an Uno -to save space and power- and send the DCC++ signal to a booster with motorshield elsewhere, near the track for example. Then no need for the DC-DC-upconverter either: the TTL DCC signal can go to the motorshield input, and the booster provides the 18V at the motorshield.
LikeLike
Unless used as a hardware interrupt input, pin numbers can freely be changed in the code of course.
LikeLike
so if i understand correctly if you hook this up to a motor shield with power instead of the dc up converter this would be able to directly connect to the track and control a loco? I have a simple set up this would be ideal for. Can you get this to broadcast to all addresses instead of a list? i only have one logo. also how would you change the code to deal with a potentiometer with a centre detent. so left is backward and right is forward. also can you add more function buttons ?
LikeLike
You’ll need an H-bridge power unit. If you’d google on DCC++ I bet you will find solutions. A center pot would be possible. Broadcast to all addresses could be an issue, I would not know why you’d want that? Function buttons can be added. This was just a fun project, if you like the fun of doing it that is nice … a second hand MultiMaus with DCC power station, which can be had for around €50,- would be an easier solution though. :)
LikeLike
1 LED, 2 LEDs not LED’s
LikeLike
Rudy, excellent use of an arduino….I am about to start creating one however, can you show where the other end of the usb wire connects?
LikeLike
It’s only used to power the Arduino. It connects to either a PC or a USB power adapter.
LikeLike
Excellent addition to the ecos CS Ruud, I really have to build one of these!
Just as a comparison with the proprietory controllers you list…………does the Roco unit, that you say would cost around 60 euro, have output for connection to the ecos sniffer inputs? Or would I need to have the 10764 multicentrale controller and PSU as well? If so would be way more than what you say?
Alf :o)
LikeLike
You’ll need the Roco Multimaus that comes with a black box booster that powers the rails. In this case you connect it to the ECoS DCC sniffer input.
Be aware that the ECoS DCC sniffer has some quirks. Function buttons often only register after a change of loco direction. It’s a known problem with the ECoS but I doubt if they will ever mend it in future firmware versions.
LikeLike
Dag Rudy,
Wil it work with a z21.
Kan ik het laten werken met een z21?
Hans de Bruijn
LikeLike
If the z21 has a DCC sniffer input then it will work.
LikeLike