Arduino Data Over Power Help! - Page 1
Forum section: electronics / beginners

author: HiSmartAlarms
author_rank: Newbie
timestamp: August 04, 2019, 12:34:32 am
content: 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)

author: Whales
author_rank: Super Contributor
timestamp: August 04, 2019, 12:39:56 am
content: > 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

author: HiSmartAlarms
author_rank: Newbie
timestamp: August 04, 2019, 12:45:33 am
content: 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.

author: Whales
author_rank: Super Contributor
timestamp: August 04, 2019, 04:49:10 am
content: 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.

author: ledtester
author_rank: Super Contributor
timestamp: August 04, 2019, 07:38:54 am
content: Found these articles:https://electronics.stackexchange.com/questions/1654/injecting-a-communication-signal-over-dc-power-supply-lineshttps://www.electronicdesign.com/communications/simple-circuit-communicates-over-low-voltage-power-linesand apparently this is how DCC works:https://electronics.stackexchange.com/a/194489/95488and there is DC-BUS by Yamar:https://yamar.comhttps://en.wikipedia.org/wiki/DC-BUS

author: MarkF
author_rank: Super Contributor
timestamp: August 04, 2019, 02:50:12 pm
content: I can not figure out if you are trying to control a DCC ready locomotive orjust 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/DccPlusPlushttps://github.com/DccPlusPlus/Documentation(Arduino Motor Shield)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.

author: themadhippy
author_rank: Super Contributor
timestamp: August 04, 2019, 04:15:31 pm
content: this any use?http://amakersblog.blogspot.com/2011/01/controlling-model-trains-with-arduino.html

author: MarkF
author_rank: Super Contributor
timestamp: August 04, 2019, 04:45:05 pm
content: Quote from: themadhippy on August 04, 2019, 04:15:31 pmThat 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?

author: HiSmartAlarms
author_rank: Newbie
timestamp: August 05, 2019, 02:34:23 am
content: 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.

author: ledtester
author_rank: Super Contributor
timestamp: August 05, 2019, 04:16:50 am
content: 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".

author: MarkF
author_rank: Super Contributor
timestamp: August 05, 2019, 04:18:39 am
content: Quote from: HiSmartAlarms on August 05, 2019, 02:34:23 amPhysically, 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.

author: MarkF
author_rank: Super Contributor
timestamp: August 05, 2019, 04:21:43 am
content: Quote from: ledtester on August 05, 2019, 04:16:50 amThe 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.