Offline
Newbie
Karma: 0
Posts: 11
|
 |
« on: October 29, 2012, 10:00:56 am » |
Hello, I have a big problem. I'm making a school project using sensors, releys (5v), transistor, leds, lcd, etc. The purpose of the project is to use the relays to control a 120V with my arduino so i can control a small water pump. My problem is everytime the reley activates and deactivates it makes a noise in the ground line (I checked with the oscilloscope) and this noise makes my LCD display goes crazy (it turns off, sometimes shows random letters,etc). I'm not using decoupling capacitors, and i don't know how to bear with this interference, the only thing I have are parallel diodes in the releys. Someone have any idea of how reduce this interference? I don't know to much about filters or capacitors. I'm using this relays (RAS-0510), and an arduino duemilanove.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 71
Posts: 6624
Arduino rocks
|
 |
« Reply #1 on: October 29, 2012, 11:08:34 am » |
You have a free-wheel diode across the relay winding don't you? That's absolutely essential.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #2 on: October 29, 2012, 11:18:41 am » |
I have a 1N4007 diode parallel to the coil of the relay, the cathode is conected to 5V dc and anode to GND.
|
|
|
|
|
Logged
|
|
|
|
|
the land of sun+snow
Offline
Edison Member
Karma: 81
Posts: 2123
|
 |
« Reply #3 on: October 29, 2012, 11:23:40 am » |
This is a common problem with switching inductive loads, especially 120-220 VAC, using a microcontroller system. The initial precautions include:
- adequate bypass caps on the microcontroller. - reverse diodes across the relay coils. - snubbers on the relay contacts [do google search on "snubber"].
If that doesn't fix the problem, well, some commercial companies have to go to truly heroic efforts to get their systems working reliably.
Also, in general, you cannot drive a 5V relay directly from an Arduino I/O pin, as 5V relays typically require somewhat more current than the pins can provide, so people typically use NPN transistor inverters between the I/O pin and relay.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 71
Posts: 6624
Arduino rocks
|
 |
« Reply #4 on: October 29, 2012, 11:27:37 am » |
I'd also add more supply decoupling on the 5V rail right next to the relay and its transistor. 220uF or so. Replace that 1N4007 with a fast recovery rectifier, its too slow.
|
|
|
|
|
Logged
|
|
|
|
|
South Texas
Offline
God Member
Karma: 8
Posts: 976
|
 |
« Reply #5 on: October 29, 2012, 11:29:11 am » |
You mentioned that you have no bypass caps. That would suggest that you think it would really be practical to use them but you either didn't bother, or couldn't be bothered. Add a larger cap to the power supply side and some smaller ones to the display and the lines going to the relay control.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #6 on: October 29, 2012, 11:51:03 am » |
Thanks alot for all your fast answers. - adequate bypass caps on the microcontroller. - reverse diodes across the relay coils. - snubbers on the relay contacts [do google search on "snubber"].
Also, in general, you cannot drive a 5V relay directly from an Arduino I/O pin, as 5V relays typically require somewhat more current than the pins can provide, so people typically use NPN transistor inverters between the I/O pin and relay.
Thanks I will try the snubber, and for the bypass cap on the microcontroller, where can i conect it if im using an arduino duemilanove? Sorry i forgot to mention, Im using an external supply of 5V with the ground connected with the arduino gnd. Im also using the transistor conection like this: http://www.arduino.cc/playground/uploads/Learning/relays.pdfI'd also add more supply decoupling on the 5V rail right next to the relay and its transistor. 220uF or so. Replace that 1N4007 with a fast recovery rectifier, its too slow.
Thanks alot, i will try both, ¿the capacitor is ceramic or electrolytic?, ¿what diode can you suggest me? You mentioned that you have no bypass caps. That would suggest that you think it would really be practical to use them but you either didn't bother, or couldn't be bothered. Add a larger cap to the power supply side and some smaller ones to the display and the lines going to the relay control.
I read i needed some, but i was afraid cause im new using capacitors.
|
|
|
|
|
Logged
|
|
|
|
|
Inland Empire, California, US
Offline
Full Member
Karma: 1
Posts: 181
|
 |
« Reply #7 on: October 29, 2012, 09:42:17 pm » |
Grumpy Mike has a good tutorial on de-coupling : http://www.thebox.myzen.co.uk/Tutorial/De-coupling.htmlFor what its worth, I had a similar problem with an lcd when a motor shut off and I solved it with a flyback diode across the windings and a 1000uf cap on the power rails
|
|
|
|
|
Logged
|
|
|
|
|
United Kingdom
Offline
Faraday Member
Karma: 131
Posts: 4674
|
 |
« Reply #8 on: October 30, 2012, 04:57:13 am » |
A schematic and a photo will make it easier for us to help you. Keep the ground wire to the LCD separate from the ground wire supplying power to the Arduino and/or connecting the relay.
|
|
|
|
|
Logged
|
Formal verification of safety-critical software, software development, and electronic design and prototyping. http://www.eschertech.com
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #9 on: November 04, 2012, 12:28:43 pm » |
Hello, sorry for taking so long in answer again, this are my conclusions: First of all this is the noise signal I got in my oscilloscope between 2 points in the ground when the relay turn off.  This is the schematic of my circuit  Real life circuit  Im using a small water pump (127V, 3W) used in little fountains like fen shu and stuff. It looks like this:  Replace that 1N4007 with a fast recovery rectifier, its too slow.
I changed the 1n4007 diode for a 1N4937 (Fast recovery rectifier) but the ground problem is the same. I also tried adding some decoupling capacitators (3, one near the LCD, one near the relays, and one near the power supply) all the 3 are ceramic capacitators of .1uF (50V). With this the problems seems to minimize but it stills affect the LCD randomly. I also tried adding the snubbers, but i found alot of diferent types of connections, I tried this:  All my snubbers consist of .1uF ceramic capacitor (50V) and a 100ohms resistor (1/4w) In snubber #1 (parallel to the load): My resistor and capacitor burned in 5 secs. In snubber #2 and #3: The problem in ground persists. If anyone could help me I would be very grateful.
|
|
|
|
« Last Edit: November 05, 2012, 11:36:08 am by Neonz »
|
Logged
|
|
|
|
|
United Kingdom
Offline
Faraday Member
Karma: 131
Posts: 4674
|
 |
« Reply #10 on: November 04, 2012, 12:44:03 pm » |
1. Your wiring is very messy. Keep the 120V water pump wires as far away from the other wires as possible.
2. The capacitors in your snubber networks need to be rated at 120VAC or more. Either connect the snubber directly across the water pump, close to the pump (but not submerged obviously!), or across the 2 relay contacts that you have wires connected to.
|
|
|
|
|
Logged
|
Formal verification of safety-critical software, software development, and electronic design and prototyping. http://www.eschertech.com
|
|
|
|
Phoenix, Arizona USA
Offline
Faraday Member
Karma: 27
Posts: 5079
Where's the beer?
|
 |
« Reply #11 on: November 04, 2012, 01:48:24 pm » |
I'm wondering if a combo of "1" and "3" would work better, but change the cap and resistor for "1" to a cap of 100V or more, and a resistor of 1/2 to 1 watt? I'm pretty certain it may just be the cap that is at fault here on "1", because it's voltage rating is too low; you may also want to increase it's size, depending on what you see on your scope. That's all just a guess, though, on my part. My thought is that it is with the pump (not so much the relay); when the contacts open, you are getting the flyback voltage from the pump motor, giving the spike (have you tried disconnecting the pump from the circuit and see if you still get the spike on your scope?), so doing something to dump that spike is needed (ie, snubber). I also wonder (though I don't know if it would be to code or cause problems otherwise) if you connected the "floating"/unconnected relay contact to -ground- instead of neutral (maybe with your #3 snubber?) if it would work better/worse? Maybe someone can correct me here if I am wrong about this suggestion...
|
|
|
|
|
Logged
|
|
|
|
|
Phoenix, Arizona USA
Offline
Faraday Member
Karma: 27
Posts: 5079
Where's the beer?
|
 |
« Reply #12 on: November 04, 2012, 02:13:44 pm » |
Why have you cross posted this? WHY?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #13 on: November 04, 2012, 02:37:04 pm » |
Please accept my apologies  , I didn't know if the topic was Motors, Mechanics, and Power or general electronics.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19066
I don't think you connected the grounds, Dave.
|
 |
« Reply #14 on: November 04, 2012, 03:16:28 pm » |
Posts merged. @OP. DO NOT CROSS POST. IT WASTES TIME.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
|