I have a PWM signal with a period of 200uS and a duty cycle of 20%. For prototyping reasons (this is simulating a pulse that I'll be receiving from circuitry later on in the project), I want to read the PWM signal via an ADC on an STM32F7. The ADC has a Vref of 2.5V from a TI 5025. The real world pulse will have a signal that drops below 0V before it recovers, so I want to add a DC offset that is half of the Vref (1.25V).

The voltage reference is working fine and I have added a voltage divider on the output to give me half the 1.25V offset that I want. As the pulse will interfere with the Vref signal I've opted to add a unity gain buffer (MAX4167) to the output to isolate the 2.5V reference and the 1.25V offset to add to the signal. The buffer outputs the expected DC voltage.

All of this circuitry works as expected.

What doesn't work is when I add the PWM signal to the output of the buffer. I expect to get my 1V PWM signal output with an offset of 1.25V but what happens is the DC offset remains but the signal gets completely lost. I want my PWM signal to be identical but with an offset. I've attached a picture of what I've done and what I want. It's much easier to digest visuallyenter image description here

PWM signal that I'm generating via signal generator: enter image description here

Output that I'm getting from the buffer when I add the PWM signal to the output: enter image description here

Any suggestions as to how I can solve this problem would be great. I've not done a lot of work with Op Amps before so I'm sure it's something simple. Thanks


You can't connect a signal to the output of an op-amp without using a series resistor in between. Try a 1 kohm resistor. The op-amp will fight any "hard" signal applied to its output and, in your circuit, the op-amp can only win by going unstable. Be reasonable and "sum" your signals.

| improve this answer | |
  • \$\begingroup\$ I initially added a 100 ohm resistor between the output of the op amp and the signal but all that did was shift the 0V part of the signal to about half without raising the 1V peak of the signal. ie. it added some offset but also reduced the peak to peak. Could you please explain more about summing? Thanks \$\endgroup\$ – Christopher Dyer Apr 7 at 12:11
  • \$\begingroup\$ Use a 1 kohm resistor from both offset and and square wave to a new node. That new node is the summing point but, the amplitude of both will be affected by the "mixing" operation so you might need to adjust the offset voltage accordingly AND you might need to adjust the PWM amplitude accordingly OR use a proper op-amp mixer circuit. \$\endgroup\$ – Andy aka Apr 7 at 12:25
  • \$\begingroup\$ I tried your suggestion but it just raises the 0V part of the signal to about 700mV and doesn't raise the 1V pulse at all. I was hoping to avoid doing a proper mixer circuit. \$\endgroup\$ – Christopher Dyer Apr 7 at 13:31
  • \$\begingroup\$ If you added a gain stage of two afterwards, what do you get? \$\endgroup\$ – Andy aka Apr 7 at 13:37
  • \$\begingroup\$ Sorry if this is a silly question but are you suggesting I sum the offset and voltage before or after the op amp stage? I decided against a standard non-inverting summing amplifier as I want to isolate the Vref from the DC offset before it is mixed, hence the buffer first. I mixed the amp output and the signal output through a 1kohm resistor each and measured the new node (similar to a voltage divider, but with the DC on one end and the signal on the other. I measure the "Vout" in between the resistors). \$\endgroup\$ – Christopher Dyer Apr 7 at 13:49

To offset the 1 V PWM signal by 1.25 V you could use a passive mixer, followed by an amplifier to restore the amplitude; like this:-


simulate this circuit – Schematic created using CircuitLab

R1 is made twice the value of R2 so Vref will have half the influence, equivalent to equal values with Vref = 1.25 V. The mixer attenuation is 3:1 for Vref and 1.5:1 for PWM, which produces the correct waveform but at reduced amplitude. OA1 is configured as non-inverting amplifier with a gain of 1.5, restoring the original 1 V PWM amplitude with an offset of 1.25 V.


This circuit provides a low output impedance to drive the ADC. However Vref and PWM are not buffered, so you may need two more op amps to buffer these inputs as well. Alternatively you could increase the values of R1 and R2 so they load the sources less, bearing in mind that parasitic capacitance will have more effect at higher impedance.

To maintain waveform fidelity the op amp should have wide bandwidth and low overshoot. Depending on the device, some resistance may be required in series with the output to prevent oscillation when driving the relatively high capacitance of the ADC input.

| improve this answer | |
  • \$\begingroup\$ How I've tackled the problem so far is to buffer Vref/2 with a unity gain as I don't want my square wave to influence the Vref, so I have a steady 1.25V buffered. Then I mix the Vref/2 and square wave with equal ratios (2 x 10kohms), which halves both signals but then I put it through a non-inverting op amp with a gain of 2 to compensate. Effectively I use a unity gain which then connects to a non-inverting summer with 2x gain. I may try out your circuit too with the buffer. Thanks \$\endgroup\$ – Christopher Dyer Apr 7 at 16:41

You can not add the offset to the signal without some output impedance, the low impedance OmAmp output just overdrives your signal. Sum both signals with equal resistors!

| improve this answer | |
  • \$\begingroup\$ I looked at summing amplifier examples but wasn't sure if that configuration was correct for what I want, as I am using a buffer to isolate the DC offset and the signal first? \$\endgroup\$ – Christopher Dyer Apr 7 at 12:14
  • \$\begingroup\$ That is not a problem, actually you can replace the simple buffer with a summing amplifier with a high enough input impedance. I will add a schematic to my answer. \$\endgroup\$ – jusaca Apr 7 at 12:34
  • \$\begingroup\$ Thanks for the schematic, this makes a lot of sense. Just one small problem: I want the buffer to also provide more current than the signal has to my ADC to reduce the settling time, so the buffer is definitely required for my application. If I just wanted to isolate the 2.5V and add the offset to the PWM could I just remove the op amp all together? Would the 10kohm configuration with the 500 ohm voltage divider be enough to stop the PWM from generating noise on the Vref? \$\endgroup\$ – Christopher Dyer Apr 7 at 12:54
  • \$\begingroup\$ Just tried your suggestion out but it shifts the 0V part of the signal to about 700mV without raising the 1V peak of the signal. ie. it added about half of the offset to the 0V part of the signal but it doesn't shift the pulse portion of the signal. Strange \$\endgroup\$ – Christopher Dyer Apr 7 at 13:05
  • \$\begingroup\$ You are right, I'm sorry. I wasn't thinking when posting the circuit. I was thinking about the inverting summing amp. Because that one keeps the input at 0V it would work as described, BUT you need a negativ supply rail for that and get an inverted output. You could also connect the Offset to the non-inverting input and the PWM to the inverting input with a feedback resistor to the output. But it's the same here, you get inverted output signals. \$\endgroup\$ – jusaca Apr 7 at 13:32

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.