Electronic – Relay control by using microcontroller

microcontrolleropto-isolatorrelay

I'm working on a I/O module to control AC, DC motor and lamps by using relays. But I don't know how to control the relays. Some says I should use optocoupler, some says transistor array.

I found an optocoupler TLP280, in the figure there is the schematic. Can I use it by supplying 3.3V to control 24V dc motor and some lambs.

enter image description here

Best Answer

Relay contacts create quite a bit of noise when they switch, particularly if the load has a lot of inductance (such as a motor, or even because of long wires that are not close to each other), so the opto-isolator can be a good idea, because it prevents the noise from being coupled back to the ground of the power supply used for your logic. If you use a transistor array (and a catch diode across the relay coil) you will probably have no trouble at all driving the relay coil, but you may have issues when the loads are connected.

For this to be valuable, the relay supply should be isolated from the logic supply, say another 12V supply.

You will need a series resistor to control the LED current (your optocoupler has AC input capability, so one of the LEDs will be unused). The CTR is as low as 50% depending on rank, so if you drive it with 5mA the output current might only be 2.5mA (allow perhaps 1mA to allow for temperature and aging effects) so you would need some kind of additional driver for most relays. Suppose you follow the optocoupler with a ULN2003 darlington array, then you can switch substantial relays, and the catch diodes are included.