Using an op amp open loop as a comparator gives jittery, late edges, because op amps are not built for it. This page explains the design difference and when the savings are safe.
An op amp is designed for closed-loop linearity: internal compensation trades speed for stability, the output is push-pull, and open-loop use slows the transition to microseconds with rail-limited swings. Dedicated comparators such as LM393, LM311 and TLV3501 are built open loop: no compensation capacitor, fast response, 1.3µs for LM393 and 4.5ns for TLV3501, and open-collector or open-drain outputs that need a pull-up and happily interface to any logic level, per GB/T 4728.
Slow duties tolerate the hack: temperature alarms, level detection, millisecond responses, and LM358 as a comparator is the classic saving. Dedicated comparators are mandatory for overcurrent protection and zero-crossing detection needing microsecond edges, for clean precise hysteresis, and for interfacing to MCU levels through the pull-up. Note that open-loop op amp use breaks no rules but carries no guaranteed figures, the datasheet simply does not cover it.
Field traps: no hysteresis means input noise chatters the output around the threshold and the relay rattles; forgetting the pull-up on an open-drain output gives a permanent low; exceeding the input common-mode range, LM393 keeps its non-inverting input below V_CC minus 1.5V or the flip fails; and a push-pull op amp driving a relay invites inductive kickback into the output. A positive-feedback resistor, say 100k from output to the non-inverting input, is the first line of stability on slow duties, and the scope should show a single clean edge with no multiple crossings.
| Aspect | Op amp open loop | Dedicated comparator |
|---|---|---|
| Response | µs to tens of µs | LM393 1.3µs and up |
| Output | push-pull | open drain needs pull-up |
| Compensation | yes, slows the flip | none, built open loop |
| Guaranteed specs | not covered | full parameter set |
| Hysteresis | build your own | some parts included |
| Fit | slow cost saving | protection, zero cross |
Comparator selection fits overcurrent protection, zero-cross detection, threshold alarms and level judgement. Save with an open-loop op amp plus hysteresis on slow duties only; use dedicated parts for protection, pull up the open drain, check the common-mode range and fit the hysteresis before power.
The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Comparator applications per GB/T 4728; safety IEC 60204-1. Always check the device datasheet and the product design file for ratings and derating.
Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.