2
\$\begingroup\$

I've setup a simple circuit with an LM358 configured as a comparator (the ground rail and supply connections are off screen).

Schematic: enter image description here

Breadboard: (in case I wired something wrong) enter image description here

Measured values:

V+ = 4.97V (expected) GND = 0V (expected) In(-) = 2.47V (expected, via voltage divider) In(+) = 4.97V (expected) Output = 3.63V (???)

Here's the pin mapping for your convenience: enter image description here

Since 4.97V is greater than 2.47V I was expecting the output to be 4.97V. Why is it 3.63V? Is this normal for this particular op-amp or am I doing something wrong?

I've tried looking through the datasheet but I'm new to this stuff so I'm not sure what to look for.

\$\endgroup\$
  • 1
    \$\begingroup\$ Delete that horrible protoboard photo and show a proper electronics schematic. All proper electronics starts with a proper schematic. \$\endgroup\$ – Michael Karas May 23 '16 at 1:02
  • \$\begingroup\$ And reading the datasheet. Don't forget reading the datasheet. \$\endgroup\$ – Ignacio Vazquez-Abrams May 23 '16 at 1:06
  • \$\begingroup\$ LM358 is not a comparator, it's an older generation general-purpose op amp. \$\endgroup\$ – MarkU May 23 '16 at 1:06
  • \$\begingroup\$ @MichaelKaras I've updated with a schematic. I included the (horrible) breadboard pic just in case there was something wrong with the way I wired it. \$\endgroup\$ – nebs May 23 '16 at 1:15
  • 1
    \$\begingroup\$ Most high-performance op-amps should not be used as comparators. But older general-purpose ones like LM358 often can. The LM358 datasheet shows a few application circuits and test circuits where negative feedback doesn't maintain equal voltages on the inputs, so you should be okay. \$\endgroup\$ – The Photon May 23 '16 at 1:53
6
\$\begingroup\$

LM358 is not a rail-to-rail output op-amp, so you should not expect it to produce an output near the positive supply voltage.

Unfortunately, the datasheet doesn't go out of its way to make this obvious. The main clues are:

  • Nowhere on the front page does it claim to have rail-to-rail outputs.

  • Figure 10 on page 10: enter image description here

    This shows that if only modest currents are sourced from the output, the maximum output voltage is about 1 V below the upper supply voltage.

Edit: You might also have some issues from not hooking up the second op-amp. It could potentially oscillate and affect the behavior of the op-amp you are using. The typical way to deal with this is simply hook it up as a follower with nothing connected to its output.

\$\endgroup\$
  • \$\begingroup\$ Ah I see, that makes sense now. I will make sure to look out for these kinds of graphs in the future. Thanks. \$\endgroup\$ – nebs May 23 '16 at 1:27
  • 1
    \$\begingroup\$ Usually there is a line in the specs about output voltage range. The LM358 has it, but only for V+ = 30 V, so not especially helpful for your case. \$\endgroup\$ – The Photon May 23 '16 at 1:48
  • \$\begingroup\$ i think that with \$V_\Delta\$<1.4 v and \$V^+\$=5 v and with the comparator gain of 110 dB and with a bottom clipping voltage at least 0 volts, we know that the comparator output levels are good enough for TTL or CMOS or whatever logic is in vogue of the day. it seems to me that the output is about what should be expected. \$\endgroup\$ – robert bristow-johnson May 23 '16 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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