Shop OBEX P1 Docs P2 Docs Learn Events
best way to control a relay? — Parallax Forums

best way to control a relay?

Jayguy5000Jayguy5000 Posts: 139
edited 2007-04-22 17:05 in BASIC Stamp
I need to use a bs2 to control a relay that requires 5vdc and a coil resistance at 250 ohms. the relay itself is a spst 125VAC rated at .5A. What is the best way to control this with the bs2?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.

Comments

  • Pat AlonziPat Alonzi Posts: 27
    edited 2007-04-18 01:13
    NPN switching transistor make sure to use a 220-330 ohm between the data pin and the base. One pole of the relay connects to 5V (I would use external power and not try to put too much load on the power regulator of your BS) and the other goes to the collector of your transistor. the emitter goes to ground.

    If you need some help on transistors use this site: http://www.kpsec.freeuk.com/components/tran.htm

    Also, I would recommend using a diode across the relay to block any Back EMF from damaging the rest of your circuit.

    I can draw up a schematic if you need more help.

    -Pat
    palonzi@ecn.purdue.edu
  • Pat AlonziPat Alonzi Posts: 27
    edited 2007-04-18 01:27
    Is this goin in that tank of yours?
  • curious1curious1 Posts: 104
    edited 2007-04-18 01:51
    Hey Pat,

    I'd like to see the schematic for the circuit you just described. I will copy it to my workbook.
    Thanks,
    RC
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-04-18 01:53
    Jayguy5000--

    Each tank whisker should weigh 2500 pounds and extend 3192 (3120 + 72) inches as measured from the rear of the M1A1 (or A2). Each tank whisker should be composed of five, 500 pound steel rollers which will provide the added benefit of IED detection. (This is important and will make you famous, or alive .·. . whichever is most important to you).

    You will not need additional electronics when a whisker successfully detects an IED.

    --Bill (Chennault)
    ps I think you can forget that stuff about the A2 getting 35% better mileage.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Jayguy5000Jayguy5000 Posts: 139
    edited 2007-04-18 02:00
    lol I didn't even think of that! I wonder what I could do with it..Bill did you used to be a tanker?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.
  • curious1curious1 Posts: 104
    edited 2007-04-18 02:30
    Most Excellent Mr. Allen
    Thank you,
    RC
  • Jayguy5000Jayguy5000 Posts: 139
    edited 2007-04-18 04:55
    I don't quite understand what kind of diode to use or where it should be placed. Also, what does the bs2 need to send out of one of its I/O pins?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-04-18 13:00
    Jayguy5000--
    Bill did you used to be a tanker?
    No, but I have·a little·experience with the A1. It is an absolutely stunning machine. I just wish it was more comfortable! A little crew comfort would go a LONG way! But, I must say the suspension is so good it has to be experienced to be believed.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-18 13:05
    Jayguy5000,
    Look at the Nuts and Volts article that PJAllen posted. It has schematics and sample programs.
  • Nick WaldvogelNick Waldvogel Posts: 71
    edited 2007-04-18 13:37
    Will any diode work or is there a formula to use to determine the proper size?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-18 13:51
    The article shows a 1N4002 which is rated at 1A average current and 100V.
    Anything similar (50V or more, current rating roughly 1A) should work for most small motors or solenoids.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-04-18 14:07
    The following schematics are the ones I usually put up for this question.· There is both a MOSFET and NPN Transistor Driver. R1 would typically be 1K but there is a valid range depending on the load and transistor used.· This schematic is for example.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    320 x 240 - 6K
    320 x 240 - 6K
  • Pat AlonziPat Alonzi Posts: 27
    edited 2007-04-18 16:27
    it looks like in between when I went to sleep and woke up this got wrapped up do I still need to post my schematic? it is basically the same as Chris's. However I recommend using a darlington since it gives you room to upgrade in the future for more relays.
  • curious1curious1 Posts: 104
    edited 2007-04-18 20:17
    I've gotten all that I need, thanks anyway Pat.

    RC
  • skylightskylight Posts: 1,915
    edited 2007-04-18 21:46
    The easiest way I believe saving on component count, is to use the L293D driver chip with four channels each able to drive·600ma into loads at up to 36V, able to drive inductive loads and input direct·from stamp (5V)·without any transistors or external components for simplicity it seems IMO the·easiest route. Anyone think otherwise?
  • Jayguy5000Jayguy5000 Posts: 139
    edited 2007-04-22 01:36
    ok I bought an extension cord that can be cut to be able to put the 110 VAC through the relay, can some one please put up a shcematic of how all of this should be connected? for right now im trying to control anything really, I dont mind how I control it either, push button would be fine. I have a black light I can use to turn on and off. THANKS

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-04-22 17:05
    You will also require a fuse·(don't be·an idiot.)
    You will also require a terminal block (don't be·an idiot.)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When you get 1st Place in the "Darwin Awards", you're a Winner & a Loser.
    588 x 450 - 26K
Sign In or Register to comment.