Electrical – Schmitt Trigger not reaching full saturation

operational-amplifierschmitt-triggersensor

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:

schematic

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?

Best Answer

enter image description here

Output voltage drop vs current sourcing. Source: LM2904 datasheet.

The datasheet explains the answer.

The best you're going to get out of that op-amp is > 1 V less than the positive supply. As you try to pull more current the voltage droops and collapses completely at > 30 mA. With your 220 Ω resistor you're probably hoping for 10 mA. I've marked on the graph that you can expect about 1.5 V drop in output voltage.

So what's the non-ideal thing that is causing this problem?

Output doesn't reach V+.

I think it could be related with any maximum output current the op amp can drive, ...

There are both voltage and current limitations.

... but the datasheet actually does not give any information about output current.

Experience is knowing where to look. You're wiser now!


Update - a possible workaround.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 2. Addition of a pull-up resistor and diode will give the GPIO a further +0.7 V on both high and low conditions.

You need to work out if this would solve the problem.