I'm trying to develop a sensor based on the optoelectronic device CNY70. I want to filter the signal in order to be read by a microprocessor, where the threshold to change between logic levels could be adjusted manually using a potentiometer. Then, thinking of an ideal operational amplifier, I came with something like this:
simulate this circuit – Schematic created using CircuitLab
With this single supply construction for the op amp, I would have to get a hysteresis band for the logic level switching of approximately 150mV, centered around the voltage given by the potentiometer on the inverting gate.
I built the real prototype using the op amp L2904N and made some measurements with a voltmeter and an Arduino. The hysteresis band for the Schmitt Trigger configuration works almost perfectly for switching the logic levels, however, those logic levels does not correspond with the supply of the op amp... Ideally, I should get 0V - 5V logic levels, but I'm getting 0V - 3V levels.
So what's the non-ideal thing that is causing this problem? I think it could be related with any maximum output current the op amp can drive, but the datasheet actually does not give any information about output current. What do you think?