stumped
bryanfuel
Posts: 5
i am trying to trip a relay with basic stamp homework board and the vdd will trip it but pin 2 set to high wont. I have already tested to see if my program is working to give pin 2 power and it should be enough to work. i get 5 volts from both sources but only vdd trips the relay. what am i doing wrong
Comments
Anyway,.··· If·Your relay·trips with vdd it should trip with a high command.··write a little three line section of code and check it again.····· ··
good luck
Hope this helps...
Randy "technoob"
The Stamp HW board has built-in 220 ohm resistors on all output pins, so that limits your available current and hopefully prevented you from damaging pin 2 or any other pin you tried.
One way to·trigger a larger 5V relay is to switch it with a 2N2222A transistor per the attached sketch. Sketch shows a flyback diode across the coil; use this, it saves stamps!·Generalized sketch·shows a 330 ohm resistor going to the stamp. Your BS2 HW board already has 220 ohms, so only add a 100-ohm resistor in series.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Post Edited (erco) : 2/8/2009 3:38:53 PM GMT
To fix the problem of not enough current, you'll want to use a transistor or two. Look on this page for information on how to do that. In addition, you'll want to add a protective diode on the motor line to stop the surge of reverse voltage when you turn off the relay.
You can't control a relay like a servo. They are completely different. A relay take a relatively long time to go from one state to another, something that the control electronics takes care of for a servo. You might be able to open and close the relay at that speed (~50 Hz), but it depends on the relay.
You should thank the Folks at Parallax for the 220ohm resisters and the zeners they placed on the I/O pins.Like "erco" mentioned the flyback voltage from the relay would zap the I/O pin,(Letting all the factory smoke out.) You got lucky this time with no damage to the I/O pin, But this careless practice will lead to burnt out I/O pins.
I would read up on the hardware side of the $STAMPs I was useing, And what drivers I needed to use.
______________$WMc%_______
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············································ BoogerWoods, FL. USA
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."