0
\$\begingroup\$

I am using an op-amp (LF353P) for my voltage comparator circuit. The supply voltage for the op-amp is +12 V and -12 V. The input voltage for the inverting pin (Vref) is 1.1 V. The input voltage for the non-inverting pin (Vin) is a PWM signal from an ESP32 (1 kHz square wave, 10% duty cycle, Vmax = 2.82 V, Vmin = -318 mV).

The output I got from this is a square wave signal with the same duty cycle as a PWM signal from the ESP32 and a maximum voltage of 23 V and a minimum voltage of -1.60 V.

The output I want is a square wave signal with the same duty cycle as the PWM signal from the ESP32 and a maximum voltage of 12 V and a minimum voltage of -12 V.

I changed my 10 kΩ that connects to the 3.3 V to 20 kΩ for 1.1 V (Vref).

image

If I understand correctly, if Vin > Vref, Vo is equal approximately to +12 V, and if Vin < Vref, Vo is equal to approximately -12 V.

If I misunderstood, could you explain how it works or how I can get the output I want?

This is the waveform that I get from the op-amp:

enter image description here

\$\endgroup\$
8
  • \$\begingroup\$ Show waveforms. where is ground on your oscilloscope ? Is it DC coupled or AC coupled ? \$\endgroup\$
    – jp314
    Aug 15, 2022 at 5:10
  • \$\begingroup\$ What are you using as the reference, or zero potential node, to read those voltages? Does your opamp +/- 12 V power supply share its 0 V node with the GND symbol on your schematic? \$\endgroup\$
    – Neil_UK
    Aug 15, 2022 at 5:10
  • \$\begingroup\$ My opamp +/- 12V power supply is IA1212S and I connected its ground to the ground from esp32. I am using the same ground for my oscilloscope. \$\endgroup\$
    – Apiwut
    Aug 15, 2022 at 6:08
  • \$\begingroup\$ > a maximum voltage of 23 volts and a minimum voltage of -1.60 volts.< ... Why 23 Volts? \$\endgroup\$
    – Antonio51
    Aug 15, 2022 at 7:53
  • \$\begingroup\$ I don't know. I thought it should be +/- 12 volt because my supply voltage is +12V and -12V from IA1212S. \$\endgroup\$
    – Apiwut
    Aug 15, 2022 at 7:58

2 Answers 2

1
\$\begingroup\$

The output I got from this is a square wave signal with the same duty cycle as a PWM signal from the ESP32 and a maximum voltage of 23 V and a minimum voltage of -1.60 V.

Yes, this is normal, the scope is set to AC mode so "0V" on the display corresponds to the average voltage of the waveform. In this case the duty cycle is low, so it spends a lot of time near -12V, so the average is close to -12V, which is why the waveform is shifted up by almost 12V (10.4V in this case).

If you want to measure DC levels, set the scope to DC.

\$\endgroup\$
0
0
\$\begingroup\$

What you should see is something like this ...

enter image description here

If you see the wave shifted by 12 V, you used probably -12V of IA1212S as your ground scope, or used AC input in place of DC.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you. It was my fault that I used the AC couple instead of the DC couple. \$\endgroup\$
    – Apiwut
    Aug 15, 2022 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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