# What op-amp configuration would implement this behavior?

I have a 0-5 V voltage input to a system but I want the voltage to be constant after 2 V. If I buffer it, the output will still be 0-5V but I need it to be 0-2V.

So basically the input/output relation must be:

0 -> 0
1 -> 1
1.5 -> 1.5
1.9 -> 1.9
2 -> 2
2.1 -> 2
2.5 -> 2
3 -> 2
4 -> 2
5 -> 2

A voltage divider solution will not give the above. How could it be implemented using an op-amp?

A simple way (but slow response), only a single +5V supply required.

simulate this circuit – Schematic created using CircuitLab

You may not need the second op-amp, it's just a buffer to reduce the output impedance.

Here is what happens if the signal is faster.. .

how could that be implemented using an opamp?

An op-amp clipper circuit should work fine and be accurate. This circuit clips at 4.096 volts positive and 0 volts (for example): -

Here's another: -

This one appears to perform slightly better than the first (and the author says as much). Link.

• Oh thanks for the answer it is more work than I thought. Would that simplify the circuitry if the output goes to zero after input exceeding 2V? Because if so, I can also live with it. (I also dont need negative clipper the input is 0 to 5V) Commented Nov 21, 2022 at 12:03
• at least the first circuit requires opamps without differential input voltage clamping diodes or it will perform poorly. Commented Nov 21, 2022 at 12:17
• @user1999 just ignore op-amp U2 and its associated diode if you only want positive clipping and, as tobalt says, an extra diode across U1 would be beneficial if the signal changed rapidly. Commented Nov 21, 2022 at 13:00
• @Andyaka " an extra diode across U1 " when you say across between which nodes you mean? also is dual supply must for this circuit to operate? Commented Nov 21, 2022 at 13:20
• @user1999 OK, that idea won't work because of the configuration of the circuit so just ignore U2 and it's diode if you want a positive-only clipper. Commented Nov 21, 2022 at 13:37

Could you do it with a diode connected to 1.3V (or 1.7V using a Schottky)? It won't be as accurate as opamps, but it is simpler.

simulate this circuit – Schematic created using CircuitLab