Precise linear optocoupling

It is the same picture as posted one in this thread. Additionally I found out an easy way how to generate a PWM signal using ESP32 that can be adjusted from 1Hz to 10MHz ))
It is perfect to control all kinds of devices. Posted code on other forum