I am trying to make a PWM signal for controlling a motor.

The TL082 op-amp, connected between 0 and +5 V, takes

  • a triangular input generated by an astable and filtered by a capacitor on the (-) input
  • an adjustable voltage, made by a R/2R resistor network on the (+) input

All this works at about 50 kHz. In theory, the output should vary from 0 to +5 V, but in reality, it varies from +1.4 V to +5 V.

I tried to add a pull-down resistor (1 kΩ and 10 kΩ), I also tried a pull up (never know) without results. I also tried a feedback loop with a 1 kΩ resistor on the (-) which changed nothing. I lowered the frequency to 25 kHz, which changed nothing. I know that these were useless, but I was not able to come up with tomething else, this is a REALLY basic circuit.

Here is the diagram:

Electric diagram

and here are the oscilloscope traces:

The triangle input and the adjustable one (random value):

Triangle and adjustable input

The triangle input and the output depending on the adjustable input level:

Triangle input and output

I must be wrong somewhere, but I don't get where; normally in comparator mode, the outputs are between V- and V+ and that's it. Maybe it is the fact that I use it between 0 V and +5 V?

On the other hand, the PWM is working, it changes with the adjustable voltage increase.

  • \$\begingroup\$ What exactly is an AOP? \$\endgroup\$
    – Hearth
    Jan 24, 2022 at 20:14
  • 1
    \$\begingroup\$ TL082 is not a rail-to-rail opamp. You need a rail-to-rail opamp, or a dual supply if you must use this one. \$\endgroup\$
    – user16324
    Jan 24, 2022 at 20:16
  • \$\begingroup\$ @Hearth: an AOP is a French op-amp. Edited it. \$\endgroup\$
    – ocrdu
    Jan 24, 2022 at 20:25
  • \$\begingroup\$ Your measurements appear to be taken with a Fluke/Philips combiscope, yes? (Just curious.) \$\endgroup\$ Jan 24, 2022 at 21:15
  • \$\begingroup\$ @Hearth Yes, it is an Op amp in french, sorry :) \$\endgroup\$
    – zepeu
    Jan 26, 2022 at 8:41

1 Answer 1


A TL082 is an op amp, and is not designed to be used as a comparator. Its internal circuitry is optimized for linear operation in feedback, and isn't optimized for the kinds of saturation that occur with large-signal effects in a comparator.

Moreover, this is not a "rail to rail IO" op amp, and its output driver cannot reach all the way down to 0 V or all the way up to 5 V. In the datasheet you can see that the output stage has a fairly straightforward push-pull as its final stage:

enter image description here

This structure encounters Vbe drops on both its PNP and NPN output transistors, which means that the best output range you can expect is around 0.7 - 4.3 V (assuming the prior stage can reach a wide enough range).

Use a comparator instead (and if it has an open-collector/open-drain output, add a pullup resistor). The LM393 conveniently has the same pinout and an open collector output, requiring only the addition of the pull-up resistor. It's also faster - it slews from 0 to 5 V in 0.25 microseconds (20 V/μs), while the TL081 only slews at 13 V/μs. Aside from that, it's a fairly old and simple comparator, and you can get even faster/more advanced ones to meet specific needs.

  • \$\begingroup\$ Thanks for the answer, is there a component you would recommand? \$\endgroup\$
    – zepeu
    Jan 24, 2022 at 20:09
  • \$\begingroup\$ @zepeu LM393. I'm finishing up an edit very soon. \$\endgroup\$
    – nanofarad
    Jan 24, 2022 at 20:10
  • \$\begingroup\$ Perfect, the LM393 seems to be the basic and very useful one, thank you a lot :) \$\endgroup\$
    – zepeu
    Jan 24, 2022 at 20:38
  • \$\begingroup\$ @zepeu Not a problem, happy to help. \$\endgroup\$
    – nanofarad
    Jan 24, 2022 at 21:09

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.