Go Down

Topic: Arduino controlled model trains (Read 6862 times) previous topic - next topic

tkbyd

Ah, the good old days! Next I'll be wanting to make a maze running robot.

Years ago, computer controlled train layouts were all the rage.

I blew up enough PICs to eventually end my interest in going farther trying to run a train by microprocessor. Memories of that pain have faded, Arduinos aren't so VERY expensive, and they are easier to program.

So to my question:

How can I hook and Arduino up to a model train's DC 12v but keep it isolated from those nasty voltage spikes which occur on the power driving the little motors in the trains? I'd want to use PWM to control the train's speed. I think I had everything isolated through opto-isolators the last time I tried this, but I must have been missing something somewhere along the line.

Ideas welcome!

Grumpy_Mike

Well you said it, use opto isolators. When you tried it last time did you have a common ground? With opto isolators you must not have a common ground, otherwise you are not truly isolated.

floresta

#2
Jun 16, 2010, 03:16 pm Last Edit: Jun 16, 2010, 03:16 pm by floresta Reason: 1
Quote
Ideas welcome!
It would be hard to duplicate all of the circuitry that is in the current DCC (Digital Command Control) receivers at the price they are charging for them.  I would suggest using on of the simple DCC units for the actual control of the motor and concentrate on using the Arduino to generate the control signals that the module is expecting.

Don

artjumble

If you haven't already seen this, you might want to take a look at this setup. It seemed pretty nice to me. http://dawson-station.blogspot.com/2010/02/how-dids.html

tkbyd

Quote
you must not have a common ground


I suspect my problem was somehow connected (!) with an unintentional "common ground"....

I had a substantial household AC volts -> 12v DC transformer. The power to the train motors came directly from the 12 v out from that. The 12v from that ALSO went to the 7805 circuit... with lots of capacitors... which was producing the regulated 5v running my PIC and one side of the opto-isoloators.

So... two transformers? One to "feed" the train motors, a second one feeding my Arduino? I'd hoped that the regulator would "filter" the power "downstream" of it? There was no "return" path "back" from the motors into 5v parts of the circuit?

Coding Badly


Have you seen this...
http://siliconrailway.com/

floresta

Quote
Have you seen this...
http://siliconrailway.com/
What you see there now is tha same as what you saw there a year ago....

Don

Coding Badly

Quote
What you see there now is tha same as what you saw there a year ago

I vaguely recall reading in the previous few months that the project is still alive.  I think the message was on AVR Freaks.  It wouldn't hurt to try to make contact.

floresta

Quote
I vaguely recall reading in the previous few months that the project is still alive.  I think the message was on AVR Freaks.  It wouldn't hurt to try to make contact.
I saw that too.  I believe they claimed to be so busy building and selling devices that they couldn't get the documentation done - or something to that effect.

Don

Professor Chaos

I'm using an Arduino to control an O-gauge layout, but sending commands to the trains and accessories is routed through a serial connection to the Lionel TMCC command control system.  The Arduino is responsible for reading track sensors, setting signals, and deciding when and where the trains go.

JMRI is an extensive computer control system that works with commercial DCC decoders: http://jmri.sourceforge.net/

JMRI doesn't really support TMCC, so I use the Arduino to mediate between the computer running JMRI and the TMCC system.


Go Up