Introduction: Garden Train - Arduino / Wireless DCC

A home made G-scale DMU train runs on brass track around the garden. Unfortunately, the lack of good contact is quite a nuisance to smooth running. To avoid the need for electrical contact, I have converted the train to run off a 6000 maH battery pack (recharger for phones etc).

The DC motor runs around 250 mA so the Lenz standard decoder 10231 at 1 Amp output is fine. I also installed a MRC 1662 DCC diesel sounder in parallel with the 10231.

The transmitter is simply a RFu328 mounted on strip board and a series of push buttons to select functions along with a potentiometer to control speed.

The receiver is another RFu328 that decodes the wireless transmission and converts data into standard NMRA DCC format. It is in fact, small version of my DCC controller (see other instructable).

A small scale DCC booster is included using the SN7544110ne quad h-bridge chip which suits the motor in use.

To get a push-pull output swing of 20 volts (+- 10v), the DCC signal is fed into one input and an opposite, complimentary signal is fed into the other input. The resulting output provides the DCC output for the motor and all functions. More detail to follow

Step 1: Transmitter

Picture of Transmitter

The circuit diagram is attached.

Components used:

RFu328 Arduino / SRF wireless module : £16 (Wireless Things Ltd)

AMS1117 step down from 4.5v to 3.3v : £2.55 (ebay)

Push buttons (NO momentary) 10 off : £10.62 for pack of 10 from Farnell

Potentiometer 4k7

3 x AA batteries

On/Off switch and LED

Total cost of components for transmitter, including box, approximately £40

The Arduino code is attached.


Step 2: Receiver

Picture of Receiver

The circuit diagram of receiver is attached.

Components used:
RFu328 Arduino / SRF wireless module : £16 (Wireless Things Ltd)

AMS1117 step down from 4.5v to 3.3v : £2.55 (ebay)

Step up from 5v to 12v at 6 Watt : £3.00 (ebay)

SN754410NE 4 Channel Half-H Bridge Driver IC : £2.30 (ebay)

EasyAcc 6000 mAh Ultra-Slim External 5 volt Battery : £13.99 (Amazon)

Total cost (not including DCC decoders) is around £38

The Arduino code is attached.



JustinA78 (author)2017-04-01

Alrighty, going to try using blue tooth control via cell phone. I'm essentially using the same route you used for RC but instead of mrc will be using a dcc sound decoder.

JustinA78 (author)2017-03-03

Another question I have is any way to replace the wireless module with say blue tooth and use engine driver or something similar to run it via a smart phone?

BillC35 (author)JustinA782017-03-09

Yes any other wireless comm would work as the DCC part is generated onboard the train. All you need to transmit is the instructions.You would probably have to make your own app on a phone - I do not know how Engine Driver transmits data.

JustinA78 (author)2017-02-18

I have a question, seeing as the firm that produces the RF28 is no longer, is there a replacement you can suggest? Thank you!

BillC35 (author)JustinA782017-02-19

Please refer to my instructable 'Model Railway DCC Arduino wireless commands on a dead rail system' for details of the nRF24 replacement for the obsolete RF28.

JustinA78 (author)BillC352017-02-20

Thank you so very much! I look forward to trying this out.

Martinkirkby (author)2016-07-22

hello BillC35

Thanks for posting this great idea, I also have a lot of trouble with power/track and have tried various "Deadrail" solutions but have yet to find the ideal solution for my HO/OO locos ( not much space inside for battery/radio/cpu etc. )

I have a bench project that uses Arduino MiniPro with H-bridge, battery powered via wired DCC. My aim is to use nRF24 (2.4Ghz) to replace the wired DCC and make it wireless. However Iam no software engineer and it's slow progress.

Basically I need a DCC track signal sniffer to transmit DCC and my Arduino loco decoder to receive it! I have been using the excellent DCCNMRA library for Arduino by Alex Shepard and also Geoff Bunza's DCC decoders but the DCC packet via wifi is giving me a headache ?.

Maybe this is a project you might like to fix with me? I have asked many rail modlers and they all say "why can you wiz kids not fix this track/wheel power problem" I see Bluetooth solutions but none with DCC "bridge" or just their own RF handsets!

I will follow your progress, good luck


BillC35 (author)Martinkirkby2016-07-26

Hi Martin, With limited space in HO/OO locos it will be difficult to achieve a DCC wireless solution. You will need at least 2 x 1.5v batteries plus step up voltage circuit to supply 12 volts to the H-bridge. It should be possible to transmit the DCC signal by wireless to one of the bridge inputs and reversing the signal via a transistor to the other input to provide a 20+ volt peak to peak output that follows the received data. I will purchase a nRF24 module and check it out. Will let you know how I get on.

Thanks for you idea.

Martinkirkby (author)BillC352016-08-04

hello Bill

Thank you for your positive support, I have used LiPo 1 cell (with step up) and 3 cell LiPo battery with great success on my "dead rail" loco's, also with "ON track charging" powered track in stations etc . I see you are familiar with Geoff Bunza's projects, as I have his "mobile decoder" up and running (2 motors, 1 servo and several LED outputs) I assumed getting the DCC packet in (via pin 2) would be a just a binary input? Not needing the optoisolator circuit?

I have found a couple of Arduino programs on line that read the DCC track and out put to the serial window the Binary packets and also convert them the "human readable" form, it was one of these that I was trying to use with the nRF24 to transmit the DCC packet to the Arduino loco decoder.



BillC35 (author)Martinkirkby2016-09-24

Hi Martin
I have found a way of using Arduino Mini Pro and nRF24 to transmit and receive DCC command station data. The on-board Arduino must run the basic clock sequence and only the packet data needs to be transmitted. I shall create another instructable soon with details.


Martinkirkby (author)BillC352016-09-24

Hello Bill
You are a genius! I will keep an eye out for that post.


Gavindewet made it! (author)Martinkirkby2017-02-09

Hi Guys

To add my 10c worth..I have used an ESP8266 based solution I developed in an HO loco using standard WiFi controlled from an Android phone app I wrote. No DCC required. (Got a lot of help from some pretty clever people on the web)

Have added the LiPo batteries and speaker to a wagon behind. I have pre-recorded sound on an SD card that is activated by function keys and motor drive. In theory can run in excess of 200 locos at the same time. I have currently built 10 locos with this solution. Cost per loco for the electronics is around $25 so no more expensive than a standard DCC decoder. The LiPo's charge from the track and give around 10 min running time if the track is switch off. Stops the annoying shorts over points etc.

One of the completed locos below. If you look carefully, you can see one of the ribbon cables between the loco and wagon.

Martinkirkby (author)Gavindewet2017-02-09

hello Gavin

Thank you for sharing your project, it's great to hear from a fellow wireless/battery user it really is a fantastic solution, it's a shame a major manufacturer does not bring out a product (thus saving us many hours of work!) but then there would be no fun in that would there!

Have you posted your IOT project? I would like to take a look at it as I am currently working on an iPad app for layout/loco control using various manufacturers TCP Socket connections, it would not be a big job to add your command instruction set as you have with the Android platform.

I have the "open sourced " DDC++ on the bench with a view to using it to talk to all the industry's standard DCC decoders.

About This Instructable




More by BillC35:Garden Train - Arduino Wireless NMRA DCCArduino - adjustable & smart battery charger Model Railway DCC Arduino wireless commands on a dead rail system
Add instructable to: