Why to use an OptoCoupler?
There are many situations where signals and data need to be transferred from one subsystem to another within a piece of electronics equipment, or from one piece of equipment to another, without making a direct ‘ohmic’ electrical connection. Often this is because the source and destination are (or may be at times) at very different voltage levels, like a microprocessor which is operating from 5V DC but being used to control a triac which is switching 240V AC. In such situations the link between the two must be an isolated one, to protect the microprocessor from over voltage damage.
Problem with Relays
Relays can of course provide this kind of isolation, but even small relays tend to be compared with ICs and many of today’s other miniature circuit components. Because they’re electro-mechanical, relays are also fairly bulkynot as reliable and only capable of relatively low speed operation. Where small size, higher speed and greater reliability are important, a much better alternative is to use an optocoupler. These use a beam of light to transmit the signals or data across an electrical barrier, and achieve excellent isolation.