The base collector P N junction of the output transistor in a 4N27 class of optocoupler will work as as a photodiode (acting like a solar cell) and will generate a current flow that is approximately ratiometric to the LED current.
The output from the P N junction (base collector) will approximate a current source with it’s output voltage clamped to a maximum of about 580mV by the base collector junction of the photo transistor becoming forward biased by this voltage.
Fig 140522 illustrates this mode of operation, the simulation is easy to setup it LT spice, obviously in the real world the output of the optocoupler can be galvanically isolated from the input, depending on the device chosen this may be up to thousands of volts.
Note: There has to be a ground reference on the output of the optocoupler for the spice simulation to run.
LTspice simulation is very conservative regarding the output current most optocouplers put out more current than the simulation suggests. Below is a chart of some random IC's tested at different LED drive currents, many of the chips were purchased on ebay so some may counterfeit components.
Note: The Fairchild IC with 232 mV output (into 4700 ohms with 10mA LED current) was heated with a soldering iron until it was very hot to touch, its output dropped to 180mV, so derate for temperature and age.
PAGE under construction Aug 2022
The image above (FIG 190822) is of a very simple voltage to current drive, the a optocoupler LED quiescent current is about 12 mA. The actual device was built and tested, R34 was reduced in value to 4.7k. The frequency response in this mode of operation is quite good, <1dB down at 20kHz. A retest with oscillograms will follow soon. Note maximum output as determined by drive a load resistor will be < 550mV peak to peak (192mV RMS) it seems best to target 1/2 of this voltage out. This will not be Hi-Fi, it does however work much better than expected.
end