An optocoupler is a very useful feedback device. Usually you can find an optocoupler in circuits with a signal transmission between parts of the circuit with different voltages, in switching power supplies, when the output voltage becomes higher than the norm, the optocoupler LED starts to light up, opening up a phototransistor, which in turn covers the primary transistor.
In general, this device appeared a long time ago, then incandescent lamps were used instead of LEDs, the power consumed by them is high, the light output is small, and the frequency with which it can be used is extremely small, since the filament goes into working condition slowly, and it does not go out instantly. Now there is a wide range of optocouplers with varying degrees of integration, with a closed or open optical channel, with many types of photodetectors and a light source, but we are interested in the most common PC817 in discrete design.
The input current is maximum 0.05 A, the maximum pulse can reach up to 1 A, the voltage is typical 1.2 V. The reverse voltage is max 6 V and the power dissipation is up to 70 mW. In a phototransistor, the collector current can reach up to 50 mA, the collector power is 0.15 W, the collector-emitter voltage is 35 V, the collector-emitter is 6 V. At the bottom there is a simple circuit to check the health of your instance.
Cost: ~ 99