Shop OBEX P1 Docs P2 Docs Learn Events
BS2 and relays — Parallax Forums

BS2 and relays

prodigy467prodigy467 Posts: 5
edited 2009-07-22 03:19 in BASIC Stamp
I am about to start a project to open a dog door using the basic stamp 2, some sensors, and a linear actuator. I've done a fair bit of research but am stuck on one part. Just a bit of background first though, i am a professional software developer, but am fairly new to BS and electrical engineering. So my question is, will the output voltage on one of the BS2 pins be enough to trigger a relay such as this one: http://www.firgelliauto.com/product_info.php?products_id=28·? From what i understand the voltage that goes to the pins is ~5v, and the relay is execting 12v. Surprisingly, I can't find any examples of people doing this (on google or here), but I would imaging this is a common thing. If this is not possible, how do people accomplish this task (the task being, engaging a linear actuator which requires higher voltage/amps and the ability to reverse the polarity)?

Thanks!
Doug

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-20 04:06
    The relay you showed cannot be triggered directly from a BS2 pin for two reasons: 1) The relay requires 12V to operate. It cannot operate at 5V. The BS2 I/O pin will be destroyed by 12V. 2) The relay requires more current to operate than the BS2 can supply. The maximum current from an I/O pin is about 25mA. It looks like the relay requires about six times that.

    There are all kinds of examples available for controlling a relay from a Stamp I/O pin using a switching transistor. For example, download Nuts and Volts Column #6 and have a look at it. Go to the main Parallax webpage and click on the Resources tab. In the list that comes up, click on Nuts and Volts Columns and you'll be taken to the index.

    You can reverse the polarity with a 2nd relay (a DPDT - double pole double throw relay) that can be connected to reverse the power.
  • whiteoxewhiteoxe Posts: 794
    edited 2009-07-20 04:22
    Yep I did not understand how to trigger a relay either, so i bought a beginners intro into electronic kit (aimed at kids i think) but it did have plenty of projects and explanation of npn and pnp transistors and how to set up a circuit to trip the relay using a second power sourse ! you gota start somewhere [noparse]:)[/noparse]
  • PrettybirdPrettybird Posts: 269
    edited 2009-07-20 06:49
    ·I reciently learned of a chip that might make things simple. It is a ULN2003 darlington transistor array.·It can drive up to 7 relays or whatever directly from a TTL 5V signal with no extra parts needed at 500MA.·I think Parallax might sell them or an industrial electronics place should carry. It is designed as a simple interface to drive relays. Enclosed is a spec. sheet.



    ·The more you learn, the more you find you don't know. It is neverending.· Confucous 550 BC
  • whiteoxewhiteoxe Posts: 794
    edited 2009-07-20 07:15
    Thats a Pretty good idea [noparse]:)[/noparse] I for one will try it out. When I set up my own transistors and circuit it took awhile as it mattered a lot what resisters were used and I had no idea why it didnt work so I played around wif different resistors and then it worked.

    Your solution will probably save that headache or create a new one [noparse]:)[/noparse]
  • dev/nulldev/null Posts: 381
    edited 2009-07-20 09:09
    You can also get pre-configured TTL level circuits from electronic stores to control relays.
    Here is a discussion of using ULN2003: www.electro-tech-online.com/datasheet-parts-requests/39976-uln2003.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't worry. Be happy
  • Lab RatLab Rat Posts: 289
    edited 2009-07-20 19:27
    yes te darlington array works beautifully if it is functioning properly the ones i had where about 15 years old go figure i took the out of old apple disk drives

    i was working with 12 volt relays to interface to a 120 volt PLC

    be careful with stamps and relays make sure you have an anti kickback diode in place to prevent kickback of the collapsing magnetic field cause that could fry your stamp been there done that no fun it was a friends stamp too OOOPS lol
    Prettybird said...

    ·I reciently learned of a chip that might make things simple. It is a ULN2003 darlington transistor array.·It can drive up to 7 relays or whatever directly from a TTL 5V signal with no extra parts needed at 500MA.·I think Parallax might sell them or an industrial electronics place should carry. It is designed as a simple interface to drive relays. Enclosed is a spec. sheet.



    ·The more you learn, the more you find you don't know. It is neverending.· Confucous 550 BC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Parallax posesses power beyond belief.

    Believe in it.
  • prodigy467prodigy467 Posts: 5
    edited 2009-07-21 00:51
    Thanks for all the quick and helpful replies. So, I did some more reading and I think I would like to try going with that ULN2003 chip. It seems to make things pretty easy and clean. While that spec sheet is Greek to me try to put it in terms of what I understand it to be.

    So my end goal here is to turn give power to an actuator and to be able to reverse the polarity. This is done by controlling the switches on two relays. Most of the actuators that firgelli sells, say that they require 12V and 4amps at full load, which is what I will be toggling through the relays. The relay I posted above says it requires at a minimum of 150amps and later is says that it must be at 12V to trigger the relay. Since the BS output pin is at 5V and ~25amps, the ULN2003 will allow me to control another power source at 50V and 500mA max (of which i only need 12V). So, what i'm struggling with here is it seems like I need 3 different power supplies, 1 for the BS, 1 for the actuator (at 12V 4A), and 1 to trigger the relays, which will go through the ULN chip (12V and <500mA)?

    That sound right? Anyway i can simplify my power needs?

    Again, I'd like to apologize for my newb questions. I'm not trying to become an expert in this area (yet), and I am under a time crunch.


    - Mike: I looked over the columns you suggested but didn't see anything about this specific subject? Which column in volume 6 were you referring to?
    - Lab Rat: Do you have any links to example diodes, I didn't find much when i googled that.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-21 01:17
    The Nuts and Volts Column is #6 in the first volume. The columns are numbered sequentially.

    You can also use what's called an H-bridge. This is a set of 4 transistors with controlling logic that can turn power on and off and can reverse the polarity of its output. There are some integrated versions like the L293 that Parallax uses in their Professional Development Board. Google "wiki h-bridge" for a description and some examples and links to further information.
  • tronsnavytronsnavy Posts: 70
    edited 2009-07-21 01:27
    The Nuts and Volts column (stamp applications no. 23, January 97) has some great ckts. Also found this simple 4 transistor H-Bridge (see link). Worked great for me.
    http://library.solarbotics.net/circuits/driver_4varHbridge.html
    Have a good one.
    Bob
  • Lab RatLab Rat Posts: 289
    edited 2009-07-21 02:04
    you can use two power supplys one for the stamp and one for the actuator and the relays just put a .5 amp fuse in line with the relays to prevent over currenting the relay which i highly doubt would happpen but i have seen stranger things a fuse woud be cheaper then a third powersupply and would work the sam or a voltage regulator at the right current rating would work too

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Parallax posesses power beyond belief.

    Believe in it.
  • prodigy467prodigy467 Posts: 5
    edited 2009-07-22 03:05
    Ok, so i have decided to go with an H-Bridge.

    I was able to find this chip:
    http://robokitsworld.com/index.php?main_page=product_info&products_id=79&zenid=n6k4rmeik040lmlkim2k6lonn7
    Spec: http://www.robokits.co.in/datasheets/l293d.pdf

    which looks similar to chip you mentioned Mike, only it handles more amps. From what I now understand I can toggle the inputs on this chip with the pins from the BS, and I can run a 12V 2A powersupply through the chip to power this guy:
    http://www.firgelliauto.com/product_info.php?cPath=79&products_id=131

    the chip says it handles 1A and 2A Peak, the actuator runs at <1A under no load and 2A max....since the actuator won't have much load, am I okay here?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-22 03:19
    The L293 that you mention is used by Parallax on their Professional Development Board and their StampWorks Manual has some sample programs and discussion on its use. Search Parallax's webstore for the Manual and you'll find a download link for it on the product's webpage.

    1A would be the continuous current rating. Since the actuator is lightly loaded and the no load current is under 1A, you should be fine. Since you're close to the current rating, plan on a little heatsink of some sort. The center ground pins on the package help dissipate heat and, on custom printed circuit boards, are often connected to large area "tabs" of copper.
Sign In or Register to comment.