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:
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):
Is there something I did wrong?
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.
Correct answer by Peter Bennett on December 15, 2020
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.
Answered by Neil_UK on December 15, 2020
1 Asked on December 19, 2020 by michael-reilly
1 Asked on December 18, 2020 by srikrishna-jana
2 Asked on December 18, 2020 by edwin-vargas
2 Asked on December 18, 2020 by dragos-spiridon
1 Asked on December 18, 2020 by tioneb
1 Asked on December 18, 2020 by cdevelop
4 Asked on December 18, 2020 by dean
2 Asked on December 17, 2020 by cremus
1 Asked on December 17, 2020 by runo
2 Asked on December 16, 2020 by bud
0 Asked on December 15, 2020 by voltsandnuts
2 Asked on December 15, 2020 by ttbulaski
1 Asked on December 15, 2020 by ninjagreg
0 Asked on December 14, 2020 by amit-nikhade
1 Asked on December 14, 2020 by yonatan-avhar
2 Asked on December 14, 2020 by uk25
Get help from others!