Much better then how i once had to do this, back in the DOS days:

You Can try and experiment a bit, this schematic should work perfectly, is being used by a lot of Domoticans.I tried increasing the distance between sensor and digits, to no avail. Also the potmeter is adjusted.
Looking at the CNY70 datasheet/application note, the optimal current for the transmitter is between 20-40 mA, though with the 2 resistors of 560 ohm (1120 ohm as they are in series), we only get 4 mA. I think replacing the 2 resistors with one of 180 ohm would help a bit, don't you think?