0
\$\begingroup\$

I've read about comparators and from my understanding, you've got 2 voltage inputs: reference voltage usually connected at the inverting input and Vin i.e. voltage you want measured usually connected at the non-inverting input. The output voltage will depend on your V+ and V- values and whether it's Vin>Vref (V+ is the output) or Vin<Vref (V- is the output).

My goal was to use a comparator (LM393A) that will output either a HIGH (5V) or LOW (0V) signal depending on the value of the Vin I've used as the input for the non-inverting input, but here is what happened instead:

enter image description here

I was expecting the output to be at 5v once V7 has surpassed V6 (V7 > 3.7V) but instead, Vout looks like this (graph fitted for your convenience):

enter image description here

Is there something I did wrong?

\$\endgroup\$
4
\$\begingroup\$

The LM393A, like most comparators, has an open collector output - that is, the output transistor can pull the output to Ground, but the comparator needs some external device to pull the output high.

You require a pull-up resistor of 10K or so connected from the output pin to your positive supply, instead of your resistor to ground, in order to see the output switch.

\$\endgroup\$
1
  • \$\begingroup\$ I really feel dumb for not reading the datasheet, thank you! \$\endgroup\$
    – TTbulaski
    Dec 11 '20 at 6:27
2
\$\begingroup\$

It's worth adding to Peter's answer about what is happening, why comparators like this have an open collector output.

An open collector output makes it easy to AND or OR (depending on your logic convention) the outputs without any further logic.

One application of this is to make a window comparator. The output will be high (positive logic, true, 1) only if the input is between two reference voltages.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$

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.