Electronic – Voltage Comparator IC’s Output (LM339) Never Goes To VCC (But Can Go To Ground)

comparatoroperational-amplifier

I'm trying to set up the most basic form of voltage comparator using LM339 (http://rohmfs.rohm.com/en/products/databook/datasheet/ic/amp_linear/comparator/ba10393f-e.pdf).

I'm giving it 12V supply (from an ATX PSU).
On input 1 I give again +12 and GND. Output 1 goes to ground, but when I switch the inputs it does not go to VCC, instead it gets floating.

When it goes to ground, I can measure the voltage between output and VCC and it is 12V.
But when I switch the inputs, I measure voltage between both output and ground and output and VCC and it is always 0, which leads me to thinking it's floating.

What could I be doing wrong?
The fact that it gets to ground leads me to thinking the IC does something and if I remove its power, the output pin no longer goes to ground.
But I cannot understand why the output never goes high.

I tried with 3 ICs (same model) to eliminate the possibility of a buggy chip, also triple checked wiring – same thing.

Any help will be greatly appreciated!

Best Answer

The LM339, like a great many other comparators, has an open-collector output - the output is an NPN transistor with the emitter grounded and the collector connected ONLY to the output pin (see Fig. 1 in the datasheet), so the comparator can only pull the output to ground - you need something external, like a resistor to Vcc, to pull the output High.