Go Down

Topic: Comparator LM339 not accurate ? (Read 276 times) previous topic - next topic

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?

MK1888

Look in the datasheet for "Input offset voltage".

For removing jitter, google "LM339 hysteresis".

TomGeorge

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... :)
Everything runs on smoke, let the smoke out, it stops running....

MarkT

#3
May 26, 2020, 06:39 pm Last Edit: May 26, 2020, 06:41 pm by MarkT
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 DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

js-

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

Ron_Blain

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


jremington

#6
May 26, 2020, 08:39 pm Last Edit: May 26, 2020, 08:40 pm by jremington
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.

Go Up