Electronic – Help with using 4N25 optoisolator

opto-isolator

I'm using an open collector comparator LM339, and I want to isolate V2 from the circuit by a 4N25 optoisolator. I want V(out) to change its state from at least around 1V or less up to 10V. But I get the following result in LTspice IV where Vout swings between 8.5V to 10V:
enter image description here

I cannot change R8, and I want LED to blink for every pulse. I might be using the coupler wrong way. I also noticed R7 also have big effect on the coupler; if I set it to 10k it doesn't work at all.

How can I modify this circuit so that Vout can swing more(from around 1V to 10V) and LED blinks?

Edit:

Suggestion from a comment:

enter image description here

EDIT 2:

enter image description here

Best Answer

As others suggested and you've changed your schematic to get rid of the LED in the output ....here's a simple modification that should provide your required output voltage swing.

Choose an appropriate PNP to sink your required current:

schematic

simulate this circuit – Schematic created using CircuitLab

You could also use a FET to achieve the same result.