What is the difference between a relay and opto-isolator?

Hi all,

I've looked around a bit and I don't really understand how opto-isolators and relays differ in terms of application (I understand that one uses magnets and one uses light). Can somebody shed some light on the differences, if any?

(P.S Bonus imaginary internet points for creative analogies) 

Optos are vastly faster and use lower currents to work, at the expense of not switching much current directly. Relays are slower (<<20Hz), but can switch very high currents, and can carry extra contacts to tell you what is happening somewhere else.

rickharris3 years ago

A relay is a mechanical switch operated by a solenoid.

An opto Isolator is an electronic device consisting of an LED and a photo transistor to seperate 2 different parts of a circuit - usually for voltage protection.

jonrb (author)  rickharris3 years ago

But in terms of how they're used, are they interchangeable in a circuit (Here I'm assuming the circuit doesn't contain anything that is sensitive to EMF)?