I believe R1 should go to ground, not the opto input. To avoid current through the opto during "off" time.

The opto has a 35 volt limit. You're going to have to use an external transistor to survive that voltage.

Click to expand...

Circuit doesn't work with R1 to ground..
and really SGTWookie did this (almost) for me for a very similar project.. He just had an LED instead of a true zener diode and it was pulling high versus pulling low before

Opto--You pulled the LTV817 datasheet..I'm using LTV816 with an 80V limit. and actually the transistor side of the opto is 5V (Vcc not Vin) so 80V is plenty and the 817 would work just fine too..