firing a relay
smkbayn
Posts: 25
what is the current rating max on an i/o pin for the bs2?· can i control a 5v relay directly from the pin or do i need to make a special circuit for that purpose?
Comments
You may find the attached Stamp Comparison Document a handy thing to keep around.
Regards,
Bruce Bates
I am working through the same questions - and I wonder if you could suggest an "all purpose" relay to use (with transistor too would be great). I would like to turn on and off an small video screen and video signal receiver for wireless video with a couple output pins from my bs2.
If I understand it all correctly, the relay is a switch that I can trigger with an output pin - the switch then allows current from another source through to my loads. If the relay itself draws too much to trigger with a basic stamp pin, then I will need a transistor to switch on a higher current that will then trigger the relay (and its still-higher current)? I'm reading through the documentation in WAM and other places too.
Thanks,
Carlos Ferguson
If you need to switch more current or a higher voltage, you will need a transistor to control the larger relay and WAM does show how to do this. Typical transistors include the 2N2222 or the 2N3904. You will need a current limiting resistor in the base lead, typically something like 470 ohms will do. If you're switching a motor or relay, you will again need a diode across the motor or relay with the cathode (bar) attached to the + supply and the anode (triangle) attached to the collector of the transistor.
Carlos
I have (almost) finished my first diagram of a a circuit which I THINK will handle relays up to 0.5A. I drew it using Visio, with which I am not too familiar. I tried saving it in jpg format and that LOOKS like it well and truly sucks. I will clean it up and (somehow) post it here for everyone to disect and hopefully correct all my mistakes.
Basically, it is a BS2p40/74HC595/ULN2803 concoction that I think (hope! guess!) will extend the output ability of a BS2. It will look very "busy" as I included every pin on all three ICs. It was only later that I think I understood the fact that you are only supposed to include the pins you actually use . . . and to place those pins logically, not physically where they really belong.
I am posting this now to save me time later. If you see errors in my thinking, please tell me.
Thanks.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
Mike
thanks again,
Carlos
·
·· If the relay is a Solid State Relay (SSR) and the input requirements for voltage and current can be met by the I/O pin then you can directly drive it.· On a mechanical relay with a coil, even if the relay only takes 5V @ 10mA I would never recommend driving it directly.· Any inductive devices like this should be switched using a transistor and a diode should be placed across the relay terminals to clamp any back EMF generated by the relay when de-energized.· Please see the attached schematic example.· I hope this helps.· Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
·
·· Sure, it is possible for the regulator to get hot from that.· Different Solid State Relays have different electrical characteristics.· The ‘LED’ on one may require more or less current than another.· If you exceed the total current draw from the on-board regulator it will get very hot.· You could try to determine how much current they are drawing, or you could use an inline resistor from the I/O pin to limit the current yourself.· The SSR should still work with reduced current.· I hope this helps.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support