cmos to optocoupler?

I have attached a schematic

I did try other resistorvalues for R1 without success, but i will try again.