# OpAmp Comparator Circuit Design for High/Low voltage measurement

I am new to this. I want to make a circuit to measure the voltage from (0 ~12 V), which can have 2 op-amps as comparator to give the output positive, when the voltage goes from 8 V to 12 V and give output negative when the voltage goes from 0 V to 4 V. The reference voltage should be 6 V (+/-2 V). Please suggest me the basic circuit using 2 op-amps.

• Input voltage: 0 to 12 V
• Reference voltage is 6 V
• Higher limit : 8 V
• Lower limit : 4 V

Means, when I increase the input voltage from 6 V, it should not show any change until it crosses 8 V and when its more than 8 V, it should show HIGH VOLTAGE. Similarly, like when i down the input voltage from 6 V, it should not show any change in output until it cross the 4 V and when its lower than 4 V. it should show LOW VOLTAGE.

Thanks.

Table 1. Function table for OP to edit.

V_IN        V_OUT
----------- ----------
0 - 4 V     Negative
4 - 8 V     0 V
8 - 12 V    Positive


Please Refer this Circuit and suggest me the corrections, if any. Thanks

• Your deleted schematic shows an AC input. Is this correct? If so, does "4 volts" mean mean pk-pk, RMS, or average rectified? Or something else? And how much accuracy do you need? How many power supplies are you allowed for the op amps? You show a single 12 supply. Is +/- 12 allowed? What accuracy is required? – WhatRoughBeast Aug 9 '18 at 11:25
• Hi, I just added the circuit. please check that. – Emlinux Aug 10 '18 at 6:01
• @Emlinux: I've fixed the formatting in your question. Note 'V' for volt. (Capitals matter.) You can often save a lot of words with a table to define operation. I've added one for you with my understanding of your requirements. Please review and edit to fix any errors. You seem to be requiring a negative voltage output but your schematic shows a positive-only supply. Where is the negative voltage supposed to come from? – Transistor Aug 10 '18 at 7:39
• My comment copied from your deleted "answer": Note that you could make your schematic a lot more readable by using ground symbols close to each grounded point, eliminate all the ground wiring and the same with the V+ connections. Try and eliminate kinks in wiring such as above R4 and the loop under D1. – Transistor Aug 10 '18 at 16:34
• Your circuit runs off a single +12 supply. How do you expect to get a negative output (per your table)? – WhatRoughBeast Aug 11 '18 at 1:22