Pourquoi les relais sont-ils si souvent pilotés par des optocoupleurs?

38

Depuis l'avènement de nombreuses cartes de développement de microcontrôleurs, telles qu'Arduino, de nombreux modules de relais ont été vendus pour piloter des charges secteur.

Beaucoup d’entre eux semblent utiliser un optocoupleur, un transistor de commande et un relais pour piloter la charge (exemple sur Amazon )

Pourquoi sont-ils mis en œuvre comme ça?

Certaines de mes pensées:

  • Les relais fournissent une isolation aussi bonne ou meilleure que la plupart des optocoupleurs
  • Il y a toujours un transistor de commande présent, donc ce n'est pas une sauvegarde de composant
  • Il y a toujours une protection inductive contre les retours en arrière, donc ce n'est pas une sauvegarde de composant
  • Les optocoupleurs ne sont pas aussi économiques que les transistors, donc un coût supplémentaire par rapport à un transistor conducteur
  • Il n'est pas nécessaire de respecter les exigences réglementaires car il s'agit de produits de bricolage
  • Je n'ai jamais vu de petits relais de réseau entraînés par des optocoupleurs dans des équipements commerciaux
  • Un certain nombre de ces cartes ne semblent pas être conçues de manière brillante (sans tenir compte de l'espacement ou de la ligne de fuite), donc même si l'optocoupleur doit simplement fournir deux couches d'isolation, la carte échoue.
Cybergibbons
la source
8
Conception de cargaison culte? Peut-être que les concepteurs copient les schémas les uns des autres sans trop y penser. Comme vous l'avez dit vous-même, ils ne semblent pas bien conçus en général.
AndrejaKo
16A@250V is a lot of power and it does seem that the design is pretty naive on a lot of these.
Cybergibbons
Currently, a combination of Kaz and The Photon's answers seem most plausible. Industrial controls could be improved by use of optocouplers, and these hobbyist boards have likely cloned them.
Cybergibbons

Réponses:

16

First, a possibly more permanent link to this product is here. And the schematic is here. (Edit 7/29/2015: Ironically my two links are now broken and OP's Amazon link is still useful)

Two reasons it makes sense to use optoisolators here:

  • The controlling device might be very far away so that it doesn't share a common ground reference with the relay board (except as connected through a long cable). Using the optoisolator means the control signal is used purely as a differential signal between Vcc and the control signal, both sourced from the controller circuit; ground potential differences won't affect the operation.

  • The relay coil voltage is not necessarily the same as the controller's Vcc. It could even be generated by an off-line (unisolated) supply. The optoisolator then provides isolation between the potentially unisolated JD-VCC supply and the controller circuits.

The Photon
la source
Slightly off topic These exactly same modules go for $2.25 (maybe even less) so the $7.99 link is a bad price. ledsee.com/index.php/arduino-modules2013-02-16-10-32-17/…
jippie
I think these are both very valid reasons when needed, and are why most industrial control system inputs will be optoisolated. But my gut feeling is that they sound like rare use cases, especially for hobbyist boards that are <$50.
Cybergibbons
1
@Cybergibbons, I admit the 2nd one is kind of a stretch. But I think the first would be pretty common...Also I imagine these boards weren't originally designed just to work with Arduinos --- that's just a market they found where they can sell a lot of them --- they could also be used in general industrial controls, etc.
The Photon
1
And in industrial controls you might a have a ground-loop or induced transient problem with a much shorter cable length due to big switching loads etc in the environment.
The Photon
1
@DwayneReid, maybe if you choose the right opto. But generally a transistor is cheaper than an optocoupler, and a low cost optocoupler is likely to have a CTR less than 1.0.
The Photon
12

Probably a number or reasons, but the most important being that it will prevent transient voltage from damaging the driving transistor. And depending on the application, it will help prevent AC noise from interfering in the rest of the circuit.

You bring up some good points, however optocouplers are commonly used to isolate components from potentially dangerous outside sources. They are cheap and simple to implement. And they can potentially offer more protection than a diode. And of course, as you pointed out:

A number of these boards don't seem to be designed brilliantly (no regard to clearance or creepage), so even if the optocoupler is simply to provide two layers of isolation, the board fails at this.

Garrett Fogerlie
la source
Wouldn't a flyback diode be a cheaper way to prevent the transient back EMF damaging the transistor?
Rocketmagnet
I think Garrett means from the input side, which I hadn't considered. Most optocouplers can take a wide range of inputs.
Cybergibbons
2
@Rocketmagnet: The speed at which a relay can switch off will be a function of the amount of reverse voltage that is allowed to appear across it. Using a simple diode across a relay may be effective from a protection standpoint, but will cause the relay to behave "sluggishly".
supercat
6

I suspect a big part of the reason has to do with the idea that if there are two isolation barriers, there will continue to be an isolation barrier even if one is accidentally or intentionally bridged. When working with circuits, especially if one is a klutz, one may sometimes briefly short things which really shouldn't be shorted (e.g. because a scope ground clip decides to come undone and flail itself across the board). Adding an extra layer of isolation reduces the likelihood that such an accident will cause significant damage to anything. Most mass-produced products will never be on anyone's workbench, much less a workbench belonging to a klutz, but many home-brew products will spend a great deal of time on such workbenches. Further, home-brew boards are often made without solder mask, greatly increasing the likelihood that of stray ground clip or probe making an unwanted contact.

In addition to providing protection against accidental bridging, if there are two full isolation barriers it may be possible (if one is careful) to bridge one while doing diagnostics involving the other while maintaining an isolation barrier between the two main parts of the system. For example, if one wants to determine the amount of time that elapses between the processor setting an output and a solenoid receiving power, one could start by confirming the relay-coil ground and contact-side ground were isolated, bridging the relay ground and CPU ground, and measuring the time between the CPU output and the relay coil. One could then isolate the relay-coil ground and CPU ground and--after double-checking that they really were isolated, bridge the relay-coil ground and contact-side ground and measure timings between the coil and the things they control. Performing such measurements in a system with only single isolation would probably require having a scope with two probes that were isolated from each other. Such rigs exist, but they're generally expensive.

supercat
la source
4

Relays actually provide rather poor AC isolation to a VERY noisy source of disturbances- a mechanical contact switching arcing as it switches a load that is inevitably more or less inductive, and often at mains voltage, with dv/dt that can be hundreds of volts per microsecond.

Cheap small relays typically are particularly bad, and making them better tends to make the relay more expensive, bigger and less efficient.

Circuits with multiple inputs and outputs are particularly prone.

When properly employed, an opto can help prevent disturbances caused through coil-contact coupling from affecting circuits.


There is no shortage of examples in this forum of grief from this source (relay plus random resets when loads are switched, for example), and plenty of examples of good robust appliance and industrial designs where optos are used in conjunction with relays.

Spehro Pefhany
la source
2

A very good reason is to have separate power supplies for the logic and the power interface parts. Logic section is in normal design powered at 5V or 3.3V, and galvanically isolated from the power section, where the most common supply is 24V, so an optocoupler is necessary.

It is true that it can be avoided using a relay with coil rated for 5V, but many relays are not available with this coils, and it would be necessary to have a much higher power on the 5V side, with a bigger DC/DC converter.

It is more common to use the field unregulated supply, 12V or 24V, automotive or industrial (relays do not need a very precise voltage), and a small galvanically isolated DC/DC converter to derive the 5V / 3.3V for just the logic section, so the isolated couplers are necessary.

user3654534
la source
There are loads, upon loads of 5V relays to be had. Thousands at Mouser alone. Some of your other points are valid enough, but that paragraph is unnecessary hyperbole.
Asmyldof
2

I suspect that this is just a case of hobbyists who are trying to start a circuit board selling business. They may be complicating their board simply to make it look more complicated, because complication justifies the existence of electronics and appears to add value.

I'm sure if you contact the vendor, they will have a convincing story that their circuit is how it has to be done, and they have it ready-made, the easiest thing is to just buy their board.

Everything you need to control an AC load with a small voltage and current can be found in a single component: a solid state relay like this one.

Any board that can drive 20 mA into an LED can use this, which means that you don't need a special board.

Kaz
la source
1
I like SSRs a lot. They do have downsides - failure mode is often on, and they have a not-insignificant on resistance.
Cybergibbons
SSR product link is broken
Birla
1
@Birla Looks like the Wayback Machine has a copy; we can band-aid with that a quick fix.
Kaz
0

The most important reason is the coil in the relay is a pretty complex load in the circuit. As we know, a diode is required to protect the circuit from the reverse current inducted from the coil when power off the relay. Some time this method is not enough for a poorly configured power supply, as most DIY modules have. Controllers often get an impulse or even been fired by the relay. I do think if the power supply is robust enough, the optical isolator is not necessary.

yhzyhzyhz
la source
0

when using A relay most time you will wish to separate the mcu digital GND AND VDD from the relay(s) GND and vcc , then you get very clean mcu GND AND VDD lines .....

if a relay give back EMS , high sharp and fast voltage pick and -- NO - flyback diode and tvs protection . the transistor inside the optocoupler will destroy from relay side , so the main resean , is total separation of gnd , power lines.

if the relay is use for AC it can emit EMC to the circuts from the , GND , VCC , so , optocoupler will solve most of this

Yaniv Maor
la source
1
Welcome to EE.SE. Please fix your formatting.
winny