120/240V to logic level optoisolator (with schematic)