An optocoupler (or optoisolator) is a light-controlled component that is used to electrically isolate two circuits. An illustration and the schematic symbol of an optocoupler are shown here:
Figure 7.6 – Optocoupler symbol and component with pins labeled
The two sides of an optocoupler can be described as follows:
- An input side: The side we will connect to a Raspberry Pi GPIO pin
- An output side: The side we will connect to another circuit
Inside an optocoupler on the input side is an internal LED (you will notice the LED symbol within the optocoupler symbol in Figure 7.6) while on the output side there is a phototransistor that responds to the LED's light. What this means is that the transfer of control (that is, switching) from the input side to the outside side is performed by light, hence, there is no physical electrical connection between the two sides. For us, this means that any failures...