# How to clamp opamp output to +-12v when supply is +-15v

I have the following circuit. It's purpose is to take a 0-3.3v signal from an MCU and provide a square, -12v to 12v wave across R3, R4 and either R5 or R6. The idea is to read +-9v when only R4 is connected, +-6v when R4 and R5 are connected, and +-3v when R4 and R6 are connected. The peak-to-peak voltage of the square wave are reduced depending on the configuration of R4/5/6. I have no control over the values of R4, R5 and R6. My problem is that, considering the +/-15v supply, the output of the opamp is somewhere around +/-13.7v. This offsets the values at the "Output" point by a few volts and is out of spec.

I thought of using a rail-to-rail amplifier with a +/-12v supply, but even the rail-to-rail amps can't truly swing to the rails. Also, I'd have to re-work a whole bunch of other subcircuits to work with +/-12v or add a whole other AC/DC converter and I'm not willing to do either.

I then thought of using two back-to-back zeners right after R3, but that would only clip the max voltage, all of the other points would still be too high/low.

Then, I thought of using simple voltage divider for the power inputs of the amp, but that would add 4 resistors to the board and I'd rather avoid that if possible.

In the schematic, assume SW2 has another unconnected pole so that having only R4 in series with R3 is an option. simulate this circuit – Schematic created using CircuitLab

Can anyone think of how I can limit the output of the opamp to +/-12v and maintain the 9-6-3v ratios with the regards to the output?

• Why do you need to get closer than a few mV to the rail that a rail-to-rail opamp won't work? And for a square wave no less. It sounds like a misguided requirement. Jan 14, 2020 at 18:56
• @DKNguyen I probably could use a rail-to-rail amp if I could change to/add a +-12v power supply but at this point the whole board is running off +-15v and it's just not feasible to change that or add another AC/DC converter now. Jan 14, 2020 at 19:02
• A better idea is define your acceptance criteria FIRST. (ie Specs) Input +/-15V and selector switch, Output = +/-12V to _?_k load within ? % accuracy with rise time max=? and duty cycle error =?% also with selection of +/- 3,6,9V with ?% error no load and max load = TBD ok? make a list Jan 14, 2020 at 19:11
• "all of the other points would still be offset" What offset are you referring to? I don't see anything that would be offset. Jan 14, 2020 at 19:45
• I don't understand why replacing R4 with zeners won't work. You would have a symmetrical, limited output swing. What do you mean by "all of the other points would still be offset"? Please describe your switch better...is it 1P3T? 2P2T? 2P3T? Jan 14, 2020 at 19:47

You're using an op-amp as a comparator, which isn't all that great an approach.

Consider replacing the op-amp with an analog switch such as an ADG1419.

You can either reduce the supplies to +/-12V or replace R3 with two resistors that give you the Thevenin equivalent. eg. Ra = 1137$$\\Omega\$$ series and Rb = 4550$$\\Omega\$$ to ground.

Ra || Rb = 910$$\\Omega\$$

15V * Rb/(Ra+Rb) = 12V

If you insist on using a quad op-amp you could add a series resistor and back-to-back zeners before the 910 ohm resistor, but you'll need an op-amp that swings a lot closer to the rails under load than the TL081, and the tolerance on the voltage will not be great. Another option would be a Schottky bridge and a single zener or a TL431 with resistors to set the clamping voltage (at least that would be very symmetrical).

• I have other reasons for wanting to use an opamp, namely it's a spare opamp on a chip of 4 and I'd really like to not add another component. Jan 14, 2020 at 19:39
• Yeah I am actually using the lm833 (didn't know I could change it in circuitlab). The chip itself costs pennies whereas any rail-to-rail amp with a high enough slew rate (at least from what I can find) is upwards of 8$CAD... Adding a resistor and 2 zeners, IMHO, is a better solution than re-working the rest of the board to run off +-12v rather than +-15v. I can live with a tolerance of +-0.5v. Jan 14, 2020 at 20:22 • Look harder for a more appropriate rail-to-rail output op-amp, and use the two resistors I calculated above, that would be my suggestion. No zener diodes. No more than$1.50-\$2 CAD for a quad. The LM833 is not good enough. Jan 14, 2020 at 21:02
• So what do you think of this: I'll use a +-12v supply and replace the Opamp with the lm2903 (comparator). As far as I can see, it'll allow one of the inputs to swing all the way to vcc, has a good response time, and can provide enough current for the above loads. Jan 16, 2020 at 22:13
• OPA1678/9 is pretty good, but there are diodes between the inputs so some other changes would be required. Cheap too, 78 cents CAD in 1K for the quad. Jan 16, 2020 at 22:56

Run back-to-back 11V zeners from the output (the node where you want the 12V swing) to the negative input. If you choose the node by the switch (that you've labeled +/-12V) the voltage divider won't do much, I'm guessing you want it on the op amp output.

• When the input voltage is +3.3V, output will be railed, n'est-ce pas? Jan 14, 2020 at 19:36
• You're right; I was absentmindedly assuming a virtual ground where it clearly isn't. OP could run it to an actual ground, assuming adding a nominal series resistance to limit current. Jan 14, 2020 at 20:40