Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Comparator output high with nothing connected to input - why?

Status
Not open for further replies.

boylesg

Advanced Member level 4
Advanced Member level 4
Joined
Jul 15, 2012
Messages
1,023
Helped
5
Reputation
10
Reaction score
6
Trophy points
1,318
Location
Epping, Victoria, Australia
Activity points
11,697
In the simulator this comparator circuit works as I expect it to.

+ input connected to 0.3V - comparator output goes to -5V
+ input connected to 3V - comparator output goes to 5V

But on my breadboard the comparator output is 5V with:
1) + input connected to nothing.
2) + input connected to ground.
3) + input connected to greater than 0.45V

I measure the reference voltage on my bread board at about 0.45V as in the simulator.

In short I am not able to implement a zero crossing comparator with a real LM339 chip on my breadboard.

Why?
 

LM 339 has negative bias current (so current flows out of the input pins). So leaving one input open, behaves as high input voltage.

Please double check everything again, because when your +input is at ground level and -input is at 0.45V (above ground level), then the output should be -5V. Did you measure between the + and - input (V+ minus V- should read -0.45 V, when +input is grounded, with chip present). Also check with an oscilloscope for oscillations. I think you didn't use any power supply decoupling on the bread board.

Use PNG instead of JPEG, it results in small files without loss of details.
 

I found this which explains why I am having this problem:

https://en.wikipedia.org/wiki/Comparator

The LM339 accomplishes this with an open collector output. When the inverting input is at a higher voltage than the non inverting input, the output of the comparator connects to the negative power supply. When the non inverting input is higher than the inverting input, the output is 'floating' (has a very high impedance to ground).


How do I get the comparator output to sit at GND and to go high when the + input goes higher than 0.45V reference?

At present I can only get the comparator output to sit at 5V and go to -5V if I connect the + input GND (less than 0.45V reference).

But something strange happens if I connect the + input to a capacitive sensor consisting of laminated paper with Al foil on the bottom.

If I touch the laminated paper surface above the Al foil the voltage at the + input goes from about 0.2V to about 0.6V but the comparator output drops to about 1.6V.

Now what is this about? 0.6V is greater than the reference voltage of 0.45V. So why doesn't the comparator output remain at 5V?
 

These comparators have a bias current in the 20 nA range and they have a PNP input stage (so bias curent flows out of the pin). If you don't have a DC path (because of a capacitive sensor), the input voltage would rises somewhat above the input that has a fixed voltage. When your sensor is at the + input, you will get 5V output.

The open collector issue you already solved by the 4.7 kOhms resistor, so it is no longer floating

Do you have an oscilloscope, as that enables you to check for strange behavior?

Regarding output to ground instead of -5V, use ground for the negative supply pin of comparator. These comparators have an input common mode range that goes to ground (check the datasheet).
 

1. Most ICs assume a logic 1 on their input pins when nothing is connected and that is why every pin must be clearly defined to either a logic 1 or 0.
2. Have you changed the comparator with a new one to check if the IC is still good?
3. Also check the features of the IC you are using like the CMRR?
 

1. Most ICs assume a logic 1 on their input pins when nothing is connected and that is why every pin must be clearly defined to either a logic 1 or 0.
2. Have you changed the comparator with a new one to check if the IC is still good?
3. Also check the features of the IC you are using like the CMRR?

There is nothing wrong with the comparators. My confusion about the voltage with respect to the lit LED was due to the fact I was actually measuring the voltage drop across the diode while it was conducting and not the voltage from the comparator that was driving the LED.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top