I have a project that involves a serial communication interface, that is isolated with a 6N136 optocoupler, at a relatively high speed, but well below the maximum of 1Mbaud for this optocoupler. The biggest problem is the varying supply voltage, between 1,8V and 4,5V. In that case it is impossible to choose a proper resistor for the LED, because the current will be either too low for low voltages or too high for high voltages. I experimentally determined the minimum LED current at around 4mA.
Several problems overlap in such a case, because the LED is driven at a relatively high frequency, and the minimum voltage is close to the forward drop of the LED (the Lite-on version of the 6N136 features a maximum Vf of 1.7V).
Does anyone have a simple idea of how to drive such an LED with a current that fits between the 4mA and 25mA with varying voltage? Some simple current source maybe?