# DIY simple remote control for locos



## [email protected] (Aug 8, 2018)

Hi everyone

I am quite new to the Modeling. Started last year. At the time I was starting I wanted to have some kind of advance controlling of locos. Since I am very limited by the space, I have decided to go with a small N scale layout. In the meantime, I have found the simple DC control is not enough but the DCC is too expansive and too »complex« for my small layout. So I have decided to build my own remote control. After a half a year of hardly finding any spare time  I have finished the control. 
https://github.com/andrejcampa/WiFi-motor-controller
https://www.thingiverse.com/thing:3038380
The complete project is open so you can do with it whatever you want . You can give it a try, and make your own control. Since it is intended for N scale (also HO scale) the module is quite small, so you may need a microscope to do fine soldering.
If you have any idea what should I improve and what else I could do to enhance the control, please let me know. However, I do not attend to replace more advanced controls (DCC) that could do much more. 

Best regards
Andrej Čampa


----------



## Dennis461 (Jan 5, 2018)

*Very interesting*

Very interesting, how would you control two or more locomotives?


----------



## [email protected] (Aug 8, 2018)

At the moment you cannot control more than one train since it uses only WiFi access point to connect to the module. By changing the program to use the stationary mode and access point it would be possible, but I think this is a different story.


----------



## Shdwdrgn (Dec 23, 2014)

You just need to include an identifier in your control code. Take a look at how DCC++ handles communications -- there's a big section on string commands. Basically if you send a code to change the speed of the loco, that code also includes an identifier for the loco number. So ALL of the locos and accessories receive that code, check the identifier, and toss the info if the command wasn't meant for that device. This allows a large number of devices to share the same bus (in this case your wifi channel).

Additionally, with wifi you have the option of sending information back. I started out building my own code, and of course included the option to make the locos increase and decrease speed at a gradual rate. And because I could send the info back to the main controller, it meant that my throttle program could show that I had requested <this> speed for the loco, but it was currently only traveling at <that> speed. It was much more obvious if you threw the train in reverse, because the throttle would indicate I should be going backwards, but in reality the train was still slowing down before it could change directions.

By the way if you think DCC is too expensive, you might want to look at DCC++ or even DCC++ESP32 (which includes wifi communications). For the base station you need the MCU, a motor driver board, and a good power supply (around $25 for everything). I've already set up arduinos as basic accessory and servo controllers using DCC commands. Now I'm working on code for a wifi loco decoder, also based on the ESP32, and designing a board that can be put into a loco as easily as commercial DCC boards but without the high cost. Everybody is building a piece, or building off of other pieces, and even today every part of a DCC system can be built with open source software.


----------

