phototransistor amplifier quirk
Your op-amp is not doing much at all. The RC4558 requires a negative supply voltage of at least -5V. Furthermore, its output voltage cannot swing close to the DC supply rails, requiring a volt or two "overhead". If you intend to use an op-amp, choose one that can work with low supply voltages, and one that has "rail-to-rail" output swing.

Your phototransistor is supplying photo-current through R1 (10K) to the microcontroller input pin. The op-amp is likely acting as a resistance to ground, so that voltage is less than the positive supply voltage.
You might be better off with this circuit:







simulate this circuit &ndash; Schematic created using CircuitLab
Even with a negative supply voltage going to pin 4, your circuit would produce a negative-going output voltage when the photo transistor sees light: not compatible with a microcontroller expecting to see a voltage between 0V and its supply voltage.