Shop OBEX P1 Docs P2 Docs Learn Events
Need better Relay Driver Circuit — Parallax Forums

Need better Relay Driver Circuit

Kirk FraserKirk Fraser Posts: 364
edited 2005-04-28 09:08 in BASIC Stamp
I recently received the attached advice to interface between a BS1·output pin and a 5v Radio Shack relay.· Unfortunately the circuit I built as a result failed, both as soldered in and also later in proto-board versions.· I used·2N2222 transistors and originally tried 1N914 diodes but now switched to 1N4001's.·

On proto-board I used 5vdc, +5·for Vdd, -5 for Vss.· For the pinout I used the same 5v+ supply.· No response at the relay.· The relay does work by direct connect to 5vdc.· What am I doing wrong?· How can it be repaired?· Thank you.
345 x 456 - 2K

Comments

  • NewzedNewzed Posts: 2,503
    edited 2005-01-24 20:10
    Use a TIP120 for your relay driver.· This is a Darlington transistor with a built protective diode.· Use a 1k resistor in the base lead.

    Also check your relay.· Some relays may accept voltage across either coil contact.· Some will accept positive voltage on one pin only.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • steve_bsteve_b Posts: 1,563
    edited 2005-01-24 20:12
    -5V for Vss?· Shouldn't you just use a ground there?
    Certainly don't connect -5V to the Vss on your Stamp....don't know what this might do....but may not be good!freaked.gif



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://members.rogers.com/steve.brady
    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Joe FishbackJoe Fishback Posts: 99
    edited 2005-01-26 19:35
    Sid,

    You mentioned using a Darlington TIP120 in place of the pn2222a transitor. I am not real sharp on drawing circuits. Could you draw a circuit using the TIP120 and a the Stamp to controll a relay coil. When I look at the data on the TIP120 package it shows that the collector is connected to the mounting tab. If the TIP120 is used in the circuit attached by Kirk and mounted to a grounded metal frame, would this not short out? A drawing is worth a 1000 words.

    Joe Fishback
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-01-26 19:56
    I learned from answers on an earlier thread that I had reversed the leads on my 2N2222's so I'm in the middle of fixing that without moving up to the more powerful and expensive TIP120. I tested the above circuit on breadboard and it works if the correct parts are used as indicated.

    Normally you use silicone heat conducting but electrical isolating materials to mount power transistors to frames - or you use electically isolated heat sinks. So if you mount it correctly insulating the heat sink there should be no problem.

    Kirk
  • achilles03achilles03 Posts: 247
    edited 2005-01-26 20:08
    By protective diode, do you also mean a shunt diode?
    Newzed said...

    Use a TIP120 for your relay driver.· This is a Darlington transistor with a built protective diode.· Use a 1k resistor in the base lead.

    Also check your relay.· Some relays may accept voltage across either coil contact.· Some will accept positive voltage on one pin only.



  • NewzedNewzed Posts: 2,503
    edited 2005-01-26 21:28
    Kirk, the Darlington TIP120 costs $0.74, is in a TO 220 case and needs no heat sink.

    Achilles, you can call it a shunt if you like.· It's the anti-kickback diode found in all Darlington circuits.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-26 21:52
    I probably should have mentioned this earlier, but our old friend Scott Edwards did a whole column on interfacing way back at the beginnings of "Stamp Applications" in Nuts & Volts.· Here's a link to the PDF:

    http://www.parallax.com/dl/docs/cols/nv/vol1/col/nv6.pdf

    Just a reminder ... we've got over 100 articles online and it would really benefit many users to scan through them to see what's there.· Between Scott, Loz Glazner (of Solutions Cubed) and me, we've done a lot of projects for "Stamp Applications."· Check them out, you're sure to find something useful.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-01-26 21:53
    Sid,

    Ok, thanks for your suggestion. What is the maximum coil that can be driven with the TIP120? I might be able to eliminate the 5v relay and go directly to the 12v automotive relay with it, or eliminate that too and go directly to my 24v hydraulic valve coils.

    I'm still soldering in the new parts but if I have to do this again, I'd like to eliminate a few.

    Kirk
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-01-26 22:02
    Jon,

    Thanks for the original diagram and reference. I'm taking my first digital electronics class so I'm not really up to par yet but I'm working on it. The reference shows that a 12v relay can be driven from a 2N2222 which would have been good to know and may become useful again.

    Kirk
  • NewzedNewzed Posts: 2,503
    edited 2005-01-26 22:06
    Kirk, the TIP120 will handle up to 60 volts at 5 amps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-03-25 00:26
    Next level:

    Is there a circuit to drive a non-switching analog power transistor?· Perhaps using Pulse Width Modulation?

    I have two coils on a hydraulic valve, one for each flow direction·and they can be driven·proportionally 0-24+ volts to provide fine control over the output·flow.

    Thanks,
    Kirk·
  • NewzedNewzed Posts: 2,503
    edited 2005-03-25 00:39
    You might try a digital pot in the base circuit, driven by 5VDC from a Stamp pin.· Digital pots don't carry much current, about 2ma, so it would depend on how much base current you need.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    NEW! 4 MB EEPROM

    http://hometown.aol.com/newzed/page4.html
    ·
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-03-25 02:51
    I need one amp at up to 24 vdc.

    Would you suggest a Digital Pot be used to drive a power transistor like a Q101, MPT43055E, Buz71, etc? If so, what is the part number of a digital pot?
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-03-25 02:54
    Would the TIP120 you suggested earlier be useable in a proprtional mode?
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-25 16:15
    Not really, a TIP120 is also a Darlington configuration, which gives you an Hfe of like 2,500. I don't think they have a large linear region of use -- they're mostly intended to be used as on-off devices for high-power or high-current applications.

    People get around this all the time by using PWM -- pulse-width modulation. Basically, if you only turn on the TIP120 for 1 mSec, and turn it off for the next 1 mSec, you get only 50% speed out of your motor. Now the BS2 is not a really good device for doing PWM, since it is a single-tasking processor -- while you are PWM'ing one channel, the other one sits at zero. Makes driving two motors at the same time impossible.

    So, people make PWM co-processors. The BS2 tells the PWM chip speed and direction, and the PWM chip puts out the PWM signal for both motors at the same time.

    And Vss really should be GND, zero volts, for the above circuit to work.
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-03-25 17:10
    > So, people make PWM co-processors. The BS2 tells the PWM chip speed and direction, and the PWM chip puts out the PWM signal for both motors at the same time.

    :-( Ok.

    I know two BS1's communicate too slow. Could a BS2 tell 2 BS1's the speed and direction or is something better available?
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-03-30 10:51
    Sorry for my ignorance but would a TIP42 work? I only found one TIP 120 at the local Radio Shack but they had three TIP 42's and I need four channels out for one application.
  • Scott MScott M Posts: 43
    edited 2005-03-30 11:36
    I use ULN2003's for this - an array of 7 darlingtons with diode protection built-in. You run the output line of the stamp straight to one of the inputs of the ULN2003, and the output will drive a relay. I usually run the ULN2003 at 12v, because then I can drive larger relays. I usually put a 1k resistor between the stamp and the ULN2003, but that's just so I dont' fumble with a wire and harm the stamp - the circuit doesn't need it. The ULN will happily take 7 inputs and drive 7 outputs, handles a decent amount of current, and you can do PWM and even a flimsy sort of audio through them - a Freqout through a ULN2003 at 12v makes a viable, poor man's amplified siren. It's gotten so that I think of a stamp, a handful of resistors and a few of these darlington arrays as a single unit...
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-04-21 23:09

    I got advice from TI to use an 8 channel 12 bit D/A chip TLV5610 and have a couple of samples coming.· Anyone have an app note on·know·how to hook it up to a Stamp 2P40?· And which transistor would convert its output to a linear 0-24v range at upto 1A?· Or how do I locate such?

    Previous help from http://www.owlogic.com·was fantastic!· I tested my TLC2543 and it worked great.· I think a BS2P40 can handle at least 2 of them which fits a spot in my robot.·



  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2005-04-22 10:40
    I'm also building a pneumatic system with 12v·pneumatic valve coils which I'd like to·control through·a hacked servo motor circuit like below.
    The pot can be used attached somehow to the air cylider for position feedback...

    Can I use it for something like that or its a waste of time trying it?
    640 x 480 - 28K
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-04-22 15:20
    You may be referring to three different kinds of valve:
    1) On-off (single solinoid) valve
    2) Proportional (double solinoid or solinoid plus permenant magnet) valve
    3) Manual valve controlled by a servo motor

    Valve 3) is easiest to control by servo motor controls and slowest response.
    Valve 1) might need a Stamp to receive PWM and convert to a TIP120.
    Valve 2) is the more difficult which is what I'm asking about above. I think my solution is close but incomplete.
  • Kirk FraserKirk Fraser Posts: 364
    edited 2005-04-22 15:36
    Upon re-reading your post Tronic, I think you mean to ask about the pot control instead of the output. In that case, it depends how much accuracy you want and what the pot resistance range is. A Stamp PWM input may do the job or it may be too small resolution for you depending on your application. I used advice which appears on this forum thread:

    http://forums.parallax.com/forums/default.aspx?f=5&p=1&m=65498#m65510
  • Tronic (Greece)Tronic (Greece) Posts: 130
    edited 2005-04-28 09:08
    Thanks for your interest to help but I got a better solution by using a "SOV 26 SOS CC" electric valve and using a simple 10k pot for feedback about the position of the air cylinders... jumpin.gif

    ·
Sign In or Register to comment.