Shop OBEX P1 Docs P2 Docs Learn Events
Relay Help — Parallax Forums

Relay Help

Dr.NoDr.No Posts: 60
edited 2008-04-07 02:03 in BASIC Stamp
Okay, I have six of these RS relays using the BS2 homework board.
Is it possible to use 3 at a time or is it too much power drain.

I had 4 on my last project and somehow got it to work with
a BS1 - but it might have been one at a time.

I think this is the diagram

a

O
~
x O--[noparse]/noparse ~ [noparse]/noparse
O y
~
O

b

where xy is the switch and ab is the coil but it's not working
so maybe I have the wrong labels.

Thanks for any help.

http://www.radioshack.com/product/index.jsp?parentPage=search&pg=2&summary=summary&cp=2032058.2032230.2032277&productId=2062479&accessories=accessories&kw=relay&techSpecs=techSpecs&currentTab=techSpecs&custRatings=custRatings&sr=1&features=features&origkw=relay&support=support&tab=summary

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-04-05 23:01
    That post makes no sense to me. You should use a transistor and diode to power a relay from a stamp and provide a seperate power supply for the output.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-05 23:01
    You'll have to do the work. Figure out the coil current from RadioShack's information using Ohm's law (Voltage = Current x Resistance).
    They should give you the operating voltage and probably give you the coil resistance. Any Stamp I/O pin can handle 20-25mA
    (20mA current with HIGH and 25mA with LOW). Any group of 8 I/O pins (0-7 or 8-15) can handle a total of 50mA at any one time.
    Don't forget that the Homework board has a regulator on it and, depending on the board revision (A / B / ...), the regulator may also
    limit the amount of current available. If you're running the board off batteries, that's also a limiting factor. 9V batteries have a low
    peak current and a low overall capacity.
  • Dr.NoDr.No Posts: 60
    edited 2008-04-06 03:45
    Ok - the problem appears to be the 12V relays. I don' think these
    work with the Stamp. I tried two 5V relays and these work fine at
    the same time.

    Thanks again.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-06 03:55
    You better check the coil current of the relays. If you exceed the I/O pin ratings, the Stamp will eventually become damaged.
    You also need a reverse connected diode across the relay coil as described in the Stamp tutorials and mentioned many times
    on this forum. If you don't have the diodes, the Stamp will eventually become damaged.
  • Dr.NoDr.No Posts: 60
    edited 2008-04-06 15:06
    I was under the assumption that you cannot draw more current than the stamp provides.
    Yes, I have a diode to short the kickback. Is there a time relay doesn't need a diode?
    There's always a kick whenever the field drops so it seems relays should always have
    built in protection.

    The relay draws 20ma so I can alternately run two, each running 3 relays.

    It would have been nice if Parallax had included a on/off switch on boards so you didn't have to
    yank the 9V battery every time you have to set the components.



    Does anyone make a microprocessor with better power?

    Thanks.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-06 15:30
    There are some reed relays that have the diode built-in, but all solenoids, electromagnetic relays, and motors need a diode.
    Some relay / motor driver ICs and many MOSFET power transistors have a diode structure built-in to the device.

    Many of Parallax's boards have on/off switches. The Homework boards were intended for low-cost classroom use and I believe
    the on/off switches were left off to save money. The Board of Education and all of the Propeller boards have on/off switches.

    Most microprocessors are made with similar I/O pin structures and they have a current capacity on the order of 20-30mA.
    Higher capacity requires more chip area and the interconnections (wiring) on-chip have to be wider to carry the current.
    It's not considered a good use of chip area to build I/O drivers with significantly higher current capacity. It's much better to
    use external transistors or high current drivers for just those pins that need it rather than beef up all the I/O pins.

    To answer your question more directly ... There are some special purpose microprocessors built for specific uses that have
    higher current output structures, but they're not general purpose devices. The best current rating you're likely to see is
    around 40-50mA and there are strict limits for groups of I/O pins (typically 100-150mA) and for the overall device current
    (typically 250-300mA). The Propeller is rated at 40mA per I/O pin and 300mA overall device current for example.
  • geologeekgeologeek Posts: 8
    edited 2008-04-06 21:38
    could you not just use darlington optocouplers to work the relays and save the chance of damaging the stamp unit?
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-06 22:01
    You could certainly use Darlington optocouplers, but you'd still need a diode. In this case, it'd protect the optocoupler.

    The optocouplers are more expensive than a simple MOSFET switch which would take less board space, and work just as
    well for this case. They would be useful if the relay or driver transistor were in an environment with a lot of static or
    other dangerous voltages.

    Post Edited (Mike Green) : 4/6/2008 10:08:02 PM GMT
  • Dr.NoDr.No Posts: 60
    edited 2008-04-06 22:37
    Someone told me I could run the relays in series and it would still draw the same 20ma.
    By the way, the 12V relay uses only 11ma which is a shame... that would be enough to
    power my project (33ma).

    But if putting the relays in series draw 20 ma, then BS might just be worth something.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-06 22:49
    You really need to learn something about basic electricity concepts like voltage, current, and resistance.

    If you have a 5V relay that takes 20mA to operate, you have a 250 Ohm resistance. When you put two
    of these in series, you still have 20mA of current going through them when they turn on, but it takes 10V of
    "push" to get the 20mA to go through them. If you only have 5V, you'll only get 10mA of current (Ohm's Law)
    and they won't turn on.
  • Dr.NoDr.No Posts: 60
    edited 2008-04-07 00:27
    Ouch! That would be 15V draw.

    Actually, the guy that's helping me is an electrician...
    but he's not familiar with a BS so I come here and I appreciate all the help.

    The stamp can still work but I have to let it work two relay alternately.

    These two relays will be responsible for controlling 3 relays apiece which means
    I need an additional 5V power supply to work these relays plus 2 additional relays - this is not good.

    This is certainly a high price to pay for a 20ma shortfall - but it can work.
    Thanks.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-07 01:25
    Switching transistors are cheap and work well for driving relatively high current relays.
    Most switching transistors like the 2N2222 can handle loads up to about 200mA.
    Download the "Industrial Control" tutorial from the "Stamps in Class Tutorials Downloads"
    section of the Downloads page in the Parallax website. It has a section on controlling relays
    and motors with a Stamp starting around page 85.
  • Dr.NoDr.No Posts: 60
    edited 2008-04-07 02:03
    Thanks. I'm going there right now.
    That should help me in any redesign changes.
Sign In or Register to comment.