INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Relay EMI is triggering sensors on custom Arduino PCB

Relay EMI is triggering sensors on custom Arduino PCB

(OP)
Hi All,

I have a problem with the relay on a custom PCB I designed. On my breadboard prototype the parts where somehow spaced out enough to not show the problem.
The relay I am using is a DPDT 120VAC (Mouser: 653-LY2-DC24). In 50% of the switching operation, a button is triggered as a side-affect. It is 'Push_button1' or 'Push_button2' that get triggered - luckily it does not also trigger the reset-button. I found some resources talking about arc suppression at relays that are RC elements. But I dont know how to use that with a DPDT relay. I use the relay to switch a load between 2 power sources.

Any suggestions?

Markus


RE: Relay EMI is triggering sensors on custom Arduino PCB

The common way to do it is to connect an RC combination parallel to the load(s). Either buy complete RC combinations or build your own. There are a few things to Think about, so I recommend to buy the snubbers from a reliable source. You will most likely be fine with a 100 nF/100 ohm combination.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

Markus; It's not clear to me that the relay problem is caused by the load it's switching or by it's own coil impulses. Does your phantom switching occur only when switching a load or has it ever occurred with no load involved.

Is there a flyback diode associated with the relay's coil?

Keith Cress
kcress - http://www.flaminsystems.com

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
Keith, I have a flyback diode, see below circuit.

>Does your phantom switching occur only when switching a load or has it ever occurred with no load involved.

That is not 100% clear at the moment, I would have to construct an test program to do lots of switching and measure.

So in case its the arc, between which pins 1-6 do the RC elements go?
(5+6 are load and 1/3 and 2/4 are the 120VAC source)


RE: Relay EMI is triggering sensors on custom Arduino PCB

Across the load. That would be between JT1 and JT3 for one load and between JT6 and JT3 for the other load.

The R in the RC combination can be reduced down to around 10 ohms, if necessary. A 10 A Contact can easily handle that.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

Typically you'd only need the diode to mitigate the coil being an issue, you have that, so go with Gunnar's excellent advice.

Keith Cress
kcress - http://www.flaminsystems.com

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
Gunnar, the relay is switching both poles of the same load, so JT1 and JT3 belong to the same single phase AC plug. Also what I need to add is that this is basically the core of a UPS. That means one source (pins 1/3) are coming from an DC-to-AC inverter where the load is not against neutral. The other pair (2/4) is from mains power.

RE: Relay EMI is triggering sensors on custom Arduino PCB

OK, then connect between JT1 and JT6 - i.e. across the load.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
I found this link here for a formula to design the circuit: Link

That would mean in my case: 120VAC, 10A --> R = 50-100 Ohm (1/2 Watt) and C = 5-10uF

Is this correct?

RE: Relay EMI is triggering sensors on custom Arduino PCB

NO!!!

That can't be used at all.

I made a clip and added comments here: http://gke.org/pub/files/Industrologic%20snubber%2...

It is only the generic tip (number 3) that works. It is, BTW, identical to my recommendation.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
Gunnar, I am in the USA so 125VAC applies to me. I looked at manufacturer catalogs and I found this component: Link
Since UL/CSA Recognition is important to me there is only one item: 104MACQRL150 - 150 Ohms (1/2 watts), 0.1uF
The ohms are far away from your suggestions so I am not sure what to do.

RE: Relay EMI is triggering sensors on custom Arduino PCB

The resistor is there to protect the relay contacts, mostly. It has a certain damping effect also, but that is not important in your application. The main problem with too high a resistance is that the inductive part of the load current can create too high a voltage across the resistor - which may initiate some arcing when the contacts open.

If your inductive load is "humble" (low) you can try out the part you found. It will probably work, but I feel more at ease with a lower R. Some experimentation is in order. Use a scope (and a differential probe) to observe the contact voltage.

A MOV can, of course, also be used. But RC snubbers are more reliable in the long run.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
It is hard to predict the load - the snubber should ideally be able to deal with all kinds.
But in my particular case it should work well with compressors in refrigerators. Do you see a problem there?

RE: Relay EMI is triggering sensors on custom Arduino PCB

No probs with that kind of load if you keep R low. Except for the heavy start. All relays cannot handle the temporary high current. But that is more a question of thermal capacity with the relay's contact.

Also, make sure that ALL the PCB tracks that carry load current are wide enough so they don't "curl up" when current gets too high momentarily. Match fuse to trace width.

I hope you are testing this worst case Before starting production.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

Aside from reducing the transients from the arcs, can you improve the noise rejection of the button inputs? Different caps, external (stronger) pull-ups, software debouncing?

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
@Gunnar: The peak load on compressor start-up is 1600W but only for 0.5 sec. I have picked 2oz copper for the PCB and I have a 10A slowblo fuse inline.

@BrianE22: I do debouncing in software but that does not do the trick.

RE: Relay EMI is triggering sensors on custom Arduino PCB

What is the basis for assuming that it's specifically the relay? The relay closure initiates other things that could also screw things up, like the fact that you are now dumping 50A into the same ground circuit that the Arduino sits on.

TTFN
FAQ731-376: Eng-Tips.com Forum Policies

Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers

RE: Relay EMI is triggering sensors on custom Arduino PCB

2oz at that thickness - not worried! viking2 Thor - thunder God.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

IR, wasn't answer to you. It was about current carrying capacity of the traces. 2 oz Cu is OK.

BTW, do you really think that Power is tied to Arduino GND? I don't tink it is.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

I think problem come from initial high di/dt, not from contact arcing. From photo, PB1 and PB2 are far away form Arduino connector with very long traces that go too close to relay. For PB3 (reset) it's not same situation - it's close to Arduino connector - and don't "see" same EMI in traces. I think you need to redesign PB1 and PB2 position to eliminate such problems. May try to reduce resistors of these Arduino lines to minim (maxim allowed current) to increase noise immunity. For this card, may cut traces from PB1 and PB2 and replace them by wires (twisted or better shielded).

RE: Relay EMI is triggering sensors on custom Arduino PCB

Designing a low voltage digital system on the same board as high current, high speed is certainly doable, but it requires extremely careful planning, and generally, more than a 2-layer board, particularly if signal lines are running through the high current sections. I've worked with boards that dump 120A in 60 ns that didn't have any problems, but the signal interfaces were all differential AND isolated through pulse transformers or opto isolators to prevent interference.

TTFN
FAQ731-376: Eng-Tips.com Forum Policies

Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
I want to stick with 2 layers so I might re-consider the location of the buttons. I just bought the right Resistor+Cap and will install it at the weekend. Additionally I will create data logging around the push button events to dump out all sensor data, especially from the hall sensors and relay state. This might bring more clarification.

RE: Relay EMI is triggering sensors on custom Arduino PCB

I would scope out your power/ground to the microcontroller... it doesn't take much power dip to have the brown-out detector kick in and reset the part.

Dan - Owner
http://www.Hi-TecDesigns.com

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
Dan, can you be more specific? I am not sure what you suggest to measure.
But so far a reset has not occurred.

RE: Relay EMI is triggering sensors on custom Arduino PCB

Interesting board. I've been running a fridge for years with a UNO. Actually it runs the whole house with power point PV water heating, septic pump, fan, and 12 & 36V charge control. Have some questions, you should post this at fieldlines.com. Are you sure this isn't getting reset? What do you have for a pullup? It seems like this could be handled in software. I wouldn't worry too much about the values of the RC. The big difference is between none and any. I've manufactured tens of thousands of them. Just make sure you use an X2 rated cap if you do it yourself.

RE: Relay EMI is triggering sensors on custom Arduino PCB

You should be able to do software debouncing of the PBs. In your program look for a continuous hold down signal of 0.5 to 1 sec before triggering the action. Any transients should be gone before 0.5 seconds. If it is still triggering, then then problem is not in the PBs, but elsewhere.

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
@djs: my software debouncing is currently set to 50ms - I will try if a higher value still gives good control when using the buttons to navigate the settings menu.

RE: Relay EMI is triggering sensors on custom Arduino PCB

Any debounce beyond 20 milliseconds is pure lunacy. And to avoid HF interference, one millisecond is plenty.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

Over 20ms will make button pushing into a nightmare.

Keith Cress
kcress - http://www.flaminsystems.com

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
Results from the testing: Still got EMI. I setup a logging mechanism and captured a button press in the moment the relay was switching. The numbers show that in the moment of switching a load of 160W was on for about 24 minutes. The switching was passing the load from the inverter to the mains power. That means nothing in the DC circuit could have caused the EMI. I have used a 100 Ohms + 0.1uF combination.
Shall I try 50 Ohms now?

RE: Relay EMI is triggering sensors on custom Arduino PCB

OK, do that. But I'm afraid that you need help from someone that knows the ins and outs of this. Working like this is never good. Hands-on is the only way.

Where in the World are you? If in the Bay area, I think that Keith is a good tip.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
I am in Los Angeles (Altadena). Agreed that trial and error is not the ideal method here, how is that done right?

RE: Relay EMI is triggering sensors on custom Arduino PCB

Keith is in the Bay Area North of you - near San José, a beautiful drive along the 1 - but somewhat lengthy.

"how is that done right?"
Find the REAL reason for the problems instead of assuming. It can be anything, arcing contacts is the most common, then there is (as IR and Opera are saying) all sorts of influences from heavy currents causing ground shifts and induced voltages in unexpexted places.

To rule out arcing contacts and load/inrush, you can disconnect the load completely. If problems go away, then you know that it is on the contact's load side you shall look. Then observe if the problem occurs when contacts close or open. If it is when they close, you can almost certainly concentrate on induced voltage and ground shift. But, remember that bouncing may also include arcing. It is only when you find the problem also when opening the contacts that you can expect arcing and need to appy snubbers or an MOV.

If the problem is there when contacts close but not when they open, try to reduce load and see if the problem goes away. If it does, you can be sure that the inrush is the problem. Then you can cut the traces you have on the PCB and substitute Heavy gague wire that you route far away from any spot that might be sensitive. You can also try and "desensitize" the circuits that seem to be picking up interference.

You may also have a problem with the relay coils, but you do have clamping/free-wheeling diodes on them, don't you? So I don't see a problem there - unless something is terribly wrong with your power supply. If the voltage regulator is sluggish, you may have a Vcc drop when the relay kicks in. Have you checked that?

One thing that I hope that you have enough of is decoupling capacitors. Enough of them, of the right size and in the right places. You do have that?

This is not a complete Cook-book on how to track down and eliminate problems with switching on a PCB. But it is a good start, and I think that you will find your own way of doing it once you start to Divide and Conquer. Good luck!

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

Try moving C16 and C23 next to the processor and add a pull up resistor (also next to the processor) to all three buttons. The built in pull up is kinda weak and having the cap next to the button makes the trace prone to induced voltages on the processor end.

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
@badservo:

will try the external pullup, fixing C16 and C23 on my current PCB is a nightmare. Not sure can do that.

@Gunnar:

Find the REAL reason for the problems instead of assuming

Thanks for the list. yes, that is my quest.

1) influences from heavy currents causing ground shifts and induced voltages in unexpected places
I can rule that out because the button was never triggered on a high load being switched on. I have dozens of these in my data logs without any trigger. Only if the relay is switched it happens.

2) Then observe if the problem occurs when contacts close or open
The nature of the DTDP relay is that it does always both: one side is opened and the other closed. So I have no way finding that out except for a high speed cam recording the contacts.

3) you can cut the traces you have on the PCB and substitute Heavy gauge wire
That will be my very last resort

4) You may also have a problem with the relay coils
I have a clamping/free-wheeling diode in there but I have not tested switching the relay with 120V but no load over a longer period.
The relay is not driven by 5Vcc but from a separate 24V supply

5) I hope that you have enough of is decoupling capacitors
All input ports on the Arduino have a 0.1uF on them - I think decoupling is good.

RE: Relay EMI is triggering sensors on custom Arduino PCB

Markus

Re. 2: I am a bit disappointed now. Some own thinking may lead you to the conclusion that it is possible to disconnect one of the loads. Then you can do the necessary observations.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

He is using the internal microprocessor pullup. If he used a pullup resistor of 330-1200 ohms, that load may be enough to dampen the noise. This assumes that he is using real switches. Anyone else have an opinion on internal pullups?

RE: Relay EMI is triggering sensors on custom Arduino PCB

I'm too lazy to (re)read the entire thread at this point... can you restate the question/concern about internal pullups?

Dan - Owner
http://www.Hi-TecDesigns.com

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
Hi All,

I was pulled into other things so this last test too me a while to finish. I am now using 470 Ohm resistors to do an external pull-up. I measured the ATmega2560 pull-up which is only bringing the line up to 4.75 volts - that was a surprise to me. Now with the external two pull-ups I don't get phantom button presses any more. Thanks for all your input!

One question now remains: should I have a snubber to protect the relay contacts or is that is more a 'nice-to have' feature than a real requirement. What is your experience and best practices?

Markus

RE: Relay EMI is triggering sensors on custom Arduino PCB

Since the relay contacts still produce interference, but not enough to disturb the inputs any more, it seems to be a good thing to have. Or, if you are absolutely sure that the load will be the same all the time, you can go without them.

A side note: The internal pull-up probably brings the voltage to Vcc (5 V), but your volt-meter loads the high-resistance internal pull-up so you measure 4.75 V. That would mean that the internal pull-ups are around multimeter Ri/40, does that make sense?

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

Correction: Ri/20.

Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.

RE: Relay EMI is triggering sensors on custom Arduino PCB

I don't see why the relay is switching any appreciable current when it closes. I took efforts to prevent hot starts with the compressor in my fridge program. They are designed to handle that on occasion, but as a regular occurance it will cause failures. Good to see you tried the resistor idea. I have nothing against internal pullups. Saves adding a resistor pack, but it is about the same as a 10K resistor. Under the wrong conditions, that is like a floating high imp input. LED lamps without an internal ballast have to have an internal parallel load resistor to prevent them ghosting just due to wire capacitance. Load it enough and the noise just doesn't have enough power.

RE: Relay EMI is triggering sensors on custom Arduino PCB

Internal pull-up/-down current is typically on the order of 1-10uA for a good design, give or take. A 470ohm pullup for a 5V supply is needlessly wasteful for a FET-based input... well, it's wasteful for about ANY supply voltage. At the very least, make it a 47k.

Dan - Owner
http://www.Hi-TecDesigns.com

RE: Relay EMI is triggering sensors on custom Arduino PCB

The resistor solution was only to test a theory and it did. The terminating resistor was to place such a high load to noise that it would kill it. Since the switch current is only for a fraction of a second it really doesn't matter. The problem is in the design of this product. The relay should never be switching a load and the inverter should not be turned on by switching the power to it. That is placing 120A on the board and just inviting a disaster. I know he wanted to make this plug and play but nothing about connecting up a fridge will be easy. Most converters of the size needed to run a fridge will have a remote power switch. He should be doing everything possible to keep AC off the board. Let that be the installers responsibility. Technical issues aside, this board just has a lot of fluff. I just don't see this as being a successful product.

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)

Quote (OperaHouse)

Technical issues aside, this board just has a lot of fluff

Can you elaborate what you mean with "fluff"?

RE: Relay EMI is triggering sensors on custom Arduino PCB

I admit I'm only getting gleaning of the operation of the board. It's a refrigerator control. I have been running one for four years and have experienced things that I never thought of at first and I still don't get this board. All I care about is my beer is cold and the milk doesn't smell. Who needs a display. Not a housewife in Sheboygan. This should collect dust and never be seen from again. On mine I have a LED that blinks every 6 seconds. From across the room I can see if there is a problem with the battery or the fridge. The FET's on the board should be lost and have just a dry relay contact. Enough inverters have a remote switch and they are easy enough to add. That is just adding more length of wire, potential connection problems, noise, and limits where you can place the box. At first I thought you had built in a controller. What function are the current sensors? You have external controller for that. I see this little odd transformer on the edge. Hope that is that an AC current sense for the fridge. You shouldn't be switching power in a cycle and you should be verifying that you are actually powering the fridge. I power mine directly from the inverter terminals and sense voltage there. I added a slump detector to the program. That gives the best test of the battery system. In four years that has alerted me to battery and connection problems. What does the transformer do? That only adds problems, cost. Just like having the relay on the board. It is all just too gadgetry. At some point you will have to have peer review ao at least face the market.

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
Thanks a lot for your explanations!
First of all: it is not a refrigerator control - it is a modular UPS controller. I am using it to take my fridge off the grid during sunshine but it also powers my stereo, TV, phone chargers, laptop and internet modem. I need the transformers to monitor the phase of the AC inputs so switching the relay is only happening when in sync. The bigger transformer also powers the relay and provides power to the inverter when the UPS is in standby. The sensors are monitoring the energy flow. Main aspect is to know the SOC of the battery and switch back to mains power if a certain threshold is passed.

-'The FET's on the board should be lost and have just a dry relay contact'
You can use a relay and my original design indeed used a relay but that actually destroyed some inverters I tested with. Especially the pure sine inverters are very sensitive to that. With mosfets you can control the inrush and avoid another spark.

-'Enough inverters have a remote switch and they are easy enough to add'
this is a problem because in-fact very little inverters have remote switching. I looked at dozens of models and only the very high-end have them.

What is a "slump detector"?

RE: Relay EMI is triggering sensors on custom Arduino PCB

Think of it as a battery tester. Many that put a load on the battery of 60-100A. A refrigerator or other motor device through an inverter places that same kind of load on a battery each time the device turns on for a second or two. My detector software looks for this drop in voltage, stores it, and compares it to a set value. With my fridge, 120A is a good stress on the wiring and battery. Over several years it has found a weak battery and loose connections. Just a good overall test that is done several times a day. Beats waiting for the inverter to go into low voltage lockout.

RE: Relay EMI is triggering sensors on custom Arduino PCB

(OP)
I have measured the same turn on surge but I measured 0.5s for its durations (I do 30 samples per second).

Can you tell more about which measurements point to a weak battery or loose connection?

RE: Relay EMI is triggering sensors on custom Arduino PCB

That would depend on each setup. Many inverters select 10.5V because they anticipate very large losses in cables. My system uses one good car battery from the pickup I leave at home for the summer. I have two other batteries that should be able to run it when I use the main on the boat. Last year they were all identical so I put tags on them (after forgetting which was which). Ran the system on each one individually for three surges and marked down the slump voltage. Think some got to 11.18V when charger removed.

"monitor the phase of the AC inputs so switching the relay is only happening when in sync.
Many would think that is reasonable." Some do not think I am reasonable.

"original design indeed used a relay but that actually destroyed some inverters I tested with."
"Sometimes people blow up from natural causes." Repo Man.

"Seeing and believing are often both wrong." FOW.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close