# Having problems with voltage comparator.need help

Discussion in 'The Projects Forum' started by isk, Dec 27, 2009.

1. ### isk Thread Starter New Member

Dec 17, 2009
5
0
Hello everyone. I am having problem with a part of my project. I have attached the picture of my LM 339 circuit. Before building it on the breadboard, i build the circuit on circuitmaker to check whether i get the correct results. As you can see frm the pic the result i get at the output is 116.7mV. Since i got the correct value, i build the circuit on the breadboard. When i check the values of the Vref and Vin using my multimeter, it shows the values that i want. Vref is 3V. Vin is 2.5V. But When i check the output of the voltage comparator, its gives a 9V output. But it is suppose to give 0V. Can someone please help me to solve the problem. Thank you very much

• ###### voltage comparator 1.jpg
File size:
25.9 KB
Views:
47

Apr 5, 2008
19,905
4,138
Hello,

Did you use the correct pins on the breadboard?
They are easy to mix-up as left and right are not the same.

Greetings,
Bertus

File size:
31.1 KB
Views:
76
3. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
Are you powering the circuit from a 9v battery? Note that 9v batteries often measure 8.6v or less even when new, and when they're nearly used up, the voltage falls quite a bit.

Did you ground any unused inputs on the LM339? If not, that can cause problems.

Double the resistance of R7 to 2k. LM339's are pretty wimpy as far as sinking current. Right now, you're asking it to sink 9mA current (9v/1000 Ohms = 9mA) - increasing R7 to 2k means it'll only have to sink 4.5mA current. Usually you want to stay below 6mA.

Measure the actual voltage that's on the inverting (-) and noninverting (+) inputs of the comparator you're using. Are you sure you're connected to the correct pins?

Tip: Replace R4 with a Zener diode of your desired reference voltage, and change R3 so that you'll get about 10-20mA current flow through the Zener. This will keep your reference voltage more stable. Otherwise, as the battery voltage drops, so will your reference voltage.

Last edited: Dec 27, 2009
4. ### DickCappels Moderator

Aug 21, 2008
5,745
1,800
Certain double-check SgtWookie's checklist. It looks like you simply swapped the + and - inputs on the inverter as Bertus suggested. For basic funcationality, comparitors are that simple.

5. ### chihiro Member

May 18, 2008
22
0
tried the same circuit with 741 opamp, and getting 932 mV from the output even i set the Vref on minus input around 5-6 V

6. ### SgtWookie Expert

Jul 17, 2007
22,201
1,809
A 741 is an opamp, not a comparator - and a very old, slow and noisy opamp to boot.

It does not have rail-to-rail outputs. You will be lucky if it gets within a volt of either power rail.