Question Tortoise switch motors

Mzbringh Jan 5, 2016

  1. Mzbringh

    Mzbringh TrainBoard Member

    130
    1
    14
    Hi,

    I got myself a new toy, an Arduino start package. The idea is to get some basic knowledge about electronic components and maybe put it in use somewhere on the layout. One thought was to control Tortoise switch motors with it. Overkill maybe but one idea. So I googled Arduino and Tortoise and came across one word that struck me, Tortoise stall motor. Is that correct how a Tortoise switch motor works, you flip the controlswitch, the motor moves the switch and stalls when it hits the end? It is still on but stalls? For me stalled electric motor means burned motor but obviously the Turtoise is made for it. I thought a micro switch would turn it off at the end points. And I thought I could use the Arduino to control it as a servo motor. There is an example in the Start package guide about controlling a servo motor and a servo motor is included. Maybe I need to think a little bit more. Any thoughts about the concept of a stall motor? How do you control a Tortoise switch motor?

    http://forum.arduino.cc/index.php?topic=87704.0
     
  2. markm

    markm TrainBoard Supporter

    804
    241
    21
    Mikael,
    I have had an Arduino with a prototyping shield and a power shield for some time and they can definitely be put to use on a layout. If you check the libraries, you'll find that you can even turn one into a DCC command station. The big issue using them is that digital electronics does not like to interface with the real world: switches, relays, motors and such, without a good deal of knowledge. Failure to use the right components and techniques can turn your Arduino into trash very quickly. I'm afraid interfacing to the Tortoise may fall into that category.
    I'm not very familiar with the Tortoise, but in general a stall motor is one designed to apply tension when it hits an end without drawing excessive current and is meant to be continuously powered. Not knowing more about the Tortoise, I would suggest using the Arduino to drive relays (with clamping diodes) to power the Tortoise per the manufacturers instructions.
    If you're just starting out with electronics, I'd suggest that your first couple of projects be something simple, like a street traffic signal or a 3 color target semaphore. I'd be happy to discuss using the Arduino model railroading applications and provide some examples if there is interest.

    Mark
     
  3. Mzbringh

    Mzbringh TrainBoard Member

    130
    1
    14
    Thanks for the reply Mark.

    One of my rules are to never read the manual until it is appearent I should have. I found a manual for the Turtoise switch motor. It says stall motor. It also says 12V or less.

    "As mentioned earlier, the motor in the TORTOISE is powered continuously and merely
    stalls out at the end of the throw. The motor will not be harmed by continuous application
    of 12 volts DC or less. In fact, even if AC is inadvertently applied to the motor terminals
    (1 and 8), no harm will be done as long as it is 12 volts or less. The TORTOISE will not
    work with AC , of course, but it will not be damaged."

    I'm a programmer so that part of playing around with the Arduino isn't a problem. I'm not an electronics guy so burning stuff will not be a problem either. Since the Arduino puts out 5V and the Turtois want 12V I assume I need a relay in between. I'm very interested in talking about why things work and not work but first I need to burn some stuff, hopefully not the Arduino it self, so that I know a little bit better what I'm getting into. I'm only at Experiment no 4 in the guide book. Next one is about controlling a servo motor. Questions about the Arduino should go under DCC forum or something rather that Z scale I guess.

    Mikael
     
  4. markm

    markm TrainBoard Supporter

    804
    241
    21
    Mikael,
    I'm not sure where would be a better place for this discussion. The DCC & Electronics seems to be mostly DCC and when we would need to discuss code, no place seems to fit. Also, as you've already noticed the Arduino site is a bit weak on hardware, especially for model railroading. Maybe the moderators here would have a suggestion.
    Don't know which guide book you're using but the adafruit site: https://learn.adafruit.com/series/learn-arduino
    talks about motor interface, which you may find useful.
    Also parallax, which produces another product, the BASIC stamp, similar to the Arduino, has an app note on interfacing to model railroads you may like: https://www.parallax.com/sites/default/files/downloads/BS1-IC-BASIC_Stamp_1_AppNotes.pdf (starts about page 171).

    Hope this helps,

    Mark
     
  5. Mzbringh

    Mzbringh TrainBoard Member

    130
    1
    14
    Thank you for the link Mark. Looks very promising. I have looked for HW at Adafruit site before. Never thought of looking for tutorials though. The guide I'm talking about is the Getting started guide that comes with the starter kit. Similar to the Getting started at Adafruit site. If there is enough interest there could be a Electronics forum for Arduino and Raspberry Pi and other useful electronics. There have been a few articles in Swedish model train magazines around using Arduino or Raspberry Pi. But that's not why I got started. It was a combination of wanting to use capacitors on decoders and why do I need a circuit for that (diods and resistors) like ESU Powerpack, I know nothing, and a very annoying, I mean entusiastic collegue at work.
     
  6. markm

    markm TrainBoard Supporter

    804
    241
    21
    Mikael,
    Personally, I think of the electronics aspect of model railroading to be just another aspect of scratch building. Unfortunately, there has been a trend toward "black box" solutions these days so not so many electronics projects are developed. Even the U.S. train magazines are very light on electronics projects. That said, let's get back to your question.
    Since we know very little about the electrical characteristics of the Tortoise, it would be wise to run it from a separate power supply from the Arduino, even if the voltages were compatible. Likewise it's good to isolate the control using a relay. Here's an example circuit for you.

    relay driver.jpg
    The Out connection comes from an Arduino digital output with a high signal activating the relay. The D diode is a general purpose switching diode, something like a 1N4148. This prevents transient spikes from the relay.
    Q is an NPN transistor. Since I don't know what components you have available I'll describe what you'll be looking for. The relay coil (RLY) will be specified with a coil current or resistance. If you have only the resistance, the current is 12V/Rcoil (Ohm's Law), generally about 20-30mA. The transistor Q needs to have a collect current (Ic) rating larger than the coil current, maybe 2x. The resistor R provides a base current to turn the transistor on. A typical value would be about 10K ohms.
    I hope I haven't lost you at this point. Feel free to ask questions and play with the design. This is a basic circuit that should allow you to control any 12VDC equipment from the Arduino.

    Mark
     
  7. Mzbringh

    Mzbringh TrainBoard Member

    130
    1
    14
    That is exactly the kind of logic I need to get into my head. I have to do that to protect that, I have to do that to get that component to work and so on. I will do some more reading, building and testing before I get to try your curcuit. I have just completed the wiring for the servo motor example and created the program. Pretty straight forward. Two interesting notes. One, I missed one semi colon in the program and every line was wrong. Putting it back and all was good. It is a thin line between total catastrophy and total success. :) Second the circuit include two capacitors. Mount them wrong and they can explode the guide says. It sure is an interesting world. I think I run for cover now....... :)
     
  8. markm

    markm TrainBoard Supporter

    804
    241
    21
    Mikael,
    I wish you success with your experiments. Note that the circuit I posted doesn't even need the Arduino to check it out: just apply 0 and 5V to the "out" pin.
    I've blown-up more than a couple of capacitors over the years. <100ufd and <1A power supply and they pop like party favors. >1000ufd and >5A and they can blow like a firecracker.

    Mark
     
  9. SJ Z-man

    SJ Z-man TrainBoard Member

    3,007
    1,020
    62
    The Tortoise doesn't work well at 5 volts. If you can find a Tri-state or Bipolar output that can Source 12 volts and Sink ground, would require 2 Digital outputs as the polarity has to reverse to move the Tortoise.
    A single '5 volt' digital output could be used with a Relay that has Normally Open (NO) and Normally Closed (NC) contacts. This is a SPDT relay (Single Pole [meaning 1 'switched' circuit] Double Throw, like the relay circuit above from Mark. You will have to program what polarity the relay should be in or reverse the wires on the Tortoise for what you consider the default run route of the turnout (If the Arduino, Pi, etc.) is NOT powered [not running] and the Relay's still have power, then the Tortoise will now all go to the Normally Closed contacts.

    There are many relay boards (shields) available (Amazon, ebay, adafruit, etc.) These will translate the 5 volt digital logic to metal contacts that can control any voltage. This is the schematic shown above by Mark. Order a 12 volt board. They commonly have 4 relays. Some of 8 or 10. I use the 4 relay boards and bought them (frequently) for $5 !!! The voltage is for the Relay COIL, as shown above. The Tortoise can also run on this 12 volts.

    You can then use a 12 volt switching supply (1 amp will be MORE than enough for powering dozens of Tortoises) to power the relay and Tortoises.. $5-$10 from many sources like MPJA or Jameco.
     
  10. Mzbringh

    Mzbringh TrainBoard Member

    130
    1
    14
    Thanks for all the good suggestions. I have done some reading and played around with the lessons that comes with the starter kit and on the Adafruit web page. It seems that their solution both to external power and reversing polarity is the L293D motor controller IC. The motor, two per L293D, is driven by an external power source through the L293D up to 36V. And the Arduino, or switches I guess, control on/off and direction. And I don't really need my relay-board.

    https://learn.adafruit.com/adafruit-arduino-lesson-15-dc-motor-reversing

    But I will continue to read more about using relay boards. I have a 8 relay board. I also have a RFID reader. I thought putting a RFID tag underneath a train and you know which one is coming. But that's next.

    Cheers
    Mikael
     
  11. markm

    markm TrainBoard Supporter

    804
    241
    21
    Mikael,
    If you're up to lesson 15, you're ready to program a 2 track Arduino-based Z scale throttle! The L293 is a good, very popular motor controller, but way too much for controlling a Tortoise. You mention you have a relay board. You didn't mention it's capabilities, but you should be able to control the Tortoise if you have 2 relays with both normally-open (NO) and Normally-closed (NC) contacts or 4 relays otherwise.
    I'm not sure an RFID tag would work well on a locomotive, what with all the metal and the magnetic and electrical fields from the motor. But I'd bet that it would work in a boxcar behind the engine.

    Mark
     

Share This Page