Figure 1
This circuit allows an isolated microcontroller to both sense and control ac power to an externally plugged-in device. The lines in boldface in the schematic are electrically isolated from the signal lines.
back