
Optocouplers
Optocouplers are great for tinkering. They enable you to control one circuit from another circuit when there is no electronic connection between the two circuits.
How do optocouplers do this?
When power and ground are applied to legs 1 & 2 of the optocoupler, legs 4 & 5 close a circuit between them. This is done using an LED (light emitting diode) and a light sensor that both sit inside the chip. When legs 1 & 2 receive power the LED emits light; the light sensor detects this and closes the circuit between legs 4 & 5.
In the picture on the top you can see the optocoupler in its two states - without and with power to pins 1 and 2.