Shop OBEX P1 Docs P2 Docs Learn Events
Which Relay boards work well with a BS1 and BS2? — Parallax Forums

Which Relay boards work well with a BS1 and BS2?

ppillardppillard Posts: 22
edited 2014-07-11 00:09 in BASIC Stamp
Hello all!

I do a lot of weird stuff to automobiles, so I like the 12V VIN option of the BS1 and BS2. I really like the option of buying relay boards with 4 or 8 or 16 channels.

What brand relay boards do you recommend to work with the BS1 and 2? Thanks for your input.

Comments

  • MarkDeSouzaMarkDeSouza Posts: 17
    edited 2014-07-09 17:29
  • Mike GreenMike Green Posts: 23,101
    edited 2014-07-09 17:36
    I like the Digital I/O Board. It's well designed, will work with both the BS1 and BS2, and you can use either mechanical relays for 12V or AC / 8A or solid-state relays for AC (up to 240V) at 8A. It also has optically isolated inputs. If you only need 4 channels, you can just leave off half the relays when you wire up the kit.

    There are coding examples available in the BS1 application notes for using the 74HC595 and 74HC165. It is possible to daisy-chain multiples of this board, but you have to wire up a jumper from the 74HC595 Q7' output on one board to the 74HC595 input on the next board. For more than 8 inputs, the "daisy-chain" input is already available on the board.
  • ppillardppillard Posts: 22
    edited 2014-07-09 18:00

    Mark, I have a Sainsmart 4 relay board in front of me that I have hooked up to my BS2 as I experiment with it. It is partially what prompted my post. It is failing and frustrating me badly. I have a simple program that cycles all the relays one at a time, and their respective LED's light up as they should, indicating the program is functioning, and you can hear the relays click. However, when I check for continuity a the NO and COM points, I get nada. Each relay is trying to cycle and definitely cutting the NC circuit, but not quite making it to the NO. My code is as follows:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    Main:
    RLY1 PIN 0 'Declare Relay Out Pin
    RLY2 PIN 1 'Declare Relay Out Pin
    RLY3 PIN 2 'Declare Relay Out Pin
    RLY4 PIN 3 'Declare Relay Out Pin

    LOW 0
    PAUSE 2250
    HIGH 0
    LOW 1
    PAUSE 2250
    HIGH 1
    LOW 2
    PAUSE 2250
    HIGH 2
    LOW 3
    PAUSE 2250
    HIGH 3


    GOTO Main
    END

    What am I doing wrong?
  • ppillardppillard Posts: 22
    edited 2014-07-09 18:09
    Mike Green wrote: »
    I like the Digital I/O Board. It's well designed, will work with both the BS1 and BS2, and you can use either mechanical relays for 12V or AC / 8A or solid-state relays for AC (up to 240V) at 8A. It also has optically isolated inputs. If you only need 4 channels, you can just leave off half the relays when you wire up the kit.

    There are coding examples available in the BS1 application notes for using the 74HC595 and 74HC165. It is possible to daisy-chain multiples of this board, but you have to wire up a jumper from the 74HC595 Q7' output on one board to the 74HC595 input on the next board. For more than 8 inputs, the "daisy-chain" input is already available on the board.

    I was looking into that board, Mike, and it looks like a sweet setup. Does it come with both mechanical relays and SSR's or do you opt for one or the other when you purchase?
  • MarkDeSouzaMarkDeSouza Posts: 17
    edited 2014-07-09 18:18
    what I recall for the Sainsmart board was the the NC and NO are switched, I power up the COM with a +12VDC and I seem to have no problems in switching.

    RLY1 PIN 1
    DO
    DEBUG ? IN2
    IF (IN2 = 0) THEN

    DO UNTIL (IN2 = 1)
    HIGH 1

    LOOP
    LOW 1

    PAUSE 100
    ENDIF
    LOOP
  • ppillardppillard Posts: 22
    edited 2014-07-09 18:29
    I get nothing at all when I do this except the debug message at the terminal window. No power at the relay whatsoever. Regardless of the state of IN2. Blast!
  • ppillardppillard Posts: 22
    edited 2014-07-09 18:46
    NEVERMIND!!!!

    I figured out what I did wrong, and trust me, I am a complete idiot! Thanks for the help!
  • Mike GreenMike Green Posts: 23,101
    edited 2014-07-09 19:08
    The Digital I/O Board Kit doesn't come with the relays. You order them separately from Parallax or elsewhere (if you need something different for example). The Board uses a standard hole layout for the relays.
  • ercoerco Posts: 20,256
    edited 2014-07-10 02:09
    Sounds like you got your issue sorted out. From my experience with even the cheapest 4-relay boards from China, they are easy and reliable to control with a BS2. If you hear the relay click and see the LED, it activated. I'm guessing you may have had problems identifying the contacts. Relay quality and life probably vary between boards, but I haven't tested those.
  • ppillardppillard Posts: 22
    edited 2014-07-10 07:03
    erco wrote: »
    I'm guessing you may have had problems identifying the contacts.

    I'm embarrassed to say that this is the case. I've hooked up about a thousand relay contacts in my life, and I totally took it for granted that I had hooked them up correctly, so much so that it never occurred to me that they might be a problem. I stumbled across a YouTube video of a guy hooking one up and clearly pointing out which contact was COMM, at which point I slapped myself in the forehead so hard I left a bruise (mild exaggeration).

    Thanks for the vids!
  • ppillardppillard Posts: 22
    edited 2014-07-10 19:42
    So, since I do this automotive work, I generally need to power more than 10 amps. Currently, I fire from the BS2 (or BS1), to a 10amp relay, which in turn powers an automotive 30 amp relay. I'd really like to eliminate the middle man.

    I tried powering the 30 amp directly from the Basic Stamp, but the coil requires more voltage and amperage than a Basic Stamp can kick out. Are there any higher amperage relays out there that will fire directly from the Basic Stamp?
  • GenetixGenetix Posts: 1,749
    edited 2014-07-10 20:03
    You could use a Solid State Relay (SSR) or have the BS2 drive a transistor that activates the relay. Just be sure you place a kickback diode across the relay.


    http://delphi.com/shared/pdf/ppd/ee/solid-state-relays.pdf


    http://www.rambal.com/descargas/libros/Nuts and Volts/1/Silicon Steroids for your Stamp.pdf
  • ppillardppillard Posts: 22
    edited 2014-07-10 20:09
    I was under the impression that SSR's were better suited for AC than DC. Did I err?
  • ercoerco Posts: 20,256
    edited 2014-07-11 00:09
    Genetix wrote: »
    You could ... have the BS2 drive a transistor that activates the relay.

    +1. Looks like most of those 30-40 amp auto lighting relays only take a couple hundred milliamps of coil current, so you could easily trigger with a small switching transistor, or better yet, trigger up to 8 using a darlington array ULN2803. Simple and cheap.

    This dollar board on Ebay is ULN2003-based and is all wired up to control 4 relays: http://www.ebay.com/itm/Stepper-Motor-Driver-Module-ULN2003-for-Arduino-5V-4-phase-5-line-28BYJ48-EK-/181462571310?pt=LH_DefaultDomain_0&hash=item2a4003192e

    Edit: Looking more closely at the photo, it may control up to 7 relays on pins A-G. Seven input pins.
Sign In or Register to comment.