Author Topic: Arduino Data Over Power Help!  (Read 2220 times)

0 Members and 1 Guest are viewing this topic.

Offline HiSmartAlarmsTopic starter

  • Newbie
  • Posts: 6
  • Country: us
  • I love electricity.
    • YouTube Channel
Arduino Data Over Power Help!
« 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 love electricity. It tickles.
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 2122
  • Country: au
    • Halestrom
Re: Arduino Data Over Power Help!
« Reply #1 on: August 04, 2019, 12:39:56 am »
> 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
 
The following users thanked this post: HiSmartAlarms

Offline HiSmartAlarmsTopic starter

  • Newbie
  • Posts: 6
  • Country: us
  • I love electricity.
    • YouTube Channel
Re: Arduino Data Over Power Help!
« Reply #2 on: August 04, 2019, 12:45:33 am »
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.
I love electricity. It tickles.
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 2122
  • Country: au
    • Halestrom
Re: Arduino Data Over Power Help!
« Reply #3 on: August 04, 2019, 04:49:10 am »
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.


Online ledtester

  • Super Contributor
  • ***
  • Posts: 3282
  • Country: us
« Last Edit: August 04, 2019, 07:51:23 am by ledtester »
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Arduino Data Over Power Help!
« Reply #5 on: August 04, 2019, 02:50:12 pm »
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/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.

803115-0
« Last Edit: August 04, 2019, 03:25:07 pm by MarkF »
 

Online themadhippy

  • Super Contributor
  • ***
  • Posts: 3266
  • Country: gb
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Arduino Data Over Power Help!
« Reply #7 on: August 04, 2019, 04:45:05 pm »
this any use?
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?
 

Offline HiSmartAlarmsTopic starter

  • Newbie
  • Posts: 6
  • Country: us
  • I love electricity.
    • YouTube Channel
Re: Arduino Data Over Power Help!
« Reply #8 on: August 05, 2019, 02:34:23 am »
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.
I love electricity. It tickles.
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3282
  • Country: us
Re: Arduino Data Over Power Help!
« Reply #9 on: August 05, 2019, 04:16:50 am »
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".


 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Arduino Data Over Power Help!
« Reply #10 on: August 05, 2019, 04:18:39 am »
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.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Arduino Data Over Power Help!
« Reply #11 on: August 05, 2019, 04:21:43 am »
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.
« Last Edit: August 05, 2019, 04:30:05 am by MarkF »
 
The following users thanked this post: ledtester


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf