Author Topic: How to properly use a relay?  (Read 3702 times)

0 Members and 1 Guest are viewing this topic.

Offline ElectabuzzTopic starter

  • Newbie
  • Posts: 7
  • Country: 00
How to properly use a relay?
« on: August 02, 2020, 09:51:54 am »
Hey, really new to the game for electronics, looking for help with a simple circuit with a relay.

I need a relay to be operated by a rocker switch. The power going to both the coil and the output of the relay should come from the same 24V DC power source.

My relay: https://www.te.com/usa-en/product-6-1419128-6.html
My switch: https://docs.rs-online.com/77e1/0900766b815875bb.pdf

Reading up on relays, it seems I might want a diode in my circuit in parallel with the relay coil? It’s use would be to discharge the coil when turned off, without causing voltage spikes/arcing/damage to the switch. Necessary, yes, no? How do I know the kind of diode I need and the rating that it should have?

« Last Edit: August 05, 2020, 06:40:12 am by Electabuzz »
 

Online Vovk_Z

  • Super Contributor
  • ***
  • Posts: 1419
  • Country: ua
Re: How to properly use a relay?
« Reply #1 on: August 02, 2020, 10:12:18 am »
Yes, at low switching speeds you need a diode.
« Last Edit: August 03, 2020, 07:47:57 pm by Vovk_Z »
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8178
  • Country: fi
Re: How to properly use a relay?
« Reply #2 on: August 02, 2020, 01:03:59 pm »
Sadly but this is one of those more complex matters.

As a rule of thumb, despite all Internet advice, you almost never want a diode; it may work, but if you don't analyse it, it's just a cheap-ass solution which either makes things better or worse depending on case.

The original issue the diode is trying to solve is that once the switch controlling the relay coil goes open, the energy stored in the coil inductance needs to be released one way or the other. With no other components, a large voltage spike is released quickly, coupling into all nearby stray capacitances and whatnot. The relay opens quickly, but now the voltage spike may damage whatever is driving the coil; usually a transistor, but in your case, a smaller mechanical switch.

Now, if you add a diode parallel to the relay coil, when you turn off the current supplying the relay, the stored energy continues circulating in the relay coil through that diode: the coil current slowly decays, until it runs out. No voltage spike generated (the diode limits the voltage the coil can generate to about 0.7V), but now the relay coil is releasing the contacts slowly, so now the relay contacts arc! You have just moved the problem elsewhere.

The usual "good" solution to the problem is to use a transient voltage suppressor diode, or even a simply parallel resistor, or the diode with resistor in series. This allows you to limit the voltage spike to any arbitrary value of your choice, not necessarily 0.7V like with a simple diode. For example, if you use a transistor rated for 50V to drive the coil, you would want to limit the spike to, say, 25V for some margin. If you use a mechanical switch, you could limit the spike to, say, 100V.

Now, this better spike limiter circuit not limiting the spike to 0.7V, but, say, 70V instead, it will be absorbing 100 times more energy (with the same coil current flowing through). The coil is discharged faster, and the relay lets go almost as quickly as it did without any protection components originally. Good for both the thing driving the relay coil, and the relay contacts as well!  :-+
« Last Edit: August 02, 2020, 01:08:05 pm by Siwastaja »
 
The following users thanked this post: Ian.M, newbrain, Vovk_Z

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7954
  • Country: us
  • Retired, now restoring antique test equipment
Re: How to properly use a relay?
« Reply #3 on: August 02, 2020, 08:11:11 pm »
How long does it take for the current in a normal small DC relay coil to fall below "dropout" current when discharging through an external diode, compared with the mechanical time it takes for the armature to open the contact? 
Since a bad experience 35 years ago with a small 24 V coil signal relay switching the input to an op amp, with the coil connected through a switch and the appropriate series resistor to the +/- 15 V rails (without diode), where I found that flipping the relay a few times (less than six, if I remember properly) would kill the op amp (dead), but adding an 1N914 across the coil gave years of contented operation, I have always followed the conventional wisdom on DC-coil relays and added the diode.
« Last Edit: August 02, 2020, 08:15:27 pm by TimFox »
 

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 3721
  • Country: us
Re: How to properly use a relay?
« Reply #4 on: August 02, 2020, 08:28:02 pm »
It depends on the coil.  One easy comparison is that the ratio of operating voltage to diode Vf is roughly the ratio between closing and opening speed.  So a 5 V relay coil will open faster with just a diode than an otherwise similar relay with a 24V coil.
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7954
  • Country: us
  • Retired, now restoring antique test equipment
Re: How to properly use a relay?
« Reply #5 on: August 02, 2020, 08:41:29 pm »
Another question is proper protection and arc suppression on the contacts.  My reading leads me to believe there is no good answer for AC.  On DC, one can put a capacitor across the contacts to slow down the voltage increase after the contacts open, but on AC the capacitor conducts current when the contacts are open, which may be unsuitable for the application.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: How to properly use a relay?
« Reply #6 on: August 02, 2020, 10:06:55 pm »
Hey, really new to the game for electronics, looking for help with a simple circuit with a relay.

I need a relay to be operated by a rocker switch. The power going to both the coil and the output of the relay should come from the same 24V power source.

My relay: https://www.te.com/usa-en/product-6-1419128-6.html
My switch: https://docs.rs-online.com/77e1/0900766b815875bb.pdf

Reading up on relays, it seems I might want a diode in my circuit in parallel with the relay coil? It’s use would be to discharge the coil when turned off, without causing voltage spikes/arcing/damage to the switch. Necessary, yes, no? How do I know the kind of diode I need and the rating that it should have?

(Attachment Link)
You don't need a diode. The switch is rated to 3A and the relay coil takes just under 20mA, so the switch will be able to absorb the back-EMF created by the coil with no problem.
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7954
  • Country: us
  • Retired, now restoring antique test equipment
Re: How to properly use a relay?
« Reply #7 on: August 02, 2020, 10:13:32 pm »
That circuit is essentially the same as the one I described above, except that I had a resistor in series with the switch and the coil.  The back-emf still put enough garbage into the +/- 15 V rails to damage the IC on the same rails (but not the toggle switch) until I added the diode across the coil.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: How to properly use a relay?
« Reply #8 on: August 03, 2020, 04:20:54 pm »
That circuit is essentially the same as the one I described above, except that I had a resistor in series with the switch and the coil.  The back-emf still put enough garbage into the +/- 15 V rails to damage the IC on the same rails (but not the toggle switch) until I added the diode across the coil.
How much current did the coil take?

Unless it was a huge relay, it seems odd that would kill an IC, by injecting crap into the power supply rail, assuming it was properly decoupled.
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7954
  • Country: us
  • Retired, now restoring antique test equipment
Re: How to properly use a relay?
« Reply #9 on: August 03, 2020, 04:33:02 pm »
This was 35 years ago:  it was an open-armature, ceramic-insulated, signal relay with a 24 V DC coil.  There was the usual collection of decoupling capacitors on the +/-15 V rails.  I would guess that the coil current was 10 mA (based on modern relays, which are rarely open-armature), so I probably had 820 ohms in series with the miniature toggle switch.  The circuit was a low-current ammeter with lowest full-scale maybe 10-8 A (feedback by Victoreen glass-encased resistors on a ceramic rotary switch).
I also thought it odd, but after replacing the Intersil 8007 op amp (of fond memory) a few times (luckily, it was in a socket), I added the diode and the rest is history.  Since the circuit was floating (inside a floating enclosure), there was serious protection (spark gap and appropriate diodes) between the inverting input and circuit common (connected to the enclosure).  The relay was used to short the input, so that the offset voltage and bias current (through another Victoreen resistor) could be nulled separately.
The OP was concerned about protecting the switch, but sometimes other things need protection from inductive kicks.  Your concern is about relay contact arcing.  Of course, there was no concern in my circuit about relay contact arcing in a very high impedance node.
« Last Edit: August 03, 2020, 04:53:17 pm by TimFox »
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11561
  • Country: ch
Re: How to properly use a relay?
« Reply #10 on: August 03, 2020, 05:28:43 pm »
Another question is proper protection and arc suppression on the contacts.  My reading leads me to believe there is no good answer for AC.  On DC, one can put a capacitor across the contacts to slow down the voltage increase after the contacts open, but on AC the capacitor conducts current when the contacts are open, which may be unsuitable for the application.
I thought that AC is far less demanding of contacts, since the arc self-extinguishes twice per cycle when it crosses the zero point.
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7954
  • Country: us
  • Retired, now restoring antique test equipment
Re: How to properly use a relay?
« Reply #11 on: August 03, 2020, 05:45:37 pm »
Yes, but the circuit requirements are different for AC and DC.
 

Online bdunham7

  • Super Contributor
  • ***
  • Posts: 7860
  • Country: us
Re: How to properly use a relay?
« Reply #12 on: August 03, 2020, 06:00:25 pm »
but now the relay coil is releasing the contacts slowly, so now the relay contacts arc!

That's going to be highly dependent on the relay design specifics.  The relay will not even start to move until the current drops below the hold-in threshold, and on a typical design, as soon as any gap opens up between the coil armature and the contact lever, the magnetic force will drop quite quickly.  I'm not saying what you propose, or have seen, doesn't or can't happen, but delaying the release of the relay is not the same thing as slowing the rate of the release.  For high-power applications or those where relay life is paramount, I suppose some testing of this is in order. 

Have you had an application where relay life was shortened by a diode clamp?  A lot of automotive applications (the only ones I have much experience with) have the diode built into the relay.
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7954
  • Country: us
  • Retired, now restoring antique test equipment
Re: How to properly use a relay?
« Reply #13 on: August 03, 2020, 06:50:10 pm »
Not directly related to the original question, but involving coil diodes.
Many DIP reed relays include a diode across the coil, but the DPST versions often have a pinout that can work when the part is inserted backwards (rotated 180 deg), except for the direction of the diode.
I was repairing an -hp- 8013B pulse generator that had erratic output levels.  The generator has two switched current sources (one positive and one negative) with independent amplitude controls, and a single switch to insert a 50 ohm internal load on both outputs.  I bought a replacement DPST reed relay, and found that the original had been installed backwards, giving erratic operation when the coil was energized.  There was no sign of previous work to the PCB, so it must have slipped past factory QA, or that the original was supposed to be the version without relay.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16620
  • Country: us
  • DavidH
Re: How to properly use a relay?
« Reply #14 on: August 03, 2020, 09:00:41 pm »
The diode needs a current rating better than the current through the coil and a voltage rating greater than the supply voltage, which in practice are trivial requirements.  For small signal relays, it is common to use a switching diode like a 1N4148.  Larger relays might use a 1N4001 series diode.

As a practical matter, the slowing of turn-off is almost never a consideration but Siwastaja pointed out alternative networks which allow the flyback voltage to be higher discharging the magnetic field more quickly.

Another question is proper protection and arc suppression on the contacts.  My reading leads me to believe there is no good answer for AC.  On DC, one can put a capacitor across the contacts to slow down the voltage increase after the contacts open, but on AC the capacitor conducts current when the contacts are open, which may be unsuitable for the application.

There is no good answer for AC because the network causes leakage which may be undesirable where safety is required.  This comes up on SSRs and thyristor switches as well where it just has to be lived with.

The snubber somewhat depends on how much energy the typically inductive load returns but the typically worst case is pretty consistent for a given voltage and current.  Look at old application notes for the requirements and calculations.

 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7954
  • Country: us
  • Retired, now restoring antique test equipment
Re: How to properly use a relay?
« Reply #15 on: August 03, 2020, 09:51:26 pm »
When portable voltmeters changed from Simpson 260s to DMMs, many were confused because the switch or relay controlling the outlet or whatever had a capacitor across the contacts, which then showed almost full voltage into a 10 megohm load.  Some DMMs now have a low-Z mode for that reason.  0.1 uF from 120 V, 60 Hz gives almost 120 V into a 10 megohm load.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: How to properly use a relay?
« Reply #16 on: August 03, 2020, 10:14:27 pm »
How about a capacitive snubber, rather than a diode? A capacitor, say 1µF and a 1k resistor in series, in parallel with either the relay or switch will help.
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7954
  • Country: us
  • Retired, now restoring antique test equipment
Re: How to properly use a relay?
« Reply #17 on: August 03, 2020, 10:28:42 pm »
For a DC relay, I prefer the diode across the coil.  Series R-C can be used to snub an AC coil or DC contacts.  AC contacts are the messy case.
 

Online bdunham7

  • Super Contributor
  • ***
  • Posts: 7860
  • Country: us
Re: How to properly use a relay?
« Reply #18 on: August 03, 2020, 11:00:31 pm »
For a DC relay, I prefer the diode across the coil.  Series R-C can be used to snub an AC coil or DC contacts.  AC contacts are the messy case.

For severe spikes from inductive loads, gas discharge tubes do the trick.  High discharge voltage, but no leakage when off.
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8178
  • Country: fi
Re: How to properly use a relay?
« Reply #19 on: August 04, 2020, 06:28:15 am »
That's going to be highly dependent on the relay design specifics.  The relay will not even start to move until the current drops below the hold-in threshold, and on a typical design, as soon as any gap opens up between the coil armature and the contact lever, the magnetic force will drop quite quickly.  I'm not saying what you propose, or have seen, doesn't or can't happen, but delaying the release of the relay is not the same thing as slowing the rate of the release.  For high-power applications or those where relay life is paramount, I suppose some testing of this is in order. 

Have you had an application where relay life was shortened by a diode clamp?  A lot of automotive applications (the only ones I have much experience with) have the diode built into the relay.

Really, do some homework; this is a really widely discussed and well known matter!

The laziness of "just putting the diode there because it has always worked for me" then requiring evidence for suggesting otherwise while you can find a lot of literature from this is just, well, lazy. Do note I said it's a complex matter where the diode may or may not work, not that it never works. It is a very typical solution; and also a typical design failure. I'm not going to write a book about it for you in a forum post, I already provided far more than the minimum amount of information so you can research for more details including when this does matter and when this does not matter.

Even for a beginner, it's good to know that issues may arise with the diode. Knowledge of something being more complex than it first appears, even if ignoring that issue for time being, prevents surprises like working decades with such circuits, then hear from a younger engineer about the problem for the first time, being unable to believe it exists.

A lot of automotive relays use simple parallel resistor, you can usually order them without coil suppressors, a diode, or a resistor. A simple resistor is fine when the extra power dissipation is not a problem, and it's a cheap single-component solution.

And yes, I have personally seen burned contacts where diodes have been used to suppress the coil. I can't prove they would have last longer with better coil snubbing, but I don't have to, it's a phenomenon which has been widely discussed and researched.

As a practical matter, the slowing of turn-off is almost never a consideration

It's "almost never" a consideration because of laziness, trusting the luck factor, and doing what everybody "just does". Unsurprisingly, engineers have deadlines to meet as well and as a result, products do fail. Relay contact arcing and either increased contact resistance, or welding permanently-on, are quite common failure modes. The reasons are, substandard relay quality, choosing an improper relay for the load, failure to snub the contacts, or failure to snub the coil. Likely, in some % of the cases, the reason is the last one with the lazy choice of using a diode.

Yet, once you accept that other solutions than the diode exist (i.e., letting go of the confirmation bias), you start seeing those solutions being actually used.


Quick Google result of a typical appnote discussing this showing actual circuit measurement results:
https://www.te.com/commerce/DocumentDelivery/DDEController?Action=srchrtrv&DocNm=13C3264_AppNote&DocType=CS&DocLang=EN
« Last Edit: August 04, 2020, 07:46:01 am by Siwastaja »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: How to properly use a relay?
« Reply #20 on: August 04, 2020, 09:39:07 am »
Yes it's true a diode shortens relay contact life. How much, depends on what it's switching and the relay. If it is always a really bad idea, then you wouldn't be able to buy a relay with a built-in diode, as in the example linked below:

https://www.digikey.com/product-detail/en/te-connectivity-potter-brumfield-relays/1432790-1/PB682-ND/807759
https://www.te.com/commerce/DocumentDelivery/DDEController?Action=srchrtrv&DocNm=1432790-1&DocType=Customer+Drawing&DocLang=English

Note that the release time is 13ms, is only a little longer than the operate time of 10ms. Hardly a big deal.

Another alternative to a flyback diode or RC network, is a zener diode connected across the switch.
 

Offline Unixon

  • Frequent Contributor
  • **
  • Posts: 398
Re: How to properly use a relay?
« Reply #21 on: August 04, 2020, 10:33:09 am »
I need a relay to be operated by a rocker switch.
Then you don't have to worry about mostly anything. At this low operating current even a diode or a TVS is not really necessary, but you may fit them in just for confidence.

If a relay would be operated by a complex and sensitive circuit like say MCU-based, then you wold have to worry about many things.
Coil release voltage spike suppression: a diode + a resistor + a zener diode in reverse to first diode + TVS on the power rail.
Arc noise suppression coupled into coil circuit: LC filter on the power rail before relay power bus + same on control lines.
However it is better to prevent arcing than suppressing the noise it may produce, suppressing already coupled noise makes circuits ugly.
General interference avoidance: separating current paths, providing stable power for control logic (e.g. powering it through a Schottky diode or ideal diode circuit and a big capacitor so that no current spikes on an upper level power bus would affect normal operation).
 

Offline redgear

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: How to properly use a relay?
« Reply #22 on: August 04, 2020, 12:46:40 pm »
I use a relay to drive a inductive load consuming 7.5A on or off. I have a diode - S1M. Should I be worried about shortening the life of the relay?

What else do I replace it with? A TVS?

Thanks
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7954
  • Country: us
  • Retired, now restoring antique test equipment
Re: How to properly use a relay?
« Reply #23 on: August 04, 2020, 02:57:59 pm »
I don't consider my recommendation to use a diode across a DC relay coil to be lazy. 
There are two questions:  protecting the driving circuit (from back emf) and protecting the relay contacts (against arcing).
Driver:  if driven by a transistor, this is obvious since the voltage kickback is dangerous to the source.  In the case of a toggle switch, which is not likely to be damaged, the diode does not hurt and (as I learned the hard way) there may be other surprising damage on the driving side.
Contacts:  relying on detailed timing of the mechanical action does not seem to be a reliable way to prevent arc damage.  Over time, with changes in spring temper and friction, this will change.  When contact arcing is a potential problem, it should be attacked with arc suppression circuitry at the contacts or load (especially inductive loads).  Since I claim no expertise in this problem, I turned to the literature and application notes when switching power.  One example:  https://www.ia.omron.com/support/faq/answer/36/faq02804/  .  The reason I said that there is no good answer is that there is no best circuit for all applications.
 

Offline ElectabuzzTopic starter

  • Newbie
  • Posts: 7
  • Country: 00
Re: How to properly use a relay?
« Reply #24 on: August 04, 2020, 08:04:34 pm »
Thanks for all the replies! I left out that my 24V circuit is DC. But most of you already figured that.

Reading through all of your replies I'm getting a bit confused by the different proposed solutions and discussion that arised around them ;)

From what I gather, I'm hearing two options to consider: a parallel resistor or a TVS-diode.

Quote from: Siwastaja
The usual "good" solution to the problem is to use a transient voltage suppressor diode, or even a simply parallel resistor, or the diode with resistor in series.

The TVS-diode seems the made for purpose option: "used to protect electronics from voltage spikes induced on connected wires". However, as a complete newbie, it seems quite a complicated solution with different types, behaviour and combination of parameters to figure out.

A lot of automotive relays use simple parallel resistor, you can usually order them without coil suppressors, a diode, or a resistor. A simple resistor is fine when the extra power dissipation is not a problem, and it's a cheap single-component solution.

If just a parallel resistor is reliable enough for automotive applications - and a simple and cheap solution - that seems a logical way to go! What do I base the value of the resistor on though, the resistence of the coil?



..... ..... ..... Should I be worried about shortening the life of the relay?

PS: Hi, although your question is kinda related to mine, I'd figure it's offtopic/specific enough to warrant it's own topic ;)
« Last Edit: August 04, 2020, 09:01:51 pm by Electabuzz »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf