Shop OBEX P1 Docs P2 Docs Learn Events
Basic Question About Switches — Parallax Forums

Basic Question About Switches

gr8_big_geekgr8_big_geek Posts: 34
edited 2012-04-17 11:24 in BASIC Stamp
Hello All,

Yes, literally "switches" not as in programming switches with case1, case2, etc but physical light switches.

I have a motor, it runs off of 12AMPS and it has it's own power supply and so on. Here is where I am curious. It has a switch and I'm wondering how to break the circuit with a microcontroller. I know this is a noob question but I'm just trying to figure how to break a simple circuit using the pins in/out. I know that is their basic function which is to complete a circuit to make the light turn on and then break the circuit to turn it off but what about a large switch which controls something like a 12AMP motor? The switch is fixed I just need to hop in there and break the circuit.

Any thoughts?

Thanks guys,

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-04-15 20:35
    Thought:
    Get a switching transistor and a relay.
    Look in Resources at the Parallax site, sift through the Nuts & Volts articles there and keep an eye out for one titled, "Stamps on Steroids". Poking around the forum will likely turn up examples as well.
  • latigerlillylatigerlilly Posts: 114
    edited 2012-04-16 10:20
    If you're a total noob, transistors may be hard to understand. I just use a 5 volt solenoid. Basic stamp is 5 volt so any small 5 volt solenoid should work. A solenoid is a tiny electromagnet that will throw a switch. I googled 5 volt solenoid and got this: http://www.sparkfun.com/products/11015 . You may also call customer service at Allied electronics, Mouser, or Radio Shack and they'll help you find the right solenoid. I prefer Allied for their customer service, but they are a bit more expensive.

    Shameless plug: please answer my questions! Thanks guys!
    http://forums.parallax.com/showthread.php?139472-owner-s-manual-for-bs2p40-and-professional-development-board&p=1091253#post1091253
    http://forums.parallax.com/showthread.php?139471-DS1307-Real-Time-Clock-%28X14%29-and-BS2P40-on-Professional-Development-Board&p=1091249#post1091249

    P.S. just be aware that a solenoid has a service life. A high quality one should last through 10,000 uses, after which, it needs to be replaced or it will fail. Transistors have no moving parts unlike a physical "switch" moved by an electromagnet (solenoid), so transisters have a theoretically infinite service life.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-04-16 10:39
    The solenoid you reference draws way too much current for any microcontroller I/O pin. You have to use a switching transistor as PJ mentioned. In the Nuts and Volts Column, they also show that you need a diode connected backwards across the solenoid (or motor or relay) coil. You have to have this or the energy from the collapsing magnetic field around the coil when the current turns off will destroy the switching transistor.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-04-16 11:42
    Here's the a link to the column PJ mentioned.

    An example of using a relay with a Basic Stamp is given on the last page of the article.

    A relay uses a solenoid to close (or open) a switch. The solenoid and switch are housed together to make it easier to use. You'll also need to use a transistor, diode and resistor as shown in the article.
  • ercoerco Posts: 20,256
    edited 2012-04-16 13:10
    Somebody at Expo asked me this exact question. Basically they wanted a kill switch for a high-current mobile robot. It would rarely move, and be in a normally closed configuration. My best answer is to use a manual automotive kill switch and open it with a nice big servo. I have seen simple knife-switch types at auto parts stores, or this rotary type is good for 300 amps:

    http://www.ebay.com/itm/Battery-Disconnect-Kill-Cut-Off-Switch-Solid-Brass-300AMPS-Car-Truck-Terminal-/270953664260?pt=Motors_Car_Truck_Parts_Accessories&hash=item3f1618cf04&vxp=mtr

    Either this rotary type or a knife switch has self-wiping contacts that a relay doesn't have, so it can handle massive currents.

    Don't forget about servos glitching on startup. They may move a bit, but that just wipes your contacts down for less resistance. If you can't fix it, feature it!

    IIRC, this is the first time I have ever made a recommendation AGAINST using a relay. :)
  • davejamesdavejames Posts: 4,047
    edited 2012-04-16 13:31
    Sir Erco - dig this:

    http://www.grainger.com/Grainger/DAYTON-Power-Relay-5Z546

    Look under the "Additional Information" tab ---> "...self-wiping contacts..."
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-04-16 13:40
    erco wrote: »
    IIRC, this is the first time I have ever made a recommendation AGAINST using a relay. :)

    This will be documented by the forum archivist and set aside as a red letter day!
  • skylightskylight Posts: 1,915
    edited 2012-04-17 11:24
    I 've just picked myself up off the floor!
Sign In or Register to comment.