Electrical – Vout of differential amplifier as Vref of comparator

amplifiercomparatordifferentialoperational-amplifier

schematic

simulate this circuit – Schematic created using CircuitLab

I am a beginner at circuit design, and I am having trouble using the Vout of differential amplifier as Vref of comparator. The other input of comparator is a potentiometer connected to Vcc and ground.

The problem I'm seeing is that, with a fixed voltage value of 2.32 V at the output of LTC1050, when I change the voltage output of the potentiometer, the output of LM358 also changes incrementally (not switching from 0 to Vcc based on which input voltage is larger, as expected of a comparator circuit).

The op-amp comparator (LM358) works as expected when I set Vref to be the voltage divider output of Vcc and ground. What is different about the Vout of differential amplifier? What should I do differently to make it work?

Any help would be greatly appreciated.

In case you want more info: I am trying to convert PWM to DC, amplify it with differential amplifier, and compare it to potentiometer value to drive an h-bridge. I am stuck at the part connecting the differential amplifier and comparator.

Per suggestion, here is a picture of my circuit. The only added part from the circuit diagram is 7.5V of power supply (2A max current) fed into 5V voltage regulator (L7805CV3) to produce 5V supply for all power lines.

enter image description here

Best Answer

The simple answer is: don't use an op amp as a comparator. Especially, don't use an early op amp such as an LM358 as a comparator with a single 5 volt supply. Use a real comparator - if you like oldies, an LM311 will give you much better results.

Your LM358 is not remotely able to drive a high level anywhere near 5 volts. 2 volts is more like it. I suspect this is what you're seeing in your "incremental" level shift.

If you do use an LM311, make sure to connect a pullup resistor from the output to +5.