Comparator LM339 not accurate ?

I'm feeding 5V from an arduino to the circuit. I'm comparing the voltages across 2 trimpots. I use 4K7 as a pullup resistor.

I measure 2.5V at the Positive Input (Pin 10) and 2.503V at the Negative Input (Pin 9).
The Output (Pin 16) reads HIGH, but it should read LOW, since 2.5<2.503

Only at 2.508 is the switch happening, and the Ouput isn't a steady LOW but it's fluctuating, I guess because of noise. At 2.509V and above it is steadily LOW.

Is this behavior normal for a LM339 ? Meaning, is there always a delta?

Look in the datasheet for "Input offset voltage".

For removing jitter, google "LM339 hysteresis".

Hi,
A circuit diagram will to.
What is the application you need the comparator for?

As @MK1888 has said you need some hysteresis.

google lm339 applications.

Thanks.. Tom... :slight_smile:

js-:
I'm feeding 5V from an arduino to the circuit. I'm comparing the voltages across 2 trimpots. I use 4K7 as a pullup resistor.

I measure 2.5V at the Positive Input (Pin 10) and 2.503V at the Negative Input (Pin 9).
The Output (Pin 16) reads HIGH, but it should read LOW, since 2.5<2.503

Only at 2.508 is the switch happening, and the Ouput isn't a steady LOW but it's fluctuating, I guess because of noise. At 2.509V and above it is steadily LOW.

Is this behavior normal for a LM339 ? Meaning, is there always a delta?

The datasheet shows the worst case DC offset for the LM339 is 5mV and for the LM339A is 3mV, at 25C.

If you need a precision comparator you'll need a difference device, or amplify the signals with a precision
opamp before comparing them.

You can also consider trimming the device to compensate - this won't be perfect, but its doable.

I understand. However, the delta I'm measuring is rather 10mV and not 5mV like mentioned in the datasheet (at Vcc=5V)...

Are you using a 0.1 uF bypass capacitor between Vcc and ground right at Vcc? If not I would add one. Also where are the remaining input pins going?

Ron

If you are measuring those voltages with a multimeter, keep in mind that the multimeter has internal noise and that the meter leads pick up environmental electrical noise, introducing that into the circuit.