Noise in ground by Reley

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.

You have a free-wheel diode across the relay winding don’t you? That’s absolutely essential.

I have a 1N4007 diode parallel to the coil of the relay, the cathode is conected to 5V dc and anode to GND.

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.

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.

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.

Thanks alot for all your fast answers.

oric_dan(333):

  • 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: Arduino Playground - HomePage

MarkT:
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.

Thanks alot, i will try both, ¿the capacitor is ceramic or electrolytic?, ¿what diode can you suggest me?

kf2qd:
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.

Grumpy Mike has a good tutorial on de-coupling : De-coupling
For 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

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.

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:

MarkT:
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.

  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.

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...

Why have you cross posted this? WHY?

Please accept my apologies =(, I didn't know if the topic was Motors, Mechanics, and Power or general electronics.

Posts merged.
@OP. DO NOT CROSS POST. IT WASTES TIME.

With this the problems seems to minimize but it stills affect the LCD randomly.

So add more capacitors and larger electrolytics as well in parallel 100uF.

Yes get a grip of your wiring. Ditch the solderless bread board. Solder it up on prototype board and keep the wiring neat. As mentioned before keep the AC stuff away from the low voltage stuff.

Finally I solve the problem, I tried all your recommendations and finally I nailed it. THANKS TO ALL FOR YOUR HELP!

Well so first of all, I remake my whole circuit, making it cleaner.
Old-circuit Photo

New-circuit Photo

I know, I know, it's still messy but I did my best. For my luck the problem still there in the LCD. So I followed dc42 advice and connect my LCD directly to my arduino, and it didnt work either, but with the snubber parallel to the load and the LCD connected directly to my arduino the impossible became possible :D, now it´s working and the display works great.
So this is my snubber (Resistor 100 ohms 1W, Polyester capacitor 250V .1uF:

In my local store the ceramic capacitors are only of 50V so I tried with a polyester one (250V .1uF) and a resistor of 100 ohms, 1 Watt because of 1/4 watt it burned.

So my solution was adding the snubber in parallel to the Water pump and connecting the LCD directly to the pins of the arduino 5V and GND.

Thanks again for all your help. XD