Thanks guys.

I never thought about checking the reverse breakdown voltage of the LED, but as Neale has suggested, I can just add a normal diode in series to solve that problem.


It's actually for a buffer for a touch probe, which is the last part I need so I can get the cabinet for my Triac shut and moved off the desk. The probe is designed for 5V at 20mA, and although I could connect it directly to the 24V 4K opto, I want an indicator on the machine. All the LEDs I've looked at are around 20mA, so some form of buffer will be better for long term reliability.
The final circuit will have sockets for two probes (touchprobe + toolsetter), and detection for the touchprobe being plugged in (so I can disable the spindle). This is just the basic bit of the circuit, which I just hit a complete mental block with.