That notorious mechanical relay solution
LoopyByteloose
Posts: 12,537
Parallax forums gets lots of traffic from time to time about mechanical relays, but I have found that the answers generally are incomplete.
The problem is that there are TWO sides to a mechanical relays and each side requires special solutions.
On the coil side, you have to provide enough current at the right voltage to get the coil to pull properly AND you have to provide a flyback diode to reduce spikes on the power supply and potential damage to a microcontrollers i/o. All this is well known.
What seems to be less well understood is that the switch side requires a snubber circuit to reduce arcing and to add greatly to the longevity of the switch points.
AC and DC solution for snubber circuits are different.
+++++++++
And yes, I am sure someone will just assert using solid-state relays to avoid all this. But there are situations where they are expensive or not available in the right configuration.
On a DC switch, a diode across the switch in the reversion direction can help a great deal.
On an AC switch, the diode won't work -- there are more involved solutions, often a capacitor with a resistor (something similar to what protected the points in your automotive distributor before that all went solid-state.
Also, the switching side is de-rated according to the type of load that is used as some loads are more inductive and cause greater wear. For instance, a florescent light has a transformer that increases the inductive nature of a load; what an incandescent light does not. Motors are heavily inductive, so they need proper consideration of de-rating ( A 10 amp rated switch might only be useful for a 2 amp or 4 amp motor load).
Industry provides good guidelines, but new users tend not to be aware of them or able to handle the info. Unfortunately, this is engineering and may be ignored by all those artist that take a non-engineering approach to microcontrollers.
In many instances, mechanical relays are still a good choice. They can be smaller, cheaper, and run cool. Yes, they do make noise. 12VDC 30 amp automotive relays are easy to get and can handle hostile environments of temperature extremes and moisture.
http://www.industrologic.com/mechrela.htm
The problem is that there are TWO sides to a mechanical relays and each side requires special solutions.
On the coil side, you have to provide enough current at the right voltage to get the coil to pull properly AND you have to provide a flyback diode to reduce spikes on the power supply and potential damage to a microcontrollers i/o. All this is well known.
What seems to be less well understood is that the switch side requires a snubber circuit to reduce arcing and to add greatly to the longevity of the switch points.
AC and DC solution for snubber circuits are different.
+++++++++
And yes, I am sure someone will just assert using solid-state relays to avoid all this. But there are situations where they are expensive or not available in the right configuration.
On a DC switch, a diode across the switch in the reversion direction can help a great deal.
On an AC switch, the diode won't work -- there are more involved solutions, often a capacitor with a resistor (something similar to what protected the points in your automotive distributor before that all went solid-state.
Also, the switching side is de-rated according to the type of load that is used as some loads are more inductive and cause greater wear. For instance, a florescent light has a transformer that increases the inductive nature of a load; what an incandescent light does not. Motors are heavily inductive, so they need proper consideration of de-rating ( A 10 amp rated switch might only be useful for a 2 amp or 4 amp motor load).
Industry provides good guidelines, but new users tend not to be aware of them or able to handle the info. Unfortunately, this is engineering and may be ignored by all those artist that take a non-engineering approach to microcontrollers.
In many instances, mechanical relays are still a good choice. They can be smaller, cheaper, and run cool. Yes, they do make noise. 12VDC 30 amp automotive relays are easy to get and can handle hostile environments of temperature extremes and moisture.
http://www.industrologic.com/mechrela.htm
Comments
Relay Contact Life...
http://www.aeroelectric.com/Reference_Docs/Tyco/Tyco-Relay_Contact_Life.pdf
@kwinn
There is better information out there. I must admit I was a bit hasty with the link provided and it seems to only explain the AC method of capacitor and resistor.
DC switching get much better performance with the insertion of a high voltage, high amperage diode.
I need to get a better reference, no need to create material from scratch as the industry provides excellent material. The problem is that new learners just don't know about the need for snubbers and derating by use. They tend to buy a tiny relay board and expect that it will last long when driven to both its current and voltage limits without assistance.
Beginners normally want a quick and easy solution without all that "technical" stuff. Don't you know that if a linear regulator says it can handle 1A then it should?? But there must be a fault somewhere as it gets very hot when it's run from 12V even though it's only running at 500ma !!!
There are a lot of dumbed down answers given that try to avoid the "technical" stuff just to get the beginner going, but it doesn't change the fact that this stuff is important. Same with the snubbers and even with the diodes there are variations which take into account the relay release time too which can be prolonged too much by too simple a solution. Real designs take a lot of technical stuff into consideration and even though you can get it going on the bench without all that fluff, it makes a difference in production and long-term reliability.
As for relays, I try to avoid them as much as possible though they are a simple solution for some designs although I've seen that they are actually unnecessary in many industrial implementations, it's just there for the "sparkies" who are likely to wire those contacts to just about anything (along with the sensor inputs to 3-phase) !!!
Even less understood, is the fast-contact-edge effect on modern Logic devices.
Relay vendors do not mention that, as it is not a relay-point failure mode, but tell that to someone whose system 'resets (sometimes) when the relay operates'.
Spice is great here, for getting an idea of the issues involved.
You can safely generate hundreds of volts a nanosecond ( as in a mains relay bouncing ) and factor in some nH of PCB common mode trace, and some femto farads of Relay-Load-cable-Logic node coupling, and Spice will show how many volts of disturbance is possible.
You could have just mentioned me by name!
Nah, that wouldn't be you mate, although you do make them Hot Wheels Spin n Spark!
Just to be on the safe side, I will hide all my sensor inputs from you
https://www.idec.com/language/english/AppNotes/Relays/contact_circuit_protection.pdf
Long may your relay click!
Cheers,
I try to avoid relays as much as possible also, although there are still a few applications where they are a good choice. Emergency stop circuits and latching relays for lighting are two that come to mind.