https://www.luisllamas.es/arduino-optoacoplador/
Isolated inputs and outputs with Arduino and optocoupler