Can somebody help me design a comparator circuit?

ScottWang

Joined Aug 23, 2012
7,397
View attachment 111647

After a second look, are the diodes really necessary?
Because the U1C and U1D are the open collectors, when they are all low then it's fine and when any one is low and the other one is high, the high is a high impedance, so it won't be affecting anything, when they are all high then the R9 will be providing the high level for the Vb of Q1.
 

Thread Starter

Andrew Armstrong

Joined Sep 7, 2016
24
Repeating post #1 is not a good answer for something *not* in post #1. Joey's question is not about the two voltage bands you defined, it is about the band you did not define. Again:

what do you want to happen in the case between 0.4 and 1V?

Also, what do you want to happen if the input is greater than 3 V?

If you want LEds lit *only* when the input is within one of the two bands, that will take two window comparator circuits for a total of four comparators. One LM339 can do this. Also, you will need some kind of voltage reference part for the comparators to compare to. I like the LM4040 series.

ak
Aha sorry I misread the question.

If above 3V - nothing should be lit, if less than 400mv, nothing should be lit.
 

Thread Starter

Andrew Armstrong

Joined Sep 7, 2016
24
Depending on the accuracy of the resistors, yes.
I have an excel file for you but I can't include it here. I can post the pdf version of it if you are interested. It would be helpful in designing your own. I can step you through how it works so you can modify the design later if you want.
I would love for you to step me through how it works -- how shall we do that? Can you outline the behaviours and reasons behind them as a post?

For example - I am struggling to workout the diodes play in the circuit you have designed - amongst many other things :D
 

BobTPH

Joined Jun 5, 2013
8,804
What if the voltage is -20V? Or +200V?

You have put no limits on the inputs. If they are not limited to between 0 and 5V, additional circuitry is required.

Bob
 

hp1729

Joined Nov 23, 2015
2,304
What if the voltage is -20V? Or +200V?

You have put no limits on the inputs. If they are not limited to between 0 and 5V, additional circuitry is required.

Bob
Good point. Given the voltage levels he gave I assumed he was looking at logic levels.
 

hp1729

Joined Nov 23, 2015
2,304
I would love for you to step me through how it works -- how shall we do that? Can you outline the behaviours and reasons behind them as a post?

For example - I am struggling to workout the diodes play in the circuit you have designed - amongst many other things :D
Forget the diodes. Using a voltage comparator with open collector outputs the diodes are not necessary. Using an op amp that can pull high or low the diodes are needed.

Let me make a pdf of the excel file (modified with corrected calculations).
 
Top