Shop OBEX P1 Docs P2 Docs Learn Events
simple question — Parallax Forums

simple question

ArchiverArchiver Posts: 46,084
edited 2002-05-29 14:07 in General Discussion
I apoligize for a very basic question. I tryed searching for an
answer but nothing relevent came up. All I want to do is connect a
12V DC motor to my BS2P. I assume I need a relay but when I look for
one I find few different types and very varying specs.
Thanks,
Will

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 12:43
    Hello,
    Wow, I kind have the same question. I got some 3-6 volt 312ohm reed relays
    from All Electronics and need to know if they are safe for using directly
    off a stamp pin. I am a beginner, so forgive my ignorance. Can someone tell
    me if I am using ohm's law properly if "I" is current, "V" is voltage and
    "R" is resistance then I=V/R or in my case using the example above,
    5/312= 0.016 amps. Is this formula correct? If it is then I am right in
    assuming I can drive it right off a stamp pin, as it is under 20mAh right???

    Thanks Richard

    Original Message
    From: "wc31415" <wc31415@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, December 13, 2001 5:13 AM
    Subject: [noparse][[/noparse]basicstamps] simple question


    > I apoligize for a very basic question. I tryed searching for an
    > answer but nothing relevent came up. All I want to do is connect a
    > 12V DC motor to my BS2P. I assume I need a relay but when I look for
    > one I find few different types and very varying specs.
    > Thanks,
    > Will
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 13:56
    There is a relay article in the Stamp FAQ at
    http://www.al-williams.com/wd5gnr/stampfaq.htm
    See article 2.5

    Now, my US$0.02. There are really two questions here: How do I drive a
    motor, and how do I drive a relay.

    You can use a relay to drive a motor. Depending on the motor's size, you
    may be happier using a MOSFET. Radio Shack, for example, has an IRF510
    (I think that's right) that will handle small motors. The MOSFET is
    quiet and relatively fool proof. You'd connect the source to ground, the
    drain to the motor (the motor also connects to 12V) and the gate to a
    Stamp pin. When the Stamp is not running, the FET's gate is very
    sensitive to static charge, so I'd put a 100K to 1M resistor from the
    gate to ground to bleed off anything. There is a FET article in the FAQ
    too.

    Now, if you want to use a relay, here's the deal on that. First, there
    are two things to consider when using relays. The obvious one is the
    coil. Even if you have a 5V low current coil, you should not drive it
    directly from the Stamp. Coils are inductors. When a voltage changes
    quickly through an inductor you get a reverse voltage that is
    proportional to the rate of change. That means when you switch the
    voltage from 5V to 0V almost instantly you will get a very large spike.

    The answer is to put a diode "backwards" across the relay coil. The
    Stamp has beefy I/O pins, so sometimes this will work without the diode,
    but it isn't worth trying it to find out. Even if it works for awhile,
    it may be a reliability problem for the future. So the banded end points
    to 12V and the other end points to the Stamp. However, I still would not
    drive a relay coil directly. Instead, I'd use a 2N2222 or 2N3904. Ground
    the emitter, and connect the collector to the cold end of the relay coil
    (the other end goes to 12V or 5V depending on the relay). You take the
    base of the transistor to the Stamp pin through a small resistor (1K
    should be plenty). This should handle coils that require up to, say,
    100mA. This is in the FAQ too.

    Sometimes relay coils are rated in ohms. So at 5V a 50 ohm coil will
    require 5/50 = 100mA. Of course, if the coil is rated in mA, then that's
    the right value and you could compute the resistance just as easily.

    The other thing to look at with a relay (and that most hobby electronics
    projects ignore) are the contacts. Contacts have a voltage and current
    rating too. Some contacts are rated "dry" which means you switch them
    with no current flowing. Different contact materials have different
    properties. At low power, you want contacts that stay clean. If they
    corrode, the relay will become resistive. At high power, you want a
    contact material that won't pit from the arcing that occurs when the
    contacts are close together. Corrosion is OK because the arcing will
    clean the material. Putting the wrong kind of contact in will cause
    early failure and is a big reasons relays have a reputation as
    unreliable. Switching dry contacts with power applied can cause problems
    too.

    If you can't tell, I've used relays in a government project about 20
    years ago where we had to make them last.

    I did a quick Web search, here's an interesting failure story that
    illustrates some of my points:
    http://www.leachintl2.com/english/english2/vol6/properties/how4.htm It
    also mentions a "multi load" contact which I'd never heard of. However,
    it is kind of weird since once you put high currents through it it won't
    handle low currents any more. Pretty good pages:
    http://www.leachintl2.com/english/english2/vol6/properties/00047.html

    Regards,

    Al Williams
    AWC
    * Floating point A/D
    http://www.al-williams.com/awce/pak9.htm





    >
    Original Message
    > From: wc31415 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=dD7qeuhIsUCakEYjDEsJat2MpO9RAWnyj36yjqT4L6KoxMAg33JC7hGAlKAv8G9qNo020JCmtUji6uk]wc31415@y...[/url
    > Sent: Thursday, December 13, 2001 4:13 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > I apoligize for a very basic question. I tryed searching for an
    > answer but nothing relevent came up. All I want to do is connect a
    > 12V DC motor to my BS2P. I assume I need a relay but when I look for
    > one I find few different types and very varying specs.
    > Thanks,
    > Will
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 14:03
    Be careful when using ports to drive motors even if the running
    current is within the capability of the port.
    The motor starts in what is called STALLED condition, that is the
    inductance is almost zero and only the ohmic resistance of the
    winding limits the current

    Albert Catano.


    --- In basicstamps@y..., "Richard R." <rryerson@o...> wrote:
    > Hello,
    > Wow, I kind have the same question. I got some 3-6 volt 312ohm reed
    relays
    > from All Electronics and need to know if they are safe for using
    directly
    > off a stamp pin. I am a beginner, so forgive my ignorance. Can
    someone tell
    > me if I am using ohm's law properly if "I" is current, "V" is
    voltage and
    > "R" is resistance then I=V/R or in my case using the example
    above,
    > 5/312= 0.016 amps. Is this formula correct? If it is then I am
    right in
    > assuming I can drive it right off a stamp pin, as it is under 20mAh
    right???
    >
    > Thanks Richard
    >
    >
    Original Message
    > From: "wc31415" <wc31415@y...>
    > To: <basicstamps@y...>
    > Sent: Thursday, December 13, 2001 5:13 AM
    > Subject: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > > I apoligize for a very basic question. I tryed searching for an
    > > answer but nothing relevent came up. All I want to do is connect a
    > > 12V DC motor to my BS2P. I assume I need a relay but when I look
    for
    > > one I find few different types and very varying specs.
    > > Thanks,
    > > Will
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@y...
    > > from the same email address that you subscribed. Text in the
    Subject and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 14:12
    When a relay is turn ON and then OFF, creates a voltage spike due to
    the sudden interruption of the current thru the relay and due to the
    equation:
    Vl=L*dI/dT, where Vl is the voltage acroos the relay, L is the
    inductance of the coil, dI is the current thru the coil at the time
    of the interruption, and dT is the time it takes for the magnetic
    field of the coil to collapse.
    That why is required a clamping diode either across the coil or
    across the semiconductor driving the coil.

    --- In basicstamps@y..., "Richard R." <rryerson@o...> wrote:
    > Hello,
    > Wow, I kind have the same question. I got some 3-6 volt 312ohm reed
    relays
    > from All Electronics and need to know if they are safe for using
    directly
    > off a stamp pin. I am a beginner, so forgive my ignorance. Can
    someone tell
    > me if I am using ohm's law properly if "I" is current, "V" is
    voltage and
    > "R" is resistance then I=V/R or in my case using the example
    above,
    > 5/312= 0.016 amps. Is this formula correct? If it is then I am
    right in
    > assuming I can drive it right off a stamp pin, as it is under 20mAh
    right???
    >
    > Thanks Richard
    >
    >
    Original Message
    > From: "wc31415" <wc31415@y...>
    > To: <basicstamps@y...>
    > Sent: Thursday, December 13, 2001 5:13 AM
    > Subject: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > > I apoligize for a very basic question. I tryed searching for an
    > > answer but nothing relevent came up. All I want to do is connect a
    > > 12V DC motor to my BS2P. I assume I need a relay but when I look
    for
    > > one I find few different types and very varying specs.
    > > Thanks,
    > > Will
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@y...
    > > from the same email address that you subscribed. Text in the
    Subject and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 14:15
    That's a good point too. Incandescent lamps have a similar problem known
    as inrush current. When the filament is cold it has a lot less
    resistance than when it is hot. So the bulb draws a lot more current
    when you first turn it on. This high current (and heating and cooling)
    ages the filament. In hi rel applications (like traffic lights) they
    keep a little current through the filament all the time to keep it warm
    and reduce inrush.

    Al Williams
    AWC
    * Floating point math for the Stamp, PIC, SX, or any microcontroller
    http://www.al-williams.com/awce/pak1.htm

    >
    Original Message
    > From: acatano2002 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=TR8seYXDge-eHTFbjiSA_IXzc6XdrCFBxRDn9Ryvm486lE0nJLh1z8yrSQ8elCCKDRRyzQaLiGsTxpeE6j8]acatano2002@y...[/url
    > Sent: Thursday, December 13, 2001 8:03 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Re: simple question
    >
    >
    > Be careful when using ports to drive motors even if the running
    > current is within the capability of the port.
    > The motor starts in what is called STALLED condition, that is the
    > inductance is almost zero and only the ohmic resistance of the
    > winding limits the current
    >
    > Albert Catano.
    >
    >
    > --- In basicstamps@y..., "Richard R." <rryerson@o...> wrote:
    > > Hello,
    > > Wow, I kind have the same question. I got some 3-6 volt 312ohm reed
    > relays
    > > from All Electronics and need to know if they are safe for using
    > directly
    > > off a stamp pin. I am a beginner, so forgive my ignorance. Can
    > someone tell
    > > me if I am using ohm's law properly if "I" is current, "V" is
    > voltage and
    > > "R" is resistance then I=V/R or in my case using the example
    > above,
    > > 5/312= 0.016 amps. Is this formula correct? If it is then I am
    > right in
    > > assuming I can drive it right off a stamp pin, as it is under 20mAh
    > right???
    > >
    > > Thanks Richard
    > >
    > >
    Original Message
    > > From: "wc31415" <wc31415@y...>
    > > To: <basicstamps@y...>
    > > Sent: Thursday, December 13, 2001 5:13 AM
    > > Subject: [noparse][[/noparse]basicstamps] simple question
    > >
    > >
    > > > I apoligize for a very basic question. I tryed searching for an
    > > > answer but nothing relevent came up. All I want to do is
    > connect a
    > > > 12V DC motor to my BS2P. I assume I need a relay but when I look
    > for
    > > > one I find few different types and very varying specs.
    > > > Thanks,
    > > > Will
    > > >
    > > >
    > > > To UNSUBSCRIBE, just send mail to:
    > > > basicstamps-unsubscribe@y...
    > > > from the same email address that you subscribed. Text in the
    > Subject and
    > > Body of the message will be ignored.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    > > >
    > > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 14:32
    Thank you Al (I have your book, maybe I should read it again), but now I
    feel a little foolish. What I intended to do is use a RF transmitter, a BS2
    (with it's own power supply) to power up and power down a robot. The robot
    has it's own BS2 processor, 12V motor, & motor controller board. I was
    intending to use the first BS2 as a co-processor to control the robots
    system, 12v power supply... hence the relay (to turn this on and off). I
    also want to control other systems I might add on in the future, like
    turning on/off video camera, etc. So, basically I want to have control over
    power usage... having the ability to turn systems on and off at will. Again,
    I was planning on using relays to do this. Would a 2N2222 transistor do
    this? Is it a better option? Can it drive 12V?

    Sorry, as I said, a beginner (but, I am going to check out the FAQ)

    Thanks
    Richard

    Original Message
    From: "Al Williams" <alw@a...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, December 13, 2001 8:56 AM
    Subject: RE: [noparse][[/noparse]basicstamps] simple question


    > There is a relay article in the Stamp FAQ at
    > http://www.al-williams.com/wd5gnr/stampfaq.htm
    > See article 2.5
    >
    > Now, my US$0.02. There are really two questions here: How do I drive a
    > motor, and how do I drive a relay.
    >
    > You can use a relay to drive a motor. Depending on the motor's size, you
    > may be happier using a MOSFET. Radio Shack, for example, has an IRF510
    > (I think that's right) that will handle small motors. The MOSFET is
    > quiet and relatively fool proof. You'd connect the source to ground, the
    > drain to the motor (the motor also connects to 12V) and the gate to a
    > Stamp pin. When the Stamp is not running, the FET's gate is very
    > sensitive to static charge, so I'd put a 100K to 1M resistor from the
    > gate to ground to bleed off anything. There is a FET article in the FAQ
    > too.
    >
    > Now, if you want to use a relay, here's the deal on that. First, there
    > are two things to consider when using relays. The obvious one is the
    > coil. Even if you have a 5V low current coil, you should not drive it
    > directly from the Stamp. Coils are inductors. When a voltage changes
    > quickly through an inductor you get a reverse voltage that is
    > proportional to the rate of change. That means when you switch the
    > voltage from 5V to 0V almost instantly you will get a very large spike.
    >
    > The answer is to put a diode "backwards" across the relay coil. The
    > Stamp has beefy I/O pins, so sometimes this will work without the diode,
    > but it isn't worth trying it to find out. Even if it works for awhile,
    > it may be a reliability problem for the future. So the banded end points
    > to 12V and the other end points to the Stamp. However, I still would not
    > drive a relay coil directly. Instead, I'd use a 2N2222 or 2N3904. Ground
    > the emitter, and connect the collector to the cold end of the relay coil
    > (the other end goes to 12V or 5V depending on the relay). You take the
    > base of the transistor to the Stamp pin through a small resistor (1K
    > should be plenty). This should handle coils that require up to, say,
    > 100mA. This is in the FAQ too.
    >
    > Sometimes relay coils are rated in ohms. So at 5V a 50 ohm coil will
    > require 5/50 = 100mA. Of course, if the coil is rated in mA, then that's
    > the right value and you could compute the resistance just as easily.
    >
    > The other thing to look at with a relay (and that most hobby electronics
    > projects ignore) are the contacts. Contacts have a voltage and current
    > rating too. Some contacts are rated "dry" which means you switch them
    > with no current flowing. Different contact materials have different
    > properties. At low power, you want contacts that stay clean. If they
    > corrode, the relay will become resistive. At high power, you want a
    > contact material that won't pit from the arcing that occurs when the
    > contacts are close together. Corrosion is OK because the arcing will
    > clean the material. Putting the wrong kind of contact in will cause
    > early failure and is a big reasons relays have a reputation as
    > unreliable. Switching dry contacts with power applied can cause problems
    > too.
    >
    > If you can't tell, I've used relays in a government project about 20
    > years ago where we had to make them last.
    >
    > I did a quick Web search, here's an interesting failure story that
    > illustrates some of my points:
    > http://www.leachintl2.com/english/english2/vol6/properties/how4.htm It
    > also mentions a "multi load" contact which I'd never heard of. However,
    > it is kind of weird since once you put high currents through it it won't
    > handle low currents any more. Pretty good pages:
    > http://www.leachintl2.com/english/english2/vol6/properties/00047.html
    >
    > Regards,
    >
    > Al Williams
    > AWC
    > * Floating point A/D
    > http://www.al-williams.com/awce/pak9.htm
    >
    >
    >
    >
    >
    > >
    Original Message
    > > From: wc31415 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=3MIYhOnQDFzaQdvG7vTIAYHjlw1_OkLWFMhcn11gdyrC30yEAq9gEDH3b-5_MNYjmPhIXgaOyqTi]wc31415@y...[/url
    > > Sent: Thursday, December 13, 2001 4:13 AM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] simple question
    > >
    > >
    > > I apoligize for a very basic question. I tryed searching for an
    > > answer but nothing relevent came up. All I want to do is connect a
    > > 12V DC motor to my BS2P. I assume I need a relay but when I look for
    > > one I find few different types and very varying specs.
    > > Thanks,
    > > Will
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the
    > > Subject and Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 14:45
    A 2N2222 will switch the ground leg of circuits up to around 100mA or so
    (you'd have to look at the spec sheet to see exactly how hard you could
    push, but experience says 100mA is no big deal). For bigger loads, look
    at the FET.

    Relays are OK, but they are noisy, slow, and not as reliable as solid
    state (although not as unreliable as people think if they are used
    properly). Relays are useful for AC (where solid state switching is
    available, but not nearly as simple), or very high current/voltage where
    a solid state solution might be expensive. But relays usually require a
    drive circuit anyway, so you get a 2N2222 and a relay when the
    transistor drives the relay. There are "solid state relays" by the way
    that are not really relays and you can drive them directly, but they are
    not cheap.

    As for switching, keep in mind that breaking the ground leg is as good
    as breaking the hot leg of the circuit. When you use a 2N2222 as
    described, the saturated transistor "makes" the ground leg. Turning it
    off turns off the connected device. If all the voltage is DC, you really
    don't need anything other than the 2N2222 and the IRF FET unless you
    will go to very high currents (the IRF 510 will handle up to 4 - 5 A
    (depends on temp -- see the charts at
    http://www.frn.net/tech/xmitters/anarchy/IRF-510_Data.pdf). Radio Shack
    carries these (or they used to), they are cheap, and dead simple to use.
    You can get other parts that will go over 4A, even. But at some point,
    the relays will be cheaper.

    Both devices will handle 12V (or more). When the transistor is "off" the
    Vce will be about 12V (which is OK). When the transistor is "on" the Vce
    will be just .2 or .3V.

    Al Williams
    AWC
    * Control 8 servos at once
    http://www.al-williams.com/awce/pak8.htm


    >
    Original Message
    > From: Richard R. [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=KJMR4V1JLYQ7NaGVq_KWKyW2eHTHZcBhuIVD_U2M_QTAsjdyXFkbWrvd5lUvrNdUWlUFDLBeGOqskCpJhYsH]rryerson@o...[/url
    > Sent: Thursday, December 13, 2001 8:33 AM
    > To: basicstamps@yahoogroups.com
    > Subject: Re: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > Thank you Al (I have your book, maybe I should read it
    > again), but now I feel a little foolish. What I intended to
    > do is use a RF transmitter, a BS2 (with it's own power
    > supply) to power up and power down a robot. The robot has
    > it's own BS2 processor, 12V motor, & motor controller board.
    > I was intending to use the first BS2 as a co-processor to
    > control the robots system, 12v power supply... hence the
    > relay (to turn this on and off). I also want to control other
    > systems I might add on in the future, like turning on/off
    > video camera, etc. So, basically I want to have control over
    > power usage... having the ability to turn systems on and off
    > at will. Again, I was planning on using relays to do this.
    > Would a 2N2222 transistor do this? Is it a better option?
    > Can it drive 12V?
    >
    > Sorry, as I said, a beginner (but, I am going to check out the FAQ)
    >
    > Thanks
    > Richard
    >
    >
    Original Message
    > From: "Al Williams" <alw@a...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Thursday, December 13, 2001 8:56 AM
    > Subject: RE: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > > There is a relay article in the Stamp FAQ at
    > > http://www.al-williams.com/wd5gnr/stampfaq.htm
    > > See article 2.5
    > >
    > > Now, my US$0.02. There are really two questions here: How
    > do I drive a
    > > motor, and how do I drive a relay.
    > >
    > > You can use a relay to drive a motor. Depending on the
    > motor's size,
    > > you may be happier using a MOSFET. Radio Shack, for example, has an
    > > IRF510 (I think that's right) that will handle small motors. The
    > > MOSFET is quiet and relatively fool proof. You'd connect
    > the source to
    > > ground, the drain to the motor (the motor also connects to 12V) and
    > > the gate to a Stamp pin. When the Stamp is not running, the
    > FET's gate
    > > is very sensitive to static charge, so I'd put a 100K to 1M
    > resistor
    > > from the gate to ground to bleed off anything. There is a
    > FET article
    > > in the FAQ too.
    > >
    > > Now, if you want to use a relay, here's the deal on that.
    > First, there
    > > are two things to consider when using relays. The obvious
    > one is the
    > > coil. Even if you have a 5V low current coil, you should
    > not drive it
    > > directly from the Stamp. Coils are inductors. When a
    > voltage changes
    > > quickly through an inductor you get a reverse voltage that is
    > > proportional to the rate of change. That means when you switch the
    > > voltage from 5V to 0V almost instantly you will get a very large
    > > spike.
    > >
    > > The answer is to put a diode "backwards" across the relay coil. The
    > > Stamp has beefy I/O pins, so sometimes this will work without the
    > > diode, but it isn't worth trying it to find out. Even if it
    > works for
    > > awhile, it may be a reliability problem for the future. So
    > the banded
    > > end points to 12V and the other end points to the Stamp. However, I
    > > still would not drive a relay coil directly. Instead, I'd
    > use a 2N2222
    > > or 2N3904. Ground the emitter, and connect the collector to
    > the cold
    > > end of the relay coil (the other end goes to 12V or 5V depending on
    > > the relay). You take the base of the transistor to the Stamp pin
    > > through a small resistor (1K should be plenty). This should handle
    > > coils that require up to, say, 100mA. This is in the FAQ too.
    > >
    > > Sometimes relay coils are rated in ohms. So at 5V a 50 ohm
    > coil will
    > > require 5/50 = 100mA. Of course, if the coil is rated in mA, then
    > > that's the right value and you could compute the resistance just as
    > > easily.
    > >
    > > The other thing to look at with a relay (and that most hobby
    > > electronics projects ignore) are the contacts. Contacts
    > have a voltage
    > > and current rating too. Some contacts are rated "dry" which
    > means you
    > > switch them with no current flowing. Different contact
    > materials have
    > > different properties. At low power, you want contacts that
    > stay clean.
    > > If they corrode, the relay will become resistive. At high
    > power, you
    > > want a contact material that won't pit from the arcing that occurs
    > > when the contacts are close together. Corrosion is OK because the
    > > arcing will clean the material. Putting the wrong kind of
    > contact in
    > > will cause early failure and is a big reasons relays have a
    > reputation
    > > as unreliable. Switching dry contacts with power applied can cause
    > > problems too.
    > >
    > > If you can't tell, I've used relays in a government project
    > about 20
    > > years ago where we had to make them last.
    > >
    > > I did a quick Web search, here's an interesting failure story that
    > > illustrates some of my points:
    > >
    > http://www.leachintl2.com/english/english2/vol6/properties/how
    > 4.htm It
    > > also mentions a "multi load" contact which I'd never heard of.
    > > However, it is kind of weird since once you put high
    > currents through
    > > it it won't handle low currents any more. Pretty good pages:
    > >
    > http://www.leachintl2.com/english/english2/vol6/properties/00047.html
    > >
    > > Regards,
    > >
    > > Al Williams
    > > AWC
    > > * Floating point A/D
    > > http://www.al-williams.com/awce/pak9.htm
    > >
    > >
    > >
    > >
    > >
    > > >
    Original Message
    > > > From: wc31415 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=NQVUyYWWt78YIHURlyRUhHLYMPjG_UVZhnUFSeyinBfeeDR0W2fp2o6XmvoRs-7joGsbYxN0mg]wc31415@y...[/url
    > > > Sent: Thursday, December 13, 2001 4:13 AM
    > > > To: basicstamps@yahoogroups.com
    > > > Subject: [noparse][[/noparse]basicstamps] simple question
    > > >
    > > >
    > > > I apoligize for a very basic question. I tryed searching for an
    > > > answer but nothing relevent came up. All I want to do is
    > connect a
    > > > 12V DC motor to my BS2P. I assume I need a relay but when
    > I look for
    > > > one I find few different types and very varying specs.
    > > > Thanks,
    > > > Will
    > > >
    > > >
    > > > To UNSUBSCRIBE, just send mail to:
    > > > basicstamps-unsubscribe@yahoogroups.com
    > > > from the same email address that you subscribed. Text in the
    > > > Subject and Body of the message will be ignored.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > > > http://docs.yahoo.com/info/terms/
    > > >
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in
    > the Subject
    > > and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 15:02
    Ok, I think I am starting to clue in here. If I use a Mosfet and please
    correct me if I am wrong. I do something like this... The stamp pin will be
    connected to the gate (do I use a resister to drop the voltage to around 1
    volt, or can 5 volts be applied to the gate?). Common ground (stamp & other
    power supply). Source & drain to higher power source & circuit, like 12V and
    1amp? This will isolate the stamp from the higher power circuit I want to
    control?

    Richard

    Original Message
    From: "Al Williams" <alw@a...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, December 13, 2001 9:45 AM
    Subject: RE: [noparse][[/noparse]basicstamps] simple question


    > A 2N2222 will switch the ground leg of circuits up to around 100mA or so
    > (you'd have to look at the spec sheet to see exactly how hard you could
    > push, but experience says 100mA is no big deal). For bigger loads, look
    > at the FET.
    >
    > Relays are OK, but they are noisy, slow, and not as reliable as solid
    > state (although not as unreliable as people think if they are used
    > properly). Relays are useful for AC (where solid state switching is
    > available, but not nearly as simple), or very high current/voltage where
    > a solid state solution might be expensive. But relays usually require a
    > drive circuit anyway, so you get a 2N2222 and a relay when the
    > transistor drives the relay. There are "solid state relays" by the way
    > that are not really relays and you can drive them directly, but they are
    > not cheap.
    >
    > As for switching, keep in mind that breaking the ground leg is as good
    > as breaking the hot leg of the circuit. When you use a 2N2222 as
    > described, the saturated transistor "makes" the ground leg. Turning it
    > off turns off the connected device. If all the voltage is DC, you really
    > don't need anything other than the 2N2222 and the IRF FET unless you
    > will go to very high currents (the IRF 510 will handle up to 4 - 5 A
    > (depends on temp -- see the charts at
    > http://www.frn.net/tech/xmitters/anarchy/IRF-510_Data.pdf). Radio Shack
    > carries these (or they used to), they are cheap, and dead simple to use.
    > You can get other parts that will go over 4A, even. But at some point,
    > the relays will be cheaper.
    >
    > Both devices will handle 12V (or more). When the transistor is "off" the
    > Vce will be about 12V (which is OK). When the transistor is "on" the Vce
    > will be just .2 or .3V.
    >
    > Al Williams
    > AWC
    > * Control 8 servos at once
    > http://www.al-williams.com/awce/pak8.htm
    >
    >
    > >
    Original Message
    > > From: Richard R. [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=U6lzZvUNVZphGYh1IPFTaBgt1rngs2VtJDgrts2G0iBQ2xsck_yDG9_9ZzrjcuI0aoiE5NLPfJQmL70oEeQ]rryerson@o...[/url
    > > Sent: Thursday, December 13, 2001 8:33 AM
    > > To: basicstamps@yahoogroups.com
    > > Subject: Re: [noparse][[/noparse]basicstamps] simple question
    > >
    > >
    > > Thank you Al (I have your book, maybe I should read it
    > > again), but now I feel a little foolish. What I intended to
    > > do is use a RF transmitter, a BS2 (with it's own power
    > > supply) to power up and power down a robot. The robot has
    > > it's own BS2 processor, 12V motor, & motor controller board.
    > > I was intending to use the first BS2 as a co-processor to
    > > control the robots system, 12v power supply... hence the
    > > relay (to turn this on and off). I also want to control other
    > > systems I might add on in the future, like turning on/off
    > > video camera, etc. So, basically I want to have control over
    > > power usage... having the ability to turn systems on and off
    > > at will. Again, I was planning on using relays to do this.
    > > Would a 2N2222 transistor do this? Is it a better option?
    > > Can it drive 12V?
    > >
    > > Sorry, as I said, a beginner (but, I am going to check out the FAQ)
    > >
    > > Thanks
    > > Richard
    > >
    > >
    Original Message
    > > From: "Al Williams" <alw@a...>
    > > To: <basicstamps@yahoogroups.com>
    > > Sent: Thursday, December 13, 2001 8:56 AM
    > > Subject: RE: [noparse][[/noparse]basicstamps] simple question
    > >
    > >
    > > > There is a relay article in the Stamp FAQ at
    > > > http://www.al-williams.com/wd5gnr/stampfaq.htm
    > > > See article 2.5
    > > >
    > > > Now, my US$0.02. There are really two questions here: How
    > > do I drive a
    > > > motor, and how do I drive a relay.
    > > >
    > > > You can use a relay to drive a motor. Depending on the
    > > motor's size,
    > > > you may be happier using a MOSFET. Radio Shack, for example, has an
    > > > IRF510 (I think that's right) that will handle small motors. The
    > > > MOSFET is quiet and relatively fool proof. You'd connect
    > > the source to
    > > > ground, the drain to the motor (the motor also connects to 12V) and
    > > > the gate to a Stamp pin. When the Stamp is not running, the
    > > FET's gate
    > > > is very sensitive to static charge, so I'd put a 100K to 1M
    > > resistor
    > > > from the gate to ground to bleed off anything. There is a
    > > FET article
    > > > in the FAQ too.
    > > >
    > > > Now, if you want to use a relay, here's the deal on that.
    > > First, there
    > > > are two things to consider when using relays. The obvious
    > > one is the
    > > > coil. Even if you have a 5V low current coil, you should
    > > not drive it
    > > > directly from the Stamp. Coils are inductors. When a
    > > voltage changes
    > > > quickly through an inductor you get a reverse voltage that is
    > > > proportional to the rate of change. That means when you switch the
    > > > voltage from 5V to 0V almost instantly you will get a very large
    > > > spike.
    > > >
    > > > The answer is to put a diode "backwards" across the relay coil. The
    > > > Stamp has beefy I/O pins, so sometimes this will work without the
    > > > diode, but it isn't worth trying it to find out. Even if it
    > > works for
    > > > awhile, it may be a reliability problem for the future. So
    > > the banded
    > > > end points to 12V and the other end points to the Stamp. However, I
    > > > still would not drive a relay coil directly. Instead, I'd
    > > use a 2N2222
    > > > or 2N3904. Ground the emitter, and connect the collector to
    > > the cold
    > > > end of the relay coil (the other end goes to 12V or 5V depending on
    > > > the relay). You take the base of the transistor to the Stamp pin
    > > > through a small resistor (1K should be plenty). This should handle
    > > > coils that require up to, say, 100mA. This is in the FAQ too.
    > > >
    > > > Sometimes relay coils are rated in ohms. So at 5V a 50 ohm
    > > coil will
    > > > require 5/50 = 100mA. Of course, if the coil is rated in mA, then
    > > > that's the right value and you could compute the resistance just as
    > > > easily.
    > > >
    > > > The other thing to look at with a relay (and that most hobby
    > > > electronics projects ignore) are the contacts. Contacts
    > > have a voltage
    > > > and current rating too. Some contacts are rated "dry" which
    > > means you
    > > > switch them with no current flowing. Different contact
    > > materials have
    > > > different properties. At low power, you want contacts that
    > > stay clean.
    > > > If they corrode, the relay will become resistive. At high
    > > power, you
    > > > want a contact material that won't pit from the arcing that occurs
    > > > when the contacts are close together. Corrosion is OK because the
    > > > arcing will clean the material. Putting the wrong kind of
    > > contact in
    > > > will cause early failure and is a big reasons relays have a
    > > reputation
    > > > as unreliable. Switching dry contacts with power applied can cause
    > > > problems too.
    > > >
    > > > If you can't tell, I've used relays in a government project
    > > about 20
    > > > years ago where we had to make them last.
    > > >
    > > > I did a quick Web search, here's an interesting failure story that
    > > > illustrates some of my points:
    > > >
    > > http://www.leachintl2.com/english/english2/vol6/properties/how
    > > 4.htm It
    > > > also mentions a "multi load" contact which I'd never heard of.
    > > > However, it is kind of weird since once you put high
    > > currents through
    > > > it it won't handle low currents any more. Pretty good pages:
    > > >
    > > http://www.leachintl2.com/english/english2/vol6/properties/00047.html
    > > >
    > > > Regards,
    > > >
    > > > Al Williams
    > > > AWC
    > > > * Floating point A/D
    > > > http://www.al-williams.com/awce/pak9.htm
    > > >
    > > >
    > > >
    > > >
    > > >
    > > > >
    Original Message
    > > > > From: wc31415 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=SNQ9yHTE4OrfUT5bHiJcGClrDN4DbSuIDOe7LVhUaVPQ75-lz9GF-W0snlbQde3NG-LJNtJyxQ]wc31415@y...[/url
    > > > > Sent: Thursday, December 13, 2001 4:13 AM
    > > > > To: basicstamps@yahoogroups.com
    > > > > Subject: [noparse][[/noparse]basicstamps] simple question
    > > > >
    > > > >
    > > > > I apoligize for a very basic question. I tryed searching for an
    > > > > answer but nothing relevent came up. All I want to do is
    > > connect a
    > > > > 12V DC motor to my BS2P. I assume I need a relay but when
    > > I look for
    > > > > one I find few different types and very varying specs.
    > > > > Thanks,
    > > > > Will
    > > > >
    > > > >
    > > > > To UNSUBSCRIBE, just send mail to:
    > > > > basicstamps-unsubscribe@yahoogroups.com
    > > > > from the same email address that you subscribed. Text in the
    > > > > Subject and Body of the message will be ignored.
    > > > >
    > > > >
    > > > > Your use of Yahoo! Groups is subject to
    > > > > http://docs.yahoo.com/info/terms/
    > > > >
    > > >
    > > >
    > > > To UNSUBSCRIBE, just send mail to:
    > > > basicstamps-unsubscribe@yahoogroups.com
    > > > from the same email address that you subscribed. Text in
    > > the Subject
    > > > and
    > > Body of the message will be ignored.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > > > http://docs.yahoo.com/info/terms/
    > > >
    > > >
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the
    > > Subject and Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 15:10
    Not exactly. The gate can directly connect to the Stamp pin, although as
    I mentioned before I'd put a 1M resistor between the gate and ground to
    protect the FET when the power is off.

    The source goes to ground. Then the drain goes to the "ground leg" of
    your load. So if you want to switch a lamp, for example, connect one
    side to +12 and the other side to the drain. If you use a relay, you
    probably still want a snubbing diode as described earlier. You are
    correct that all the grounds need to be in common.

    Spend $2 on a FET and do the experiment in article 2.5 of the FAQ. It
    should clear things up for you.

    Al Williams
    AWC
    * Floating point A/D
    http://www.al-williams.com/awce/pak9.htm

    >
    Original Message
    > From: Richard R. [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=9ZPlSJqio6QzHW10sYs2sV9aV01Sa54iH3IITAp8rRtQF2gL8BbRuahCDls3Uw2-Bt3QaD5-bYvunTWY89Zt]rryerson@o...[/url
    > Sent: Thursday, December 13, 2001 9:02 AM
    > To: basicstamps@yahoogroups.com
    > Subject: Re: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > Ok, I think I am starting to clue in here. If I use a Mosfet
    > and please correct me if I am wrong. I do something like
    > this... The stamp pin will be connected to the gate (do I use
    > a resister to drop the voltage to around 1 volt, or can 5
    > volts be applied to the gate?). Common ground (stamp & other
    > power supply). Source & drain to higher power source &
    > circuit, like 12V and 1amp? This will isolate the stamp from
    > the higher power circuit I want to control?
    >
    > Richard
    >
    >
    Original Message
    > From: "Al Williams" <alw@a...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Thursday, December 13, 2001 9:45 AM
    > Subject: RE: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > > A 2N2222 will switch the ground leg of circuits up to
    > around 100mA or
    > > so (you'd have to look at the spec sheet to see exactly how
    > hard you
    > > could push, but experience says 100mA is no big deal). For bigger
    > > loads, look at the FET.
    > >
    > > Relays are OK, but they are noisy, slow, and not as
    > reliable as solid
    > > state (although not as unreliable as people think if they are used
    > > properly). Relays are useful for AC (where solid state switching is
    > > available, but not nearly as simple), or very high current/voltage
    > > where a solid state solution might be expensive. But relays usually
    > > require a drive circuit anyway, so you get a 2N2222 and a
    > relay when
    > > the transistor drives the relay. There are "solid state
    > relays" by the
    > > way that are not really relays and you can drive them directly, but
    > > they are not cheap.
    > >
    > > As for switching, keep in mind that breaking the ground leg
    > is as good
    > > as breaking the hot leg of the circuit. When you use a 2N2222 as
    > > described, the saturated transistor "makes" the ground leg.
    > Turning it
    > > off turns off the connected device. If all the voltage is DC, you
    > > really don't need anything other than the 2N2222 and the IRF FET
    > > unless you will go to very high currents (the IRF 510 will
    > handle up
    > > to 4 - 5 A (depends on temp -- see the charts at
    > > http://www.frn.net/tech/xmitters/anarchy/IRF-510_Data.pdf). Radio
    > > Shack carries these (or they used to), they are cheap, and
    > dead simple
    > > to use. You can get other parts that will go over 4A, even. But at
    > > some point, the relays will be cheaper.
    > >
    > > Both devices will handle 12V (or more). When the transistor
    > is "off"
    > > the Vce will be about 12V (which is OK). When the
    > transistor is "on"
    > > the Vce will be just .2 or .3V.
    > >
    > > Al Williams
    > > AWC
    > > * Control 8 servos at once http://www.al-williams.com/awce/pak8.htm
    > >
    > >
    > > >
    Original Message
    > > > From: Richard R. [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=9ZPlSJqio6QzHW10sYs2sV9aV01Sa54iH3IITAp8rRtQF2gL8BbRuahCDls3Uw2-Bt3QaD5-bYvunTWY89Zt]rryerson@o...[/url
    > > > Sent: Thursday, December 13, 2001 8:33 AM
    > > > To: basicstamps@yahoogroups.com
    > > > Subject: Re: [noparse][[/noparse]basicstamps] simple question
    > > >
    > > >
    > > > Thank you Al (I have your book, maybe I should read it
    > > > again), but now I feel a little foolish. What I intended to
    > > > do is use a RF transmitter, a BS2 (with it's own power
    > > > supply) to power up and power down a robot. The robot has
    > > > it's own BS2 processor, 12V motor, & motor controller board.
    > > > I was intending to use the first BS2 as a co-processor to
    > > > control the robots system, 12v power supply... hence the
    > > > relay (to turn this on and off). I also want to control other
    > > > systems I might add on in the future, like turning on/off
    > > > video camera, etc. So, basically I want to have control over
    > > > power usage... having the ability to turn systems on and off
    > > > at will. Again, I was planning on using relays to do this.
    > > > Would a 2N2222 transistor do this? Is it a better option?
    > > > Can it drive 12V?
    > > >
    > > > Sorry, as I said, a beginner (but, I am going to check
    > out the FAQ)
    > > >
    > > > Thanks
    > > > Richard
    > > >
    > > >
    Original Message
    > > > From: "Al Williams" <alw@a...>
    > > > To: <basicstamps@yahoogroups.com>
    > > > Sent: Thursday, December 13, 2001 8:56 AM
    > > > Subject: RE: [noparse][[/noparse]basicstamps] simple question
    > > >
    > > >
    > > > > There is a relay article in the Stamp FAQ at
    > > > > http://www.al-williams.com/wd5gnr/stampfaq.htm
    > > > > See article 2.5
    > > > >
    > > > > Now, my US$0.02. There are really two questions here: How
    > > > do I drive a
    > > > > motor, and how do I drive a relay.
    > > > >
    > > > > You can use a relay to drive a motor. Depending on the
    > > > motor's size,
    > > > > you may be happier using a MOSFET. Radio Shack, for
    > example, has an
    > > > > IRF510 (I think that's right) that will handle small motors. The
    > > > > MOSFET is quiet and relatively fool proof. You'd connect
    > > > the source to
    > > > > ground, the drain to the motor (the motor also connects
    > to 12V) and
    > > > > the gate to a Stamp pin. When the Stamp is not running, the
    > > > FET's gate
    > > > > is very sensitive to static charge, so I'd put a 100K to 1M
    > > > resistor
    > > > > from the gate to ground to bleed off anything. There is a
    > > > FET article
    > > > > in the FAQ too.
    > > > >
    > > > > Now, if you want to use a relay, here's the deal on that.
    > > > First, there
    > > > > are two things to consider when using relays. The obvious
    > > > one is the
    > > > > coil. Even if you have a 5V low current coil, you should
    > > > not drive it
    > > > > directly from the Stamp. Coils are inductors. When a
    > > > voltage changes
    > > > > quickly through an inductor you get a reverse voltage that is
    > > > > proportional to the rate of change. That means when you
    > switch the
    > > > > voltage from 5V to 0V almost instantly you will get a very large
    > > > > spike.
    > > > >
    > > > > The answer is to put a diode "backwards" across the
    > relay coil. The
    > > > > Stamp has beefy I/O pins, so sometimes this will work
    > without the
    > > > > diode, but it isn't worth trying it to find out. Even if it
    > > > works for
    > > > > awhile, it may be a reliability problem for the future. So
    > > > the banded
    > > > > end points to 12V and the other end points to the
    > Stamp. However, I
    > > > > still would not drive a relay coil directly. Instead, I'd
    > > > use a 2N2222
    > > > > or 2N3904. Ground the emitter, and connect the collector to
    > > > the cold
    > > > > end of the relay coil (the other end goes to 12V or 5V
    > depending on
    > > > > the relay). You take the base of the transistor to the Stamp pin
    > > > > through a small resistor (1K should be plenty). This
    > should handle
    > > > > coils that require up to, say, 100mA. This is in the FAQ too.
    > > > >
    > > > > Sometimes relay coils are rated in ohms. So at 5V a 50 ohm
    > > > coil will
    > > > > require 5/50 = 100mA. Of course, if the coil is rated
    > in mA, then
    > > > > that's the right value and you could compute the
    > resistance just as
    > > > > easily.
    > > > >
    > > > > The other thing to look at with a relay (and that most hobby
    > > > > electronics projects ignore) are the contacts. Contacts
    > > > have a voltage
    > > > > and current rating too. Some contacts are rated "dry" which
    > > > means you
    > > > > switch them with no current flowing. Different contact
    > > > materials have
    > > > > different properties. At low power, you want contacts that
    > > > stay clean.
    > > > > If they corrode, the relay will become resistive. At high
    > > > power, you
    > > > > want a contact material that won't pit from the arcing
    > that occurs
    > > > > when the contacts are close together. Corrosion is OK
    > because the
    > > > > arcing will clean the material. Putting the wrong kind of
    > > > contact in
    > > > > will cause early failure and is a big reasons relays have a
    > > > reputation
    > > > > as unreliable. Switching dry contacts with power
    > applied can cause
    > > > > problems too.
    > > > >
    > > > > If you can't tell, I've used relays in a government project
    > > > about 20
    > > > > years ago where we had to make them last.
    > > > >
    > > > > I did a quick Web search, here's an interesting failure
    > story that
    > > > > illustrates some of my points:
    > > > >
    > > > http://www.leachintl2.com/english/english2/vol6/properties/how
    > > > 4.htm It
    > > > > also mentions a "multi load" contact which I'd never heard of.
    > > > > However, it is kind of weird since once you put high
    > > > currents through
    > > > > it it won't handle low currents any more. Pretty good pages:
    > > > >
    > > >
    > http://www.leachintl2.com/english/english2/vol6/properties/00047.html
    > > > >
    > > > > Regards,
    > > > >
    > > > > Al Williams
    > > > > AWC
    > > > > * Floating point A/D
    > > > > http://www.al-williams.com/awce/pak9.htm
    > > > >
    > > > >
    > > > >
    > > > >
    > > > >
    > > > > >
    Original Message
    > > > > > From: wc31415 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=KUuB1VSYo-nZ3woQTMow9zCeQ9Eu7i49gVcGOYr9ssRgPFSYkNsi-7793cZ9eXtdFrxdUUiTPHieTOJX]wc31415@y...[/url
    > > > > > Sent: Thursday, December 13, 2001 4:13 AM
    > > > > > To: basicstamps@yahoogroups.com
    > > > > > Subject: [noparse][[/noparse]basicstamps] simple question
    > > > > >
    > > > > >
    > > > > > I apoligize for a very basic question. I tryed
    > searching for an
    > > > > > answer but nothing relevent came up. All I want to do is
    > > > connect a
    > > > > > 12V DC motor to my BS2P. I assume I need a relay but when
    > > > I look for
    > > > > > one I find few different types and very varying specs.
    > > > > > Thanks,
    > > > > > Will
    > > > > >
    > > > > >
    > > > > > To UNSUBSCRIBE, just send mail to:
    > > > > > basicstamps-unsubscribe@yahoogroups.com
    > > > > > from the same email address that you subscribed. Text in the
    > > > > > Subject and Body of the message will be ignored.
    > > > > >
    > > > > >
    > > > > > Your use of Yahoo! Groups is subject to
    > > > > > http://docs.yahoo.com/info/terms/
    > > > > >
    > > > >
    > > > >
    > > > > To UNSUBSCRIBE, just send mail to:
    > > > > basicstamps-unsubscribe@yahoogroups.com
    > > > > from the same email address that you subscribed. Text in
    > > > the Subject
    > > > > and
    > > > Body of the message will be ignored.
    > > > >
    > > > >
    > > > > Your use of Yahoo! Groups is subject to
    > > > > http://docs.yahoo.com/info/terms/
    > > > >
    > > > >
    > > >
    > > >
    > > > To UNSUBSCRIBE, just send mail to:
    > > > basicstamps-unsubscribe@yahoogroups.com
    > > > from the same email address that you subscribed. Text in the
    > > > Subject and Body of the message will be ignored.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > > > http://docs.yahoo.com/info/terms/
    > > >
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in
    > the Subject and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > To UNSUBSCRIBE, just
    > send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 15:11
    By the way, the correct number is IRF 510 but Radio Shack mislabels them
    IFR510. I need to update the FAQ to reflect this.

    Regards,

    Al Williams
    AWC
    * Easy RS-232 Prototyping
    http://www.al-williams.com/awce/rs1.htm

    >
    Original Message
    > From: Richard R. [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=NLWF5uX67QmyjhbEjfLrwXxEfLwkvfJC86n7YSnRbeLsxd3oUcaMVa-BAITf-aPCHrOlJz1Sa86PfJfOxfLW]rryerson@o...[/url
    > Sent: Thursday, December 13, 2001 9:02 AM
    > To: basicstamps@yahoogroups.com
    > Subject: Re: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > Ok, I think I am starting to clue in here. If I use a Mosfet
    > and please correct me if I am wrong. I do something like
    > this... The stamp pin will be connected to the gate (do I use
    > a resister to drop the voltage to around 1 volt, or can 5
    > volts be applied to the gate?). Common ground (stamp & other
    > power supply). Source & drain to higher power source &
    > circuit, like 12V and 1amp? This will isolate the stamp from
    > the higher power circuit I want to control?
    >
    > Richard
    >
    >
    Original Message
    > From: "Al Williams" <alw@a...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Thursday, December 13, 2001 9:45 AM
    > Subject: RE: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > > A 2N2222 will switch the ground leg of circuits up to
    > around 100mA or
    > > so (you'd have to look at the spec sheet to see exactly how
    > hard you
    > > could push, but experience says 100mA is no big deal). For bigger
    > > loads, look at the FET.
    > >
    > > Relays are OK, but they are noisy, slow, and not as
    > reliable as solid
    > > state (although not as unreliable as people think if they are used
    > > properly). Relays are useful for AC (where solid state switching is
    > > available, but not nearly as simple), or very high current/voltage
    > > where a solid state solution might be expensive. But relays usually
    > > require a drive circuit anyway, so you get a 2N2222 and a
    > relay when
    > > the transistor drives the relay. There are "solid state
    > relays" by the
    > > way that are not really relays and you can drive them directly, but
    > > they are not cheap.
    > >
    > > As for switching, keep in mind that breaking the ground leg
    > is as good
    > > as breaking the hot leg of the circuit. When you use a 2N2222 as
    > > described, the saturated transistor "makes" the ground leg.
    > Turning it
    > > off turns off the connected device. If all the voltage is DC, you
    > > really don't need anything other than the 2N2222 and the IRF FET
    > > unless you will go to very high currents (the IRF 510 will
    > handle up
    > > to 4 - 5 A (depends on temp -- see the charts at
    > > http://www.frn.net/tech/xmitters/anarchy/IRF-510_Data.pdf). Radio
    > > Shack carries these (or they used to), they are cheap, and
    > dead simple
    > > to use. You can get other parts that will go over 4A, even. But at
    > > some point, the relays will be cheaper.
    > >
    > > Both devices will handle 12V (or more). When the transistor
    > is "off"
    > > the Vce will be about 12V (which is OK). When the
    > transistor is "on"
    > > the Vce will be just .2 or .3V.
    > >
    > > Al Williams
    > > AWC
    > > * Control 8 servos at once http://www.al-williams.com/awce/pak8.htm
    > >
    > >
    > > >
    Original Message
    > > > From: Richard R. [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=NLWF5uX67QmyjhbEjfLrwXxEfLwkvfJC86n7YSnRbeLsxd3oUcaMVa-BAITf-aPCHrOlJz1Sa86PfJfOxfLW]rryerson@o...[/url
    > > > Sent: Thursday, December 13, 2001 8:33 AM
    > > > To: basicstamps@yahoogroups.com
    > > > Subject: Re: [noparse][[/noparse]basicstamps] simple question
    > > >
    > > >
    > > > Thank you Al (I have your book, maybe I should read it
    > > > again), but now I feel a little foolish. What I intended to
    > > > do is use a RF transmitter, a BS2 (with it's own power
    > > > supply) to power up and power down a robot. The robot has
    > > > it's own BS2 processor, 12V motor, & motor controller board.
    > > > I was intending to use the first BS2 as a co-processor to
    > > > control the robots system, 12v power supply... hence the
    > > > relay (to turn this on and off). I also want to control other
    > > > systems I might add on in the future, like turning on/off
    > > > video camera, etc. So, basically I want to have control over
    > > > power usage... having the ability to turn systems on and off
    > > > at will. Again, I was planning on using relays to do this.
    > > > Would a 2N2222 transistor do this? Is it a better option?
    > > > Can it drive 12V?
    > > >
    > > > Sorry, as I said, a beginner (but, I am going to check
    > out the FAQ)
    > > >
    > > > Thanks
    > > > Richard
    > > >
    > > >
    Original Message
    > > > From: "Al Williams" <alw@a...>
    > > > To: <basicstamps@yahoogroups.com>
    > > > Sent: Thursday, December 13, 2001 8:56 AM
    > > > Subject: RE: [noparse][[/noparse]basicstamps] simple question
    > > >
    > > >
    > > > > There is a relay article in the Stamp FAQ at
    > > > > http://www.al-williams.com/wd5gnr/stampfaq.htm
    > > > > See article 2.5
    > > > >
    > > > > Now, my US$0.02. There are really two questions here: How
    > > > do I drive a
    > > > > motor, and how do I drive a relay.
    > > > >
    > > > > You can use a relay to drive a motor. Depending on the
    > > > motor's size,
    > > > > you may be happier using a MOSFET. Radio Shack, for
    > example, has an
    > > > > IRF510 (I think that's right) that will handle small motors. The
    > > > > MOSFET is quiet and relatively fool proof. You'd connect
    > > > the source to
    > > > > ground, the drain to the motor (the motor also connects
    > to 12V) and
    > > > > the gate to a Stamp pin. When the Stamp is not running, the
    > > > FET's gate
    > > > > is very sensitive to static charge, so I'd put a 100K to 1M
    > > > resistor
    > > > > from the gate to ground to bleed off anything. There is a
    > > > FET article
    > > > > in the FAQ too.
    > > > >
    > > > > Now, if you want to use a relay, here's the deal on that.
    > > > First, there
    > > > > are two things to consider when using relays. The obvious
    > > > one is the
    > > > > coil. Even if you have a 5V low current coil, you should
    > > > not drive it
    > > > > directly from the Stamp. Coils are inductors. When a
    > > > voltage changes
    > > > > quickly through an inductor you get a reverse voltage that is
    > > > > proportional to the rate of change. That means when you
    > switch the
    > > > > voltage from 5V to 0V almost instantly you will get a very large
    > > > > spike.
    > > > >
    > > > > The answer is to put a diode "backwards" across the
    > relay coil. The
    > > > > Stamp has beefy I/O pins, so sometimes this will work
    > without the
    > > > > diode, but it isn't worth trying it to find out. Even if it
    > > > works for
    > > > > awhile, it may be a reliability problem for the future. So
    > > > the banded
    > > > > end points to 12V and the other end points to the
    > Stamp. However, I
    > > > > still would not drive a relay coil directly. Instead, I'd
    > > > use a 2N2222
    > > > > or 2N3904. Ground the emitter, and connect the collector to
    > > > the cold
    > > > > end of the relay coil (the other end goes to 12V or 5V
    > depending on
    > > > > the relay). You take the base of the transistor to the Stamp pin
    > > > > through a small resistor (1K should be plenty). This
    > should handle
    > > > > coils that require up to, say, 100mA. This is in the FAQ too.
    > > > >
    > > > > Sometimes relay coils are rated in ohms. So at 5V a 50 ohm
    > > > coil will
    > > > > require 5/50 = 100mA. Of course, if the coil is rated
    > in mA, then
    > > > > that's the right value and you could compute the
    > resistance just as
    > > > > easily.
    > > > >
    > > > > The other thing to look at with a relay (and that most hobby
    > > > > electronics projects ignore) are the contacts. Contacts
    > > > have a voltage
    > > > > and current rating too. Some contacts are rated "dry" which
    > > > means you
    > > > > switch them with no current flowing. Different contact
    > > > materials have
    > > > > different properties. At low power, you want contacts that
    > > > stay clean.
    > > > > If they corrode, the relay will become resistive. At high
    > > > power, you
    > > > > want a contact material that won't pit from the arcing
    > that occurs
    > > > > when the contacts are close together. Corrosion is OK
    > because the
    > > > > arcing will clean the material. Putting the wrong kind of
    > > > contact in
    > > > > will cause early failure and is a big reasons relays have a
    > > > reputation
    > > > > as unreliable. Switching dry contacts with power
    > applied can cause
    > > > > problems too.
    > > > >
    > > > > If you can't tell, I've used relays in a government project
    > > > about 20
    > > > > years ago where we had to make them last.
    > > > >
    > > > > I did a quick Web search, here's an interesting failure
    > story that
    > > > > illustrates some of my points:
    > > > >
    > > > http://www.leachintl2.com/english/english2/vol6/properties/how
    > > > 4.htm It
    > > > > also mentions a "multi load" contact which I'd never heard of.
    > > > > However, it is kind of weird since once you put high
    > > > currents through
    > > > > it it won't handle low currents any more. Pretty good pages:
    > > > >
    > > >
    > http://www.leachintl2.com/english/english2/vol6/properties/00047.html
    > > > >
    > > > > Regards,
    > > > >
    > > > > Al Williams
    > > > > AWC
    > > > > * Floating point A/D
    > > > > http://www.al-williams.com/awce/pak9.htm
    > > > >
    > > > >
    > > > >
    > > > >
    > > > >
    > > > > >
    Original Message
    > > > > > From: wc31415 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=oJ5F2eX-A4h9KPBf6Z8g4_Xc8DM1x0pTxbyjqvnRn66fABvxOwYDXYJI6KkG7o94kztTgmvL6fb_qWuH]wc31415@y...[/url
    > > > > > Sent: Thursday, December 13, 2001 4:13 AM
    > > > > > To: basicstamps@yahoogroups.com
    > > > > > Subject: [noparse][[/noparse]basicstamps] simple question
    > > > > >
    > > > > >
    > > > > > I apoligize for a very basic question. I tryed
    > searching for an
    > > > > > answer but nothing relevent came up. All I want to do is
    > > > connect a
    > > > > > 12V DC motor to my BS2P. I assume I need a relay but when
    > > > I look for
    > > > > > one I find few different types and very varying specs.
    > > > > > Thanks,
    > > > > > Will
    > > > > >
    > > > > >
    > > > > > To UNSUBSCRIBE, just send mail to:
    > > > > > basicstamps-unsubscribe@yahoogroups.com
    > > > > > from the same email address that you subscribed. Text in the
    > > > > > Subject and Body of the message will be ignored.
    > > > > >
    > > > > >
    > > > > > Your use of Yahoo! Groups is subject to
    > > > > > http://docs.yahoo.com/info/terms/
    > > > > >
    > > > >
    > > > >
    > > > > To UNSUBSCRIBE, just send mail to:
    > > > > basicstamps-unsubscribe@yahoogroups.com
    > > > > from the same email address that you subscribed. Text in
    > > > the Subject
    > > > > and
    > > > Body of the message will be ignored.
    > > > >
    > > > >
    > > > > Your use of Yahoo! Groups is subject to
    > > > > http://docs.yahoo.com/info/terms/
    > > > >
    > > > >
    > > >
    > > >
    > > > To UNSUBSCRIBE, just send mail to:
    > > > basicstamps-unsubscribe@yahoogroups.com
    > > > from the same email address that you subscribed. Text in the
    > > > Subject and Body of the message will be ignored.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > > > http://docs.yahoo.com/info/terms/
    > > >
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in
    > the Subject and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > To UNSUBSCRIBE, just
    > send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 15:23
    At 09:32 AM 12/13/2001 -0500, you wrote:
    >Thank you Al (I have your book, maybe I should read it again), but now I
    >feel a little foolish. What I intended to do is use a RF transmitter, a BS2
    >(with it's own power supply) to power up and power down a robot. The robot
    >has it's own BS2 processor, 12V motor, & motor controller board. I was
    >intending to use the first BS2 as a co-processor to control the robots
    >system, 12v power supply... hence the relay (to turn this on and off). I
    >also want to control other systems I might add on in the future, like
    >turning on/off video camera, etc. So, basically I want to have control over
    >power usage... having the ability to turn systems on and off at will. Again,
    >I was planning on using relays to do this. Would a 2N2222 transistor do
    >this? Is it a better option? Can it drive 12V?
    >
    >Sorry, as I said, a beginner (but, I am going to check out the FAQ)
    >
    >Thanks
    >Richard
    Hi Richard -

    You might want to take a look at the Reynolds Electronics web site for how
    to implement an RF Link relay setup. Here is the web page of interest:
    http://www.rentron.com/rf_remote_control.htm

    Hope that gets you started.

    Regards,

    Bruce Bates
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 15:25
    Most mosfets (IRF510 IRF511 IRF541 et.al.) are a bit marginal when the gate
    is 5 vdc
    one exception is the 2n7000 mosfet, it is designed for ttl logic level
    switching.
    Personally I use a 2n3904 or 2n2222 with a pull-up resistor from 12v to the
    collector-gate connection
    and 2 snubbers one reverse biased drain to source, the other reverse biased
    drain to 12V to prevent high spikes from exceeding the mosfets max voltage
    when the load is switched off..

    Original Message
    From: "Al Williams"
    > Not exactly. The gate can directly connect to the Stamp pin, although as
    > I mentioned before I'd put a 1M resistor between the gate and ground to
    > protect the FET when the power is off.
    >
    > The source goes to ground. Then the drain goes to the "ground leg" of
    > your load. So if you want to switch a lamp, for example, connect one
    > side to +12 and the other side to the drain. If you use a relay, you
    > probably still want a snubbing diode as described earlier. You are
    > correct that all the grounds need to be in common.
    >
    > Spend $2 on a FET and do the experiment in article 2.5 of the FAQ. It
    > should clear things up for you.
    >
    > Al Williams
    > AWC
    > * Floating point A/D
    > http://www.al-williams.com/awce/pak9.htm
    >
    > >
    Original Message
    > > From: Richard R. > > Ok, I think I am starting to clue in here. If I use
    a Mosfet
    > > and please correct me if I am wrong. I do something like
    > > this... The stamp pin will be connected to the gate (do I use
    > > a resister to drop the voltage to around 1 volt, or can 5
    > > volts be applied to the gate?). Common ground (stamp & other
    > > power supply). Source & drain to higher power source &
    > > circuit, like 12V and 1amp? This will isolate the stamp from
    > > the higher power circuit I want to control?
    > >
    > > Richard
    > >
    > >
    Original Message
    > > From: "Al Williams"
    > > > A 2N2222 will switch the ground leg of circuits up to
    > > around 100mA or
    > > > so (you'd have to look at the spec sheet to see exactly how
    > > hard you
    > > > could push, but experience says 100mA is no big deal). For bigger
    > > > loads, look at the FET.
    > > >
    > > > Relays are OK, but they are noisy, slow, and not as
    > > reliable as solid
    > > > state (although not as unreliable as people think if they are used
    > > > properly). Relays are useful for AC (where solid state switching is
    > > > available, but not nearly as simple), or very high current/voltage
    > > > where a solid state solution might be expensive. But relays usually
    > > > require a drive circuit anyway, so you get a 2N2222 and a
    > > relay when
    > > > the transistor drives the relay. There are "solid state
    > > relays" by the
    > > > way that are not really relays and you can drive them directly, but
    > > > they are not cheap.
    > > >
    > > > As for switching, keep in mind that breaking the ground leg
    > > is as good
    > > > as breaking the hot leg of the circuit. When you use a 2N2222 as
    > > > described, the saturated transistor "makes" the ground leg.
    > > Turning it
    > > > off turns off the connected device. If all the voltage is DC, you
    > > > really don't need anything other than the 2N2222 and the IRF FET
    > > > unless you will go to very high currents (the IRF 510 will
    > > handle up
    > > > to 4 - 5 A (depends on temp -- see the charts at
    > > > http://www.frn.net/tech/xmitters/anarchy/IRF-510_Data.pdf). Radio
    > > > Shack carries these (or they used to), they are cheap, and
    > > dead simple
    > > > to use. You can get other parts that will go over 4A, even. But at
    > > > some point, the relays will be cheaper.
    > > >
    > > > Both devices will handle 12V (or more). When the transistor
    > > is "off"
    > > > the Vce will be about 12V (which is OK). When the
    > > transistor is "on"
    > > > the Vce will be just .2 or .3V.
    > > >
    > > > Al Williams
    > > > AWC
    > > > * Control 8 servos at once http://www.al-williams.com/awce/pak8.htm
    > > >
    > > >
    > > > >
    Original Message
    > > > > From: Richard R. [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=2zR-39Og3Iq47BaQCtaliOy2exLVt1Kfvqbz6MAlfQkCLkTY1zsm_TDXW__WH5U_n_3OZTyV4Qgc1g]rryerson@o...[/url
    > > > > Sent: Thursday, December 13, 2001 8:33 AM
    > > > > To: basicstamps@yahoogroups.com
    > > > > Subject: Re: [noparse][[/noparse]basicstamps] simple question
    > > > >
    > > > >
    > > > > Thank you Al (I have your book, maybe I should read it
    > > > > again), but now I feel a little foolish. What I intended to
    > > > > do is use a RF transmitter, a BS2 (with it's own power
    > > > > supply) to power up and power down a robot. The robot has
    > > > > it's own BS2 processor, 12V motor, & motor controller board.
    > > > > I was intending to use the first BS2 as a co-processor to
    > > > > control the robots system, 12v power supply... hence the
    > > > > relay (to turn this on and off). I also want to control other
    > > > > systems I might add on in the future, like turning on/off
    > > > > video camera, etc. So, basically I want to have control over
    > > > > power usage... having the ability to turn systems on and off
    > > > > at will. Again, I was planning on using relays to do this.
    > > > > Would a 2N2222 transistor do this? Is it a better option?
    > > > > Can it drive 12V?
    > > > >
    > > > > Sorry, as I said, a beginner (but, I am going to check
    > > out the FAQ)
    > > > >
    > > > > Thanks
    > > > > Richard
    > > > >
    > > > >
    Original Message
    > > > > From: "Al Williams" <alw@a...>
    > > > > To: <basicstamps@yahoogroups.com>
    > > > > Sent: Thursday, December 13, 2001 8:56 AM
    > > > > Subject: RE: [noparse][[/noparse]basicstamps] simple question
    > > > >
    > > > >
    > > > > > There is a relay article in the Stamp FAQ at
    > > > > > http://www.al-williams.com/wd5gnr/stampfaq.htm
    > > > > > See article 2.5
    > > > > >
    > > > > > Now, my US$0.02. There are really two questions here: How
    > > > > do I drive a
    > > > > > motor, and how do I drive a relay.
    > > > > >
    > > > > > You can use a relay to drive a motor. Depending on the
    > > > > motor's size,
    > > > > > you may be happier using a MOSFET. Radio Shack, for
    > > example, has an
    > > > > > IRF510 (I think that's right) that will handle small motors. The
    > > > > > MOSFET is quiet and relatively fool proof. You'd connect
    > > > > the source to
    > > > > > ground, the drain to the motor (the motor also connects
    > > to 12V) and
    > > > > > the gate to a Stamp pin. When the Stamp is not running, the
    > > > > FET's gate
    > > > > > is very sensitive to static charge, so I'd put a 100K to 1M
    > > > > resistor
    > > > > > from the gate to ground to bleed off anything. There is a
    > > > > FET article
    > > > > > in the FAQ too.
    > > > > >
    > > > > > Now, if you want to use a relay, here's the deal on that.
    > > > > First, there
    > > > > > are two things to consider when using relays. The obvious
    > > > > one is the
    > > > > > coil. Even if you have a 5V low current coil, you should
    > > > > not drive it
    > > > > > directly from the Stamp. Coils are inductors. When a
    > > > > voltage changes
    > > > > > quickly through an inductor you get a reverse voltage that is
    > > > > > proportional to the rate of change. That means when you
    > > switch the
    > > > > > voltage from 5V to 0V almost instantly you will get a very large
    > > > > > spike.
    > > > > >
    > > > > > The answer is to put a diode "backwards" across the
    > > relay coil. The
    > > > > > Stamp has beefy I/O pins, so sometimes this will work
    > > without the
    > > > > > diode, but it isn't worth trying it to find out. Even if it
    > > > > works for
    > > > > > awhile, it may be a reliability problem for the future. So
    > > > > the banded
    > > > > > end points to 12V and the other end points to the
    > > Stamp. However, I
    > > > > > still would not drive a relay coil directly. Instead, I'd
    > > > > use a 2N2222
    > > > > > or 2N3904. Ground the emitter, and connect the collector to
    > > > > the cold
    > > > > > end of the relay coil (the other end goes to 12V or 5V
    > > depending on
    > > > > > the relay). You take the base of the transistor to the Stamp pin
    > > > > > through a small resistor (1K should be plenty). This
    > > should handle
    > > > > > coils that require up to, say, 100mA. This is in the FAQ too.
    > > > > >
    > > > > > Sometimes relay coils are rated in ohms. So at 5V a 50 ohm
    > > > > coil will
    > > > > > require 5/50 = 100mA. Of course, if the coil is rated
    > > in mA, then
    > > > > > that's the right value and you could compute the
    > > resistance just as
    > > > > > easily.
    > > > > >
    > > > > > The other thing to look at with a relay (and that most hobby
    > > > > > electronics projects ignore) are the contacts. Contacts
    > > > > have a voltage
    > > > > > and current rating too. Some contacts are rated "dry" which
    > > > > means you
    > > > > > switch them with no current flowing. Different contact
    > > > > materials have
    > > > > > different properties. At low power, you want contacts that
    > > > > stay clean.
    > > > > > If they corrode, the relay will become resistive. At high
    > > > > power, you
    > > > > > want a contact material that won't pit from the arcing
    > > that occurs
    > > > > > when the contacts are close together. Corrosion is OK
    > > because the
    > > > > > arcing will clean the material. Putting the wrong kind of
    > > > > contact in
    > > > > > will cause early failure and is a big reasons relays have a
    > > > > reputation
    > > > > > as unreliable. Switching dry contacts with power
    > > applied can cause
    > > > > > problems too.
    > > > > >
    > > > > > If you can't tell, I've used relays in a government project
    > > > > about 20
    > > > > > years ago where we had to make them last.
    > > > > >
    > > > > > I did a quick Web search, here's an interesting failure
    > > story that
    > > > > > illustrates some of my points:
    > > > > >
    > > > > http://www.leachintl2.com/english/english2/vol6/properties/how
    > > > > 4.htm It
    > > > > > also mentions a "multi load" contact which I'd never heard of.
    > > > > > However, it is kind of weird since once you put high
    > > > > currents through
    > > > > > it it won't handle low currents any more. Pretty good pages:
    > > > > >
    > > > >
    > > http://www.leachintl2.com/english/english2/vol6/properties/00047.html
    > > > > >
    > > > > > Regards,
    > > > > >
    > > > > > Al Williams
    > > > > > AWC
    > > > > > * Floating point A/D
    > > > > > http://www.al-williams.com/awce/pak9.htm
    > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > > > > >
    Original Message
    > > > > > > From: wc31415 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Lqv4tosvmZObUjBQiuAcw5hJ1xr35tpSbPj_KNJWVMsyGJkF_xdgIuuB7D37l1cgvAnR5wZTeg]wc31415@y...[/url
    > > > > > > Sent: Thursday, December 13, 2001 4:13 AM
    > > > > > > To: basicstamps@yahoogroups.com
    > > > > > > Subject: [noparse][[/noparse]basicstamps] simple question
    > > > > > >
    > > > > > >
    > > > > > > I apoligize for a very basic question. I tryed
    > > searching for an
    > > > > > > answer but nothing relevent came up. All I want to do is
    > > > > connect a
    > > > > > > 12V DC motor to my BS2P. I assume I need a relay but when
    > > > > I look for
    > > > > > > one I find few different types and very varying specs.
    > > > > > > Thanks,
    > > > > > > Will
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 15:42
    I've never had any trouble driving IRF FETs from CMOS outputs where you
    have a full output swing. TTL might be a problem since the Vgs is right
    around the 1 threshold. Of course, with a low Vgs you probably won't get
    the full Id rating, but I've used 5V drive for up to about 1.5A with no
    trouble.

    Regards,

    Al Williams
    AWC
    * 8 channels of PWM
    http://www.al-williams.com/awce/pak5.htm

    >
    Original Message
    > From: FalconWireless Tech Support - KF4HAZ
    > [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=GHUSO7Uu6kNaV0zkM-oaZh5RmVMCmVaZjy_SlbFS9t_meGWBCw0tbXTqBNq5A0lzwuEhG3TZdJXkkw1as6CUJuKxnkt4]techsupport@f...[/url
    > Sent: Thursday, December 13, 2001 9:25 AM
    > To: basicstamps@yahoogroups.com
    > Subject: Re: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > Most mosfets (IRF510 IRF511 IRF541 et.al.) are a bit marginal
    > when the gate is 5 vdc one exception is the 2n7000 mosfet, it
    > is designed for ttl logic level switching. Personally I use a
    > 2n3904 or 2n2222 with a pull-up resistor from 12v to the
    > collector-gate connection and 2 snubbers one reverse biased
    > drain to source, the other reverse biased drain to 12V to
    > prevent high spikes from exceeding the mosfets max voltage
    > when the load is switched off..
    >
    >
    Original Message
    > From: "Al Williams"
    > > Not exactly. The gate can directly connect to the Stamp
    > pin, although
    > > as I mentioned before I'd put a 1M resistor between the gate and
    > > ground to protect the FET when the power is off.
    > >
    > > The source goes to ground. Then the drain goes to the
    > "ground leg" of
    > > your load. So if you want to switch a lamp, for example,
    > connect one
    > > side to +12 and the other side to the drain. If you use a
    > relay, you
    > > probably still want a snubbing diode as described earlier. You are
    > > correct that all the grounds need to be in common.
    > >
    > > Spend $2 on a FET and do the experiment in article 2.5 of
    > the FAQ. It
    > > should clear things up for you.
    > >
    > > Al Williams
    > > AWC
    > > * Floating point A/D
    > > http://www.al-williams.com/awce/pak9.htm
    > >
    > > >
    Original Message
    > > > From: Richard R. > > Ok, I think I am starting to clue in
    > here. If I
    > > > use
    > a Mosfet
    > > > and please correct me if I am wrong. I do something like
    > this... The
    > > > stamp pin will be connected to the gate (do I use a
    > resister to drop
    > > > the voltage to around 1 volt, or can 5 volts be applied to the
    > > > gate?). Common ground (stamp & other power supply).
    > Source & drain
    > > > to higher power source & circuit, like 12V and 1amp? This will
    > > > isolate the stamp from the higher power circuit I want to control?
    > > >
    > > > Richard
    > > >
    > > >
    Original Message
    > > > From: "Al Williams"
    > > > > A 2N2222 will switch the ground leg of circuits up to
    > > > around 100mA or
    > > > > so (you'd have to look at the spec sheet to see exactly how
    > > > hard you
    > > > > could push, but experience says 100mA is no big deal).
    > For bigger
    > > > > loads, look at the FET.
    > > > >
    > > > > Relays are OK, but they are noisy, slow, and not as
    > > > reliable as solid
    > > > > state (although not as unreliable as people think if
    > they are used
    > > > > properly). Relays are useful for AC (where solid state
    > switching
    > > > > is available, but not nearly as simple), or very high
    > > > > current/voltage where a solid state solution might be
    > expensive.
    > > > > But relays usually require a drive circuit anyway, so you get a
    > > > > 2N2222 and a
    > > > relay when
    > > > > the transistor drives the relay. There are "solid state
    > > > relays" by the
    > > > > way that are not really relays and you can drive them directly,
    > > > > but they are not cheap.
    > > > >
    > > > > As for switching, keep in mind that breaking the ground leg
    > > > is as good
    > > > > as breaking the hot leg of the circuit. When you use a
    > 2N2222 as
    > > > > described, the saturated transistor "makes" the ground leg.
    > > > Turning it
    > > > > off turns off the connected device. If all the voltage
    > is DC, you
    > > > > really don't need anything other than the 2N2222 and
    > the IRF FET
    > > > > unless you will go to very high currents (the IRF 510 will
    > > > handle up
    > > > > to 4 - 5 A (depends on temp -- see the charts at
    > > > >
    > http://www.frn.net/tech/xmitters/anarchy/IRF-510_Data.pdf). Radio
    > > > > Shack carries these (or they used to), they are cheap, and
    > > > dead simple
    > > > > to use. You can get other parts that will go over 4A,
    > even. But at
    > > > > some point, the relays will be cheaper.
    > > > >
    > > > > Both devices will handle 12V (or more). When the transistor
    > > > is "off"
    > > > > the Vce will be about 12V (which is OK). When the
    > > > transistor is "on"
    > > > > the Vce will be just .2 or .3V.
    > > > >
    > > > > Al Williams
    > > > > AWC
    > > > > * Control 8 servos at once
    > > > > http://www.al-williams.com/awce/pak8.htm
    > > > >
    > > > >
    > > > > >
    Original Message
    > > > > > From: Richard R. [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=9rqcYt1BOTmrHUqjGAsAEODZY60I_dKRzJcGnpprjIFKfvvY7W3aAgVM9Yflwzv_GWyIs1LkBRjYYII]rryerson@o...[/url
    > > > > > Sent: Thursday, December 13, 2001 8:33 AM
    > > > > > To: basicstamps@yahoogroups.com
    > > > > > Subject: Re: [noparse][[/noparse]basicstamps] simple question
    > > > > >
    > > > > >
    > > > > > Thank you Al (I have your book, maybe I should read
    > it again),
    > > > > > but now I feel a little foolish. What I intended to
    > do is use a
    > > > > > RF transmitter, a BS2 (with it's own power
    > > > > > supply) to power up and power down a robot. The robot
    > has it's
    > > > > > own BS2 processor, 12V motor, & motor controller board. I was
    > > > > > intending to use the first BS2 as a co-processor to
    > control the
    > > > > > robots system, 12v power supply... hence the relay
    > (to turn this
    > > > > > on and off). I also want to control other systems I
    > might add on
    > > > > > in the future, like turning on/off video camera, etc. So,
    > > > > > basically I want to have control over power usage...
    > having the
    > > > > > ability to turn systems on and off at will. Again, I was
    > > > > > planning on using relays to do this. Would a 2N2222
    > transistor
    > > > > > do this? Is it a better option? Can it drive 12V?
    > > > > >
    > > > > > Sorry, as I said, a beginner (but, I am going to check
    > > > out the FAQ)
    > > > > >
    > > > > > Thanks
    > > > > > Richard
    > > > > >
    > > > > >
    Original Message
    > > > > > From: "Al Williams" <alw@a...>
    > > > > > To: <basicstamps@yahoogroups.com>
    > > > > > Sent: Thursday, December 13, 2001 8:56 AM
    > > > > > Subject: RE: [noparse][[/noparse]basicstamps] simple question
    > > > > >
    > > > > >
    > > > > > > There is a relay article in the Stamp FAQ at
    > > > > > > http://www.al-williams.com/wd5gnr/stampfaq.htm
    > > > > > > See article 2.5
    > > > > > >
    > > > > > > Now, my US$0.02. There are really two questions here: How
    > > > > > do I drive a
    > > > > > > motor, and how do I drive a relay.
    > > > > > >
    > > > > > > You can use a relay to drive a motor. Depending on the
    > > > > > motor's size,
    > > > > > > you may be happier using a MOSFET. Radio Shack, for
    > > > example, has an
    > > > > > > IRF510 (I think that's right) that will handle
    > small motors.
    > > > > > > The MOSFET is quiet and relatively fool proof. You'd connect
    > > > > > the source to
    > > > > > > ground, the drain to the motor (the motor also connects
    > > > to 12V) and
    > > > > > > the gate to a Stamp pin. When the Stamp is not running, the
    > > > > > FET's gate
    > > > > > > is very sensitive to static charge, so I'd put a 100K to 1M
    > > > > > resistor
    > > > > > > from the gate to ground to bleed off anything. There is a
    > > > > > FET article
    > > > > > > in the FAQ too.
    > > > > > >
    > > > > > > Now, if you want to use a relay, here's the deal on that.
    > > > > > First, there
    > > > > > > are two things to consider when using relays. The obvious
    > > > > > one is the
    > > > > > > coil. Even if you have a 5V low current coil, you should
    > > > > > not drive it
    > > > > > > directly from the Stamp. Coils are inductors. When a
    > > > > > voltage changes
    > > > > > > quickly through an inductor you get a reverse
    > voltage that is
    > > > > > > proportional to the rate of change. That means when you
    > > > switch the
    > > > > > > voltage from 5V to 0V almost instantly you will get a very
    > > > > > > large spike.
    > > > > > >
    > > > > > > The answer is to put a diode "backwards" across the
    > > > relay coil. The
    > > > > > > Stamp has beefy I/O pins, so sometimes this will work
    > > > without the
    > > > > > > diode, but it isn't worth trying it to find out. Even if it
    > > > > > works for
    > > > > > > awhile, it may be a reliability problem for the future. So
    > > > > > the banded
    > > > > > > end points to 12V and the other end points to the
    > > > Stamp. However, I
    > > > > > > still would not drive a relay coil directly. Instead, I'd
    > > > > > use a 2N2222
    > > > > > > or 2N3904. Ground the emitter, and connect the collector to
    > > > > > the cold
    > > > > > > end of the relay coil (the other end goes to 12V or 5V
    > > > depending on
    > > > > > > the relay). You take the base of the transistor to
    > the Stamp
    > > > > > > pin through a small resistor (1K should be plenty). This
    > > > should handle
    > > > > > > coils that require up to, say, 100mA. This is in
    > the FAQ too.
    > > > > > >
    > > > > > > Sometimes relay coils are rated in ohms. So at 5V a 50 ohm
    > > > > > coil will
    > > > > > > require 5/50 = 100mA. Of course, if the coil is rated
    > > > in mA, then
    > > > > > > that's the right value and you could compute the
    > > > resistance just as
    > > > > > > easily.
    > > > > > >
    > > > > > > The other thing to look at with a relay (and that
    > most hobby
    > > > > > > electronics projects ignore) are the contacts. Contacts
    > > > > > have a voltage
    > > > > > > and current rating too. Some contacts are rated "dry" which
    > > > > > means you
    > > > > > > switch them with no current flowing. Different contact
    > > > > > materials have
    > > > > > > different properties. At low power, you want contacts that
    > > > > > stay clean.
    > > > > > > If they corrode, the relay will become resistive. At high
    > > > > > power, you
    > > > > > > want a contact material that won't pit from the arcing
    > > > that occurs
    > > > > > > when the contacts are close together. Corrosion is OK
    > > > because the
    > > > > > > arcing will clean the material. Putting the wrong kind of
    > > > > > contact in
    > > > > > > will cause early failure and is a big reasons relays have a
    > > > > > reputation
    > > > > > > as unreliable. Switching dry contacts with power
    > > > applied can cause
    > > > > > > problems too.
    > > > > > >
    > > > > > > If you can't tell, I've used relays in a government project
    > > > > > about 20
    > > > > > > years ago where we had to make them last.
    > > > > > >
    > > > > > > I did a quick Web search, here's an interesting failure
    > > > story that
    > > > > > > illustrates some of my points:
    > > > > > >
    > > > > > http://www.leachintl2.com/english/english2/vol6/properties/how
    > > > > > 4.htm It
    > > > > > > also mentions a "multi load" contact which I'd
    > never heard of.
    > > > > > > However, it is kind of weird since once you put high
    > > > > > currents through
    > > > > > > it it won't handle low currents any more. Pretty good pages:
    > > > > > >
    > > > > >
    > > >
    > http://www.leachintl2.com/english/english2/vol6/properties/000
    47.htm
    > > l
    > > > > >
    > > > > > Regards,
    > > > > >
    > > > > > Al Williams
    > > > > > AWC
    > > > > > * Floating point A/D http://www.al-williams.com/awce/pak9.htm
    > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > > > > >
    Original Message
    > > > > > > From: wc31415 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=S_7KqNbGuZ4_HeFURZdFWyC87CdDo8eMZdmJBKrnXyfGy_1IWkaD4Lzicv54sqeZNel_Vy5xGvDImw]wc31415@y...[/url
    > > > > > > Sent: Thursday, December 13, 2001 4:13 AM
    > > > > > > To: basicstamps@yahoogroups.com
    > > > > > > Subject: [noparse][[/noparse]basicstamps] simple question
    > > > > > >
    > > > > > >
    > > > > > > I apoligize for a very basic question. I tryed
    > > searching for an
    > > > > > > answer but nothing relevent came up. All I want to do is
    > > > > connect a
    > > > > > > 12V DC motor to my BS2P. I assume I need a relay but when
    > > > > I look for
    > > > > > > one I find few different types and very varying specs.
    > > > > > > Thanks,
    > > > > > > Will



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 16:03
    NOOOO!!!! Do not drive it right off the stamp pin. You need to put some
    diodes in there to protect the stamp from the voltages that are created from
    the collapsing magnetic field of the relay.One in series and one across the
    terminals of the relay. The second one should be reverse biased.
    Original Message
    From: "Richard R." <rryerson@o...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, December 13, 2001 4:43 AM
    Subject: Re: [noparse][[/noparse]basicstamps] simple question


    > Hello,
    > Wow, I kind have the same question. I got some 3-6 volt 312ohm reed relays
    > from All Electronics and need to know if they are safe for using directly
    > off a stamp pin. I am a beginner, so forgive my ignorance. Can someone
    tell
    > me if I am using ohm's law properly if "I" is current, "V" is voltage and
    > "R" is resistance then I=V/R or in my case using the example above,
    > 5/312= 0.016 amps. Is this formula correct? If it is then I am right in
    > assuming I can drive it right off a stamp pin, as it is under 20mAh
    right???
    >
    > Thanks Richard
    >
    >
    Original Message
    > From: "wc31415" <wc31415@y...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Thursday, December 13, 2001 5:13 AM
    > Subject: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > > I apoligize for a very basic question. I tryed searching for an
    > > answer but nothing relevent came up. All I want to do is connect a
    > > 12V DC motor to my BS2P. I assume I need a relay but when I look for
    > > one I find few different types and very varying specs.
    > > Thanks,
    > > Will
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the Subject
    and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 16:08
    Is this a 5 volt motor ? Or something higher, and how much current does
    your motor draw?


    Original Message
    From: "wc31415" <wc31415@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, December 13, 2001 2:13 AM
    Subject: [noparse][[/noparse]basicstamps] simple question


    > I apoligize for a very basic question. I tryed searching for an
    > answer but nothing relevent came up. All I want to do is connect a
    > 12V DC motor to my BS2P. I assume I need a relay but when I look for
    > one I find few different types and very varying specs.
    > Thanks,
    > Will
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 16:27
    If your motor current is less than 700 ma you can use a Melexis p/n MLX 10402
    and interface this part directly to the stamp. The Melexis part
    (www.melexis.com) has buildin diodes and can be PWM via of the stamp to
    control speed and direction. This a great project for the dc electric trains.
    Chuck
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 16:41
    You're probably right, but I have used IRF541's to drive 10 amp solenoids
    and with that much inductance you tend to choose to err to the side of
    safety and overkill to the max.

    Original Message
    From: "Al Williams"

    > I've never had any trouble driving IRF FETs from CMOS outputs where you
    > have a full output swing. TTL might be a problem since the Vgs is right
    > around the 1 threshold. Of course, with a low Vgs you probably won't get
    > the full Id rating, but I've used 5V drive for up to about 1.5A with no
    > trouble.
    >
    > Regards,
    >
    > Al Williams
    > AWC
    > * 8 channels of PWM
    > http://www.al-williams.com/awce/pak5.htm
    >
    > >
    Original Message
    > > From: FalconWireless Tech Support - KF4HAZ
    > >
    > > Most mosfets (IRF510 IRF511 IRF541 et.al.) are a bit marginal
    > > when the gate is 5 vdc one exception is the 2n7000 mosfet, it
    > > is designed for ttl logic level switching. Personally I use a
    > > 2n3904 or 2n2222 with a pull-up resistor from 12v to the
    > > collector-gate connection and 2 snubbers one reverse biased
    > > drain to source, the other reverse biased drain to 12V to
    > > prevent high spikes from exceeding the mosfets max voltage
    > > when the load is switched off..
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 18:05
    In a message dated 12/13/01 4:14:30 AM Central Standard Time,
    wc31415@y... writes:


    > I apoligize for a very basic question. I tryed searching for an
    > answer but nothing relevent came up. All I want to do is connect a
    > 12V DC motor to my BS2P. I assume I need a relay but when I look for
    > one I find few different types and very varying specs.
    >

    Depends on the current requirement of the motor. If it's not horrible, you
    might be able to use a ULN2003 and then get some level of speed control over
    the motor. I've done this with small DC motors.

    -- Jon Williams
    -- Parallax


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 22:21
    Quick question, Can I use a PNP 2N3906 in place of a 2N3904 with a 50V 1A
    1N4001 Diode to drive a small relay? What's the difference? I am only asking
    because I have some 2N3906's

    Thanks Richard

    Original Message
    From: "Al Williams" <alw@a...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, December 13, 2001 8:56 AM
    Subject: RE: [noparse][[/noparse]basicstamps] simple question


    > There is a relay article in the Stamp FAQ at
    > http://www.al-williams.com/wd5gnr/stampfaq.htm
    > See article 2.5
    >
    > Now, my US$0.02. There are really two questions here: How do I drive a
    > motor, and how do I drive a relay.
    >
    > You can use a relay to drive a motor. Depending on the motor's size, you
    > may be happier using a MOSFET. Radio Shack, for example, has an IRF510
    > (I think that's right) that will handle small motors. The MOSFET is
    > quiet and relatively fool proof. You'd connect the source to ground, the
    > drain to the motor (the motor also connects to 12V) and the gate to a
    > Stamp pin. When the Stamp is not running, the FET's gate is very
    > sensitive to static charge, so I'd put a 100K to 1M resistor from the
    > gate to ground to bleed off anything. There is a FET article in the FAQ
    > too.
    >
    > Now, if you want to use a relay, here's the deal on that. First, there
    > are two things to consider when using relays. The obvious one is the
    > coil. Even if you have a 5V low current coil, you should not drive it
    > directly from the Stamp. Coils are inductors. When a voltage changes
    > quickly through an inductor you get a reverse voltage that is
    > proportional to the rate of change. That means when you switch the
    > voltage from 5V to 0V almost instantly you will get a very large spike.
    >
    > The answer is to put a diode "backwards" across the relay coil. The
    > Stamp has beefy I/O pins, so sometimes this will work without the diode,
    > but it isn't worth trying it to find out. Even if it works for awhile,
    > it may be a reliability problem for the future. So the banded end points
    > to 12V and the other end points to the Stamp. However, I still would not
    > drive a relay coil directly. Instead, I'd use a 2N2222 or 2N3904. Ground
    > the emitter, and connect the collector to the cold end of the relay coil
    > (the other end goes to 12V or 5V depending on the relay). You take the
    > base of the transistor to the Stamp pin through a small resistor (1K
    > should be plenty). This should handle coils that require up to, say,
    > 100mA. This is in the FAQ too.
    >
    > Sometimes relay coils are rated in ohms. So at 5V a 50 ohm coil will
    > require 5/50 = 100mA. Of course, if the coil is rated in mA, then that's
    > the right value and you could compute the resistance just as easily.
    >
    > The other thing to look at with a relay (and that most hobby electronics
    > projects ignore) are the contacts. Contacts have a voltage and current
    > rating too. Some contacts are rated "dry" which means you switch them
    > with no current flowing. Different contact materials have different
    > properties. At low power, you want contacts that stay clean. If they
    > corrode, the relay will become resistive. At high power, you want a
    > contact material that won't pit from the arcing that occurs when the
    > contacts are close together. Corrosion is OK because the arcing will
    > clean the material. Putting the wrong kind of contact in will cause
    > early failure and is a big reasons relays have a reputation as
    > unreliable. Switching dry contacts with power applied can cause problems
    > too.
    >
    > If you can't tell, I've used relays in a government project about 20
    > years ago where we had to make them last.
    >
    > I did a quick Web search, here's an interesting failure story that
    > illustrates some of my points:
    > http://www.leachintl2.com/english/english2/vol6/properties/how4.htm It
    > also mentions a "multi load" contact which I'd never heard of. However,
    > it is kind of weird since once you put high currents through it it won't
    > handle low currents any more. Pretty good pages:
    > http://www.leachintl2.com/english/english2/vol6/properties/00047.html
    >
    > Regards,
    >
    > Al Williams
    > AWC
    > * Floating point A/D
    > http://www.al-williams.com/awce/pak9.htm
    >
    >
    >
    >
    >
    > >
    Original Message
    > > From: wc31415 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=jLRAhajJkhwgDGoiQIVGMPWZjYs43i7QYrHzC6QKdRwQU_bPe6NJZ9M6ZMwAisyi8yvRaTHGNN9Edg]wc31415@y...[/url
    > > Sent: Thursday, December 13, 2001 4:13 AM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] simple question
    > >
    > >
    > > I apoligize for a very basic question. I tryed searching for an
    > > answer but nothing relevent came up. All I want to do is connect a
    > > 12V DC motor to my BS2P. I assume I need a relay but when I look for
    > > one I find few different types and very varying specs.
    > > Thanks,
    > > Will
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the
    > > Subject and Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 22:55
    There are some requirements that you need to define.
    1] What is the surge current in amperes of the motors you want to control?.
    2] Take this current and multiply by 2.
    3] Look for a 12 volt DC Relay with contact ratings at least equal to the
    current calculated in 2].
    4] What is the coil resistance of the relay you selected?
    5] Calculate the coil current at 12 volts. eg:A 200 ohm relay coil current
    is .06 amperes with 12 volts applied to it.
    6] .06 amperes is beyond the current capacity of the stamp output ckt.
    7] Lets assume that you want the stamp output to provide .002 amps of
    current to a transistor that would then operate the relay and turn on the
    motor.
    8] You want a transistor that has a minimum Beta of {.06/.002} 30 and Ic min
    of 100 ma.. This would be a very low cost transistor.
    hope this helps, Steve
    Original Message
    From: "wc31415" <wc31415@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, December 13, 2001 2:13 AM
    Subject: [noparse][[/noparse]basicstamps] simple question


    > I apoligize for a very basic question. I tryed searching for an
    > answer but nothing relevent came up. All I want to do is connect a
    > 12V DC motor to my BS2P. I assume I need a relay but when I look for
    > one I find few different types and very varying specs.
    > Thanks,
    > Will
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-13 23:13
    Do not use a dry reed relay contact to turn on and motors .
    Original Message
    From: "Richard R." <rryerson@o...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, December 13, 2001 4:43 AM
    Subject: Re: [noparse][[/noparse]basicstamps] simple question


    > Hello,
    > Wow, I kind have the same question. I got some 3-6 volt 312ohm reed relays
    > from All Electronics and need to know if they are safe for using directly
    > off a stamp pin. I am a beginner, so forgive my ignorance. Can someone
    tell
    > me if I am using ohm's law properly if "I" is current, "V" is voltage and
    > "R" is resistance then I=V/R or in my case using the example above,
    > 5/312= 0.016 amps. Is this formula correct? If it is then I am right in
    > assuming I can drive it right off a stamp pin, as it is under 20mAh
    right???
    >
    > Thanks Richard
    >
    >
    Original Message
    > From: "wc31415" <wc31415@y...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Thursday, December 13, 2001 5:13 AM
    > Subject: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > > I apoligize for a very basic question. I tryed searching for an
    > > answer but nothing relevent came up. All I want to do is connect a
    > > 12V DC motor to my BS2P. I assume I need a relay but when I look for
    > > one I find few different types and very varying specs.
    > > Thanks,
    > > Will
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the Subject
    and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-14 05:56
    Sorry again I really am clueless as to how to do this. I took a basic
    electronics course in high school and it was pretty useless. If
    someone knows of a book I could buy that will show me step by step
    (from a new user standpoint). Most books I see gloss over the
    fundamentals that I lack.
    Thanks again,
    Will

    --- In basicstamps@y..., "Stephen H Chapman" <chapman@t...> wrote:
    > There are some requirements that you need to define.
    > 1] What is the surge current in amperes of the motors you want to
    control?.
    > 2] Take this current and multiply by 2.
    > 3] Look for a 12 volt DC Relay with contact ratings at least equal
    to the
    > current calculated in 2].
    > 4] What is the coil resistance of the relay you selected?
    > 5] Calculate the coil current at 12 volts. eg:A 200 ohm relay coil
    current
    > is .06 amperes with 12 volts applied to it.
    > 6] .06 amperes is beyond the current capacity of the stamp output
    ckt.
    > 7] Lets assume that you want the stamp output to provide .002 amps
    of
    > current to a transistor that would then operate the relay and turn
    on the
    > motor.
    > 8] You want a transistor that has a minimum Beta of {.06/.002} 30
    and Ic min
    > of 100 ma.. This would be a very low cost transistor.
    > hope this helps, Steve
    >
    Original Message
    > From: "wc31415" <wc31415@y...>
    > To: <basicstamps@y...>
    > Sent: Thursday, December 13, 2001 2:13 AM
    > Subject: [noparse][[/noparse]basicstamps] simple question
    >
    >
    > > I apoligize for a very basic question. I tryed searching for an
    > > answer but nothing relevent came up. All I want to do is connect a
    > > 12V DC motor to my BS2P. I assume I need a relay but when I look
    for
    > > one I find few different types and very varying specs.
    > > Thanks,
    > > Will
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@y...
    > > from the same email address that you subscribed. Text in the
    Subject and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
    > >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-14 21:59
    The existence of a book that has an answer to every possible question does
    not exist. Suggest you go to the Local library, Ask for the ARRL Handbook
    and look in the section on D C Theory, Real World Component Characteristics
    and DC Power Supplies as a starter. The information learned will be
    beneficial in getting you from lets try this and see the fireworks to
    knowledge about DC circuits and you can do this and why and here also are
    the things you should not do.
    Good Luck on your project. Steve
    Original Message
    From: "wc31415" <wc31415@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, December 13, 2001 9:56 PM
    Subject: [noparse][[/noparse]basicstamps] Re: simple question


    > Sorry again I really am clueless as to how to do this. I took a basic
    > electronics course in high school and it was pretty useless. If
    > someone knows of a book I could buy that will show me step by step
    > (from a new user standpoint). Most books I see gloss over the
    > fundamentals that I lack.
    > Thanks again,
    > Will
    >
    > --- In basicstamps@y..., "Stephen H Chapman" <chapman@t...> wrote:
    > > There are some requirements that you need to define.
    > > 1] What is the surge current in amperes of the motors you want to
    > control?.
    > > 2] Take this current and multiply by 2.
    > > 3] Look for a 12 volt DC Relay with contact ratings at least equal
    > to the
    > > current calculated in 2].
    > > 4] What is the coil resistance of the relay you selected?
    > > 5] Calculate the coil current at 12 volts. eg:A 200 ohm relay coil
    > current
    > > is .06 amperes with 12 volts applied to it.
    > > 6] .06 amperes is beyond the current capacity of the stamp output
    > ckt.
    > > 7] Lets assume that you want the stamp output to provide .002 amps
    > of
    > > current to a transistor that would then operate the relay and turn
    > on the
    > > motor.
    > > 8] You want a transistor that has a minimum Beta of {.06/.002} 30
    > and Ic min
    > > of 100 ma.. This would be a very low cost transistor.
    > > hope this helps, Steve
    > >
    Original Message
    > > From: "wc31415" <wc31415@y...>
    > > To: <basicstamps@y...>
    > > Sent: Thursday, December 13, 2001 2:13 AM
    > > Subject: [noparse][[/noparse]basicstamps] simple question
    > >
    > >
    > > > I apoligize for a very basic question. I tryed searching for an
    > > > answer but nothing relevent came up. All I want to do is connect a
    > > > 12V DC motor to my BS2P. I assume I need a relay but when I look
    > for
    > > > one I find few different types and very varying specs.
    > > > Thanks,
    > > > Will
    > > >
    > > >
    > > > To UNSUBSCRIBE, just send mail to:
    > > > basicstamps-unsubscribe@y...
    > > > from the same email address that you subscribed. Text in the
    > Subject and
    > > Body of the message will be ignored.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    > > >
    > > >
    > > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-15 06:04
    Try this and see if it will work for you??


    http://www.capable.on.ca/rcstuff/esc.htm


    regards,

    Leroy
  • ArchiverArchiver Posts: 46,084
    edited 2002-05-29 05:27
    Hi all,
    I am new to the group and to the basic stamp - This
    may be a little off topic...

    I had tried to bid on a II stater kit for me & my
    son(13yrs old). We lost by $1 (price $81). Both of us
    want to get into this but money is tight. Anyone got
    an old one they want to sell (cheap)???? We don't need
    the book (we printed it).

    Thanks,
    Kevin
    psycho_dad123@y...


    __________________________________________________
    Do You Yahoo!?
    Yahoo! - Official partner of 2002 FIFA World Cup
    http://fifaworldcup.yahoo.com
  • ArchiverArchiver Posts: 46,084
    edited 2002-05-29 06:45
    Try the following link:

    http://www.phanderson.com/stamp/starter.html

    BTW, your welcome
    Brian G.
  • ArchiverArchiver Posts: 46,084
    edited 2002-05-29 14:07
    Hi Kevin,

    Be sure to read:
    http://www.wd5gnr.com/faqs/index.php?qframe=1&faq=1&article=9

    You can buy just a Stamp and make your own cables using the instructions
    in the manual.

    If you want something a little more robust, we make an adapter that
    connects an RS232 cable to a breadboard (and a 9V battery). Not too
    expensive and it lets you use any breadboard you happen to have, a large
    breadboard, or switch between breadboards -- all very handy. You can
    check it out at http://www.al-williams.com/awce/app2.htm.

    Good luck!

    Al Williams
    AWC




    >
    Original Message
    > From: Kevin Zee [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=c1FBoGkxAwJnVsE5yam9XOEDiUWmuOhr4szpH97y5z-YQX0P7j5Qgh8gTMdMJKnrbL3_8HBf14THb3ufv3chcQ]psycho_dad123@y...[/url
    > Sent: Tuesday, May 28, 2002 11:28 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Simple question
    >
    >
    > Hi all,
    > I am new to the group and to the basic stamp - This
    > may be a little off topic...
    >
    > I had tried to bid on a II stater kit for me & my
    > son(13yrs old). We lost by $1 (price $81). Both of us
    > want to get into this but money is tight. Anyone got
    > an old one they want to sell (cheap)???? We don't need
    > the book (we printed it).
    >
    > Thanks,
    > Kevin
    > psycho_dad123@y...
    >
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Yahoo! - Official partner of 2002 FIFA World Cup
    > http://fifaworldcup.yahoo.com
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
Sign In or Register to comment.