I intend to use an optocoupler to simulate a push button on a control card (I could measure 5V between pins but I don't know for sure if there is a pullup resistor in the card). Also the other way around, I'd like to "listen" to a 24 V output to detect voltage (and act as a logic gate for my 5 V microcontroller).
Optocoupler looks like a good candidate, as it keeps both circuits isolated.
I know I should limit currents for both the LED and the transistor, but how much? The datasheet tells about the absolute maximum limit (50 mA for both), but I can't find any "recommended" current for things to work nicely.
Basically I'm trying to calculate what the ideal resistors would be, but I don't know what to aim for (2 mA, 20 mA, 50 mA, anything?). I feel like hacking around could just lead to something that will break very soon if I use too much current.
Did I miss something on the datasheet?