D4 is redundant in this circuit, unless you accidentally short the input of the opto isolator to the output. It might be a useful protection device if you were not using optical isolation. It is also connected the wrong way round.
Quotethe internal pullup resistor from the arduino active.That pull-up "resistance" is too high and you may not be able to turn off the phototransistor and generate a logic 0.Use a resistor and its value will generally be < 10k.
the internal pullup resistor from the arduino active.
See attached. The diode in parallel with the input side of the optocoupler is needed only if there is a possibility of the polarity of the 60-80V input reversing. Enable the internal pullup on the digital input pin.