Shop OBEX P1 Docs P2 Docs Learn Events
relay control with bs2pe — Parallax Forums

relay control with bs2pe

PeterRPeterR Posts: 10
edited 2008-02-16 03:02 in BASIC Stamp
I have a BS2pe motherboard with a Power and I/O daughterboard mounted into socked A of the motherboard.· I want to control two external relays separately using the BS2pe/DB.· Would it be correct to connect to the interface header onthe daughterboard port(P8) for one relay and port(P9) for the second relay(using 3 pin connectors)?· If this is correct set up then:· What pins would be called out in the program to make them high(5v) and low(0v)?· Would a "do loop" program be adequate to do the task of turning them on and off with time delays?· I'm new to this and am trying to find some answers and save time.· thanks, PeterR

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-02-15 18:05
    The BS2pe port pins on the motherboard are current-limited via series 330-ohm resistors.* So it may be difficult to drive a relay coil directly. Can you disclose a little more about the relays you plan to use? Also, what voltage are you using for Vdd on the Mobo? 3.3V or 5V?

    -Phil

    Addendum:

    * The same is not true of the AVR coprocessor pins, four of which are available on the PWR-I/O-DB (two being shared with BS2pe pins on the downstream side of their protection resistors). It's more likely you could drive a low-current relay coil from these pins through the AVR, using the default GPIO3 firmware. But you have to be careful to stay well below the AVR's output current limit of 40mA per pin. Also, A2 and A3 have more available drive current than A0 and A1, so they would be the best candidates.

    Post Edited (Phil Pilgrim (PhiPi)) : 2/15/2008 8:02:42 PM GMT
  • PeterRPeterR Posts: 10
    edited 2008-02-15 21:14
    The two relays being used are Crydom.· The imput required to them are 3.5 to 30v.· Using 5v on the MoBo.· If AVR firmware is required will it still operate with a "do-loop" program or do I have to look into language applicable to the AVR?· Hope I'm making sense.· Thanks for your response PeterR
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-02-15 22:01
    Oh, these are opto isolators (SSRs), then? In that case, the series-connected Stamp pins may be able to source enough current to turn them on. Can you post a part number or datasheet for the Crydom parts?

    -Phil
  • PeterRPeterR Posts: 10
    edited 2008-02-16 00:08
    Yes, these are SSRs.· Model number on one is SNC-R2025-517.· The second relay is stamped with this: D1D40.· Hope this helps.· PeterR
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-02-16 03:02
    Okay, this is easy enough to analyze. The datasheet specs an input impedance of 1500 ohms and a maximum turn-on voltage of 3V. In these devices, what's not stated overtly is that they're current-driven, not voltage-driven. The two specs combined imply that to guarantee a turn-on, you've got to supply at least 3V / 1500 ohms = 2 mA. An output of 5V, in series with an additional 330 ohms, will provide 5V / (1500 + 330) = 2.7mA — more than enough. So you can use the Stamp pins directly, without going through the AVR.

    Now, as to your question about programming, the following should work fine:

    HIGH 8  'Turn relay attached to P8 "on".
    ...
    LOW 8  'Turn relay attached to P8 "off".
    
    
    


    This is assuming that the relay is connected between the output pin and Vss, both of which are available on the 3-pin PWR-I/O-DB headers.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 2/16/2008 3:07:35 AM GMT
Sign In or Register to comment.