Shutdown when using a relay to switch AC
hkymstr
Posts: 3
I am using the SX28 I have written a program to energize a relay connected to the SX when a button is pressed. The relay energizes a solenoid conneceted to a water facet. The whole system works fine when nothing is connected through the relay, when the button is pressed you can hear the relay close, and when the button is released the relay open. This whole operation can also be visualized in the debug command of the sx-key software. Now when I connected AC power to the relay to energize and denergize the relay and operate the circuit the whole thing locks up. But if I just connect 5V through the relay to turn on an off a LED the whole thing works flawlessly. Am I introducing to much noise into the circuit to mess with the SX28, I can't seem to figure it out?
Any help is appreciated.
Rick
Any help is appreciated.
Rick
Comments
Help me to understand......for the end result you want the relay to switch AC power?
Everyting seems to work ok if you use the relay to switch dc......lighting an LED?
Although the circuit works with DC, do you have a diode connected (reverse polarity) across the relay coil?
Although a realy should electrically isolate the switch portion from the control portion it may not be in your case. Not seeing the circuit however it is hard to say.
An option you may consider trying is to use an opto isolator, and in doing so the only coupling between your SX and the external circuit is light.
Ken
Yes for the end result I would like to switch AC power to a solenoid.
Everything works okay when switch 5v connected to an LED.
I do have a diode connected (reverse polarity) across the relay coil.
As for the circuit I have port (output) RB0 connected to the relay (positive terminal) and the other side grounded, with a diode across the terminals.
When you say opto isolator do you mean a solid state relay? Is there any other solution to isolate the relay without purchase of an opto isolator.
Thanks,
Rick
an opto could be used as suggested by Ken. I don't know where I got the GIF, i can't take credit for it, but it was on my harddrive.
later, Kevin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There are 10 kinds of people in the world.... those that know binary, and those that don't.
Post Edited (mojorizing) : 8/1/2004 1:51:38 AM GMT
When I mention opto, I am not speaking of a solid state relay. What I had in mind is a 4N35.
http://www.fairchildsemi.com/ds/4N/4N35.pdf
The 4n35 control side is basically a "sealed" LED and the output is typically hooked up as an open collector NPN.
I would hook it up as follows:
Connect 330 ohm resistor from + 5 to pin number 1, pin 2 to the SX.
Pin 6 left open (if not concerned with turn off speed) or pin 6 to ground through a 1k resistor.
Pin 4 to ground of the SEPERATE power supply
Pin 5 to the minus side of the relay coil.
A logic 0 from the SX causes current flow through pins 1 to 2. That in turn turns on the NPN, bringing pin 5 to ground, which in turn turns on your relay.
I cannot understand however why the relay alone does not work.....it should unless some EMI from the AC is interfering with the SX.
A breadboard version of an SX based·duty cycle meter I built would stop working when a two way radio in our test car way keyed to talk on the radio, so you might have a similar effect going on with your AC circuit upsetting the SX.
Might want to look through www.sxlist.com and see if there is any info there in interfacing the SX with AC powered circuits.
Ken
thanks,
rick