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).
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: