EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: HiSmartAlarms on August 04, 2019, 12:34:32 am
-
Hello! Im new to the EEVBlog Forums and I need help with a project.
Im working on a model train layout and want to make my own DCC system. Except, my layout is small and so is my budget, so having a proper DCC layout is not a good choice for me.
So thinking, I have a good and young mind, I can surely make something in place of DCC with arduinos! And I was correct; but realizing that there is only two rails (One for ground and the Other for signal) I need to give power over the rails. I've seen this done before, but they seem to only run at 5v or so. I need to use a transistor or something to increase that to 12v to power the old dc motor for PWM. I've got that bit working but If anyone could, please give me a schematic to follow. I've tried something already and ended up blowing out an arduino nano.
All help is appreciated!
73, KE8GDP (HiSmartAlarms)
-
> I've tried something already and ended up blowing out an arduino nano.
Whatever you do: don't wire your arduino directly to the rails. Your Arduino's output pins are only rated to deliver a few mA whilst your trains will draw many amps.
I'm not familiar with DCC, but my starting point would be to discover the exact voltage waveforms your trains expect. ie is it a 5-12V waveform, a -12 to +12V waveform, etc. This source suggests the latter, but I might be wrong:
http://www.circuitous.ca/DCCvolts.html (http://www.circuitous.ca/DCCvolts.html)
-
Thank you, im trying to use the UART to power a transistor to send a character over the rails, so it would only be one way communications and only a singal character every now and then. And since the arduino has a V in pin which has like a 7-12v input I can just power the arduino from the rails with a cap and a diode, but one thing I'm wondering is how to convert that 12v back down to TTL logic levels.
-
Ah, sorry. I thought there were some DDC standards. You are instead trying to implement your own custom signalling system?
> but one thing I'm wondering is how to convert that 12v back down to TTL logic levels.
A resistor divider can take the 12V signals down to something the Arduino can handle (ie 0-5V). If your voltages can go negative then you will also want to add a diode in to prevent things going too far below 0V.
-
Found these articles:
https://electronics.stackexchange.com/questions/1654/injecting-a-communication-signal-over-dc-power-supply-lines (https://electronics.stackexchange.com/questions/1654/injecting-a-communication-signal-over-dc-power-supply-lines)
https://www.electronicdesign.com/communications/simple-circuit-communicates-over-low-voltage-power-lines (https://www.electronicdesign.com/communications/simple-circuit-communicates-over-low-voltage-power-lines)
and apparently this is how DCC works:
https://electronics.stackexchange.com/a/194489/95488 (https://electronics.stackexchange.com/a/194489/95488)
and there is DC-BUS by Yamar:
https://yamar.com (https://yamar.com)
https://en.wikipedia.org/wiki/DC-BUS (https://en.wikipedia.org/wiki/DC-BUS)
-
I can not figure out if you are trying to control a DCC ready locomotive or
just send a PWM signal to control a non-DCC locomotive?
If you just want to control a DCC locomotive without the DCC power pack, this Arduino project is worth a look:
https://github.com/DccPlusPlus (https://github.com/DccPlusPlus)
https://github.com/DccPlusPlus/Documentation (https://github.com/DccPlusPlus/Documentation) (Arduino Motor Shield)
https://www.youtube.com/watch?v=uGEt7YENA7c (https://www.youtube.com/watch?v=uGEt7YENA7c)
If trying to do a Non-DCC approach with PWM signal to the locomotive (direct to DC motor), here is my drive circuit for HO scale (work in progress)(ignore block occupancy sense part in pink). Green is for current limit. I am sending PWM for slow speed and DC for medium to high speed. The circuit is driven by a PIC16F876 and a dual MCP4802 DAC to drive two "old-style" model railroad blocks. VCC is +18VDC. J1 pins: (1=speed, 2=reverse, 3=short_sense, 4=occupancy_sense, 5=GND, 6=+12V_for_relay). Speed pin is 0 to +4V.
[attachimg=1 width=640]
-
this any use?
http://amakersblog.blogspot.com/2011/01/controlling-model-trains-with-arduino.html (http://amakersblog.blogspot.com/2011/01/controlling-model-trains-with-arduino.html)
-
this any use?
http://amakersblog.blogspot.com/2011/01/controlling-model-trains-with-arduino.html (http://amakersblog.blogspot.com/2011/01/controlling-model-trains-with-arduino.html)
That is very interesting too.
What we really need to know is -- Does the OP want to activate the DCC inside the locomotive or bypass it?
-
Basically my plan is to put an arduino nano in the shell of the locomotive and another arduino as a controller thats at the operating position or made into a handle or something. But thank you for all the help. And until i get the knowledge and supplies I will be taking a break from this project for a while, unless something unbelievably ground breaking happens.
-
When you get back to this project, another idea to consider is to just use radio modules like the NRF24L01. Just google "arduino radio module".
-
Basically my plan is to put an arduino nano in the shell of the locomotive and another arduino as a controller thats at the operating position or made into a handle or something. But thank you for all the help. And until i get the knowledge and supplies I will be taking a break from this project for a while, unless something unbelievably ground breaking happens.
Physically, you will never get an Arduino Nano and the necessary motor driver circuitry inside a HO locomotive or even an O-gauge (Lionel) locomotive. At best, you might be able to fit it into a tender if doing steam or a box car if doing diesel. Even the small DCC modules barely fit inside a locomotive.
Most locomotives available today are DCC Ready (needing a DCC module) or are fully DCC out of the box. You would be better off trying the DCC++ Arduino project I mentioned earlier or going fully DC and setting up track blocks. In which case you would generate the power (DC, rectified AC or PWM) externally and feeding it to each block.
-
When you get back to this project, another idea to consider is to just use radio modules like the NRF24L01. Just google "arduino radio module".
The model railroad environment is very noisy. I would expect any RF communication to be problematic.
I expect his real problem is going to be physical size restrictions and the power needs. A HO locomotive requires about 1A more or less.
The Arduino Nano is about 3 times bigger than most DCC controllers.