Shop OBEX P1 Docs P2 Docs Learn Events
Switching switches? — Parallax Forums

Switching switches?

ajs2001txajs2001tx Posts: 25
edited 2005-09-28 16:18 in BASIC Stamp
I am way out of my depth here so I need a little guidance being a simple farmer.· I need to switch·5 inductance relays (100 mA, 12 vdc) with a stamp and here is what I think I have learned by searching·through the other threads on switching with transistors.· Please tell me if this is right or wrong.

It seems that everyone agrees that switching the ground and NOT the supply voltage is the way to go.

It looks like the two most popular options are a transistor array such as the ULN2003 or a MOSFET.

Use a diode across the load on the relay.

From running the numbers from the "Don't get to HOT switching with a transistor" help page that I think John Williams provided in another thread, it seems that the ULN2003 can "sink plenty of ground" for my application while only using around 2 mA.·

My questions are as follows:

Do I need a resistor between the stamp pins and the base pins on the ULN2003?

Do I want to use a·diode across the relay magnet as well?·

Why would I want to go ahead and go with a MOSFET?

Do I need a resistor between the stamp pins and the gate on the MOSFET?

Do I need a diode with a MOSFET?

Do MOSFETs come in an array form?·

Is there anything else I need to know before I get going?

Thanks for your help, this forum and being able to search it is an invaluable tool.


Andy



Post Edited (ajs2001tx) : 9/26/2005 4:20:28 AM GMT

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-09-26 05:07
    Andy -

    I don't mean to pick apart your post, but I also don't want to leave part of your post unclarified. Sorry to burst your bubble, but NOT everyone agrees that switching the ground is an appropriate switching method. I would only do it under great duress, and ONLY with low voltage circuits. Granted, yours IS a low voltage application.

    I'll let others respond to your questions from an electronics point of view, but I'm going to take my corner with electrical SAFETY in responding to part of your question, and to show why switching the ground CAN be DANGEROUS. Please don't be offended :-)··There is a very valid safety reason for always switching the HOT (positive) leg of a circuit, instead of switching the neutral (negative or ground). Consider the two figures below labelled Figure 1 and Figure 2.

    ········· Figure 1························· Figure 2

    ·· A· + -/
    B······· A· +
    B
    ···························· |··································· |
    ··········· SAFE········· |················· UNSAFE······ |
    ···························· |··································· |
    ·· E· - ----D
    · C······· E· - --/ -D
    · C

    ······ Positive switched··········· Neutral switched

    ···· Voltages as measured in circuits above with switch OPEN (OFF!)

    ·········· Table 1································· Table 2

    ··· B --> ground = 0············ B --> ground = full voltage potential
    ··· C --> ground = 0············ C --> ground = full voltage potential
    ··· D --> ground = 0············ D --> ground = full voltage potential

    I'll leave it to the reader if they want to expose themselves, or anyone else to that much LIVE VOLTAGE in a circuit that is ostensibly OFF! I, for one, switch the HOT ONLY.

    Regards,

    Bruce Bates
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-09-26 12:32
    The ULN2003 will be the simplest as it has everything you need internally, including flyback diodes (that work if you connect the COM pin [noparse][[/noparse]9] to your positive supply). Download the spec sheet for proper connections.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax

    Post Edited (Jon Williams (Parallax)) : 9/26/2005 12:36:24 PM GMT
  • ajs2001txajs2001tx Posts: 25
    edited 2005-09-27 22:15
    So I am not trying to be a pest but will I need a resistor between the stamp and the ULN2003?· If I am reading the data sheet correctly it looks like there is a 2.7k resistor built in the array but sometimes I don't read so good.· Thanks
  • NewzedNewzed Posts: 2,503
    edited 2005-09-27 22:18
    The ULN2003 does have a built in base resistor but it is always a good idea to put a 220 ohm resistor in every I/O line just for safety's sake.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-09-28 01:08
    The 220 between the ULN and the Stamp certainly won't hurt anything, but unless you're going to connect something between the Stamp and the ULN I wouldn't bother.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • ajs2001txajs2001tx Posts: 25
    edited 2005-09-28 01:29
    Jon,

    Where can I get a stripboard in the Dallas/Frisco area?· Tanner was out and radio shack has no clue.· Any ideas?

    Thanks

    Andy
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-09-28 02:12
    I'm not sure what you mean by stripboard, but you could try Fry's or Altex.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • ajs2001txajs2001tx Posts: 25
    edited 2005-09-28 02:17
    http://www.kpsec.freeuk.com/stripbd.htm

    One of those boards where the entire line of each row is common and you strip off the copper in between rows where you do not want·connection.

    Thanks
    ·
  • DannyDanny Posts: 56
    edited 2005-09-28 16:18
    Did a quick google, Stripboard.com seems to be the main site, there are several others that sell the boards and a site that has a piece of software to do design.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Never create anything you can't control"
    "The amount of intelligence on the planet is fixed... the population is growing"
Sign In or Register to comment.