2
\$\begingroup\$

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!

\$\endgroup\$
  • 2
    \$\begingroup\$ You need a pull-up on the outputs, it's an open-collector output. Try a 10 K to the supply rail. \$\endgroup\$ – TonyM Apr 21 '17 at 22:21
8
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ +1 Addition : Which btw is ideal in many cases where you are examining some arbitrary signal level and need a logic level, or other rail level, output. \$\endgroup\$ – Trevor_G Apr 22 '17 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.