Comparator problems with output
Add ceramic decoupling capacitors across the power pins of the comparator.

Input bias currents need a DC path to flow. You can't just leave them DC floating like that.

You can normally handle this by sticking resistors from each input to gnd. But in your case, you should stick each input in the middle of a resistor divider instead to DC bias in the middle of the input common mode range the because your input is bipolar but the comparator is not (it only has a unipolar supply). But this should have been an issue with the LM393 too.







simulate this circuit &ndash; Schematic created using CircuitLab