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.
microcontroller
relay
opto-isolator
Cybergibbons
la source
la source
Réponses:
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.la source
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:
la source
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.
la source
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.
la source
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.
la source
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.
la source
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.
la source
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
la source