2
\$\begingroup\$

I have a dual op-amp that I want to use as a comparator: Vin should be compared to Vref (1/2 VCC). This is the circuit that I am using (as I have a dual op-amp, I am using a voltage follower on the divider).

schematic http://iridia.ulb.ac.be/~abrutschy/images/opamp.png

I would expect that if Vin>1.65V, Vout=3.3V (VCC). Otherwise, Vout=0V. Unfortunately, Vout is around 2.2V if Vin>1.65V, which is not sufficient for my µC to detect a clean logic high.

I suspect that I am experiencing an "ideal vs. real-world" op-amp problem, but I am not sure how to resolve it best.

\$\endgroup\$
1

3 Answers 3

10
\$\begingroup\$

You'll need an opamp that can swing up to vcc. Old things like the 358 cannot. It's an inherent limitation of the design.

Look for rail to rail op amps, or better yet, use a proper comparator!

\$\endgroup\$
0
1
\$\begingroup\$

Op-amp's can have unexpected behavior when used this way: ringing, latching. Here's a detailed application note about using op-amps as comparators: http://www.analog.com/static/imported-files/application_notes/AN-849.pdf In short, it's best not to do it.

\$\endgroup\$
1
  • \$\begingroup\$ That is a very good reference indeed. (Title is Using Op Amps as Comparators, by James Bryant). \$\endgroup\$ Commented Apr 3, 2015 at 11:46
1
\$\begingroup\$

Is your opamp rail-to-rail, like the MCP601? If not, you're not going to get "high" pulling up to AVCC. You can re-buffer this with a separate transistor pair as a quick fix to an existing circuit (and swap the +/- of the inputs,) but that's probably not what you want from a "design" point of view.

Also, make sure your opamp has a gain/bandwidth product sufficient to support the data rate you're transmitting, and set an explicit feedback multiplier, to avoid delay, ringing, and other signal quality issues.

When it comes to "use a comparator instead," I've found the differential gain of comparators to be rather poor. However, a digital buffer, such as a Schmitt trigger, is sometimes a better solution than an analog-domain component such as an opamp.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.