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?


2 Answers 2


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.

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

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.


simulate this circuit – Schematic created using CircuitLab


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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