# Logic gate on negative signals

I need a logic gate to check if A or B or C is negative voltage (referenced to the ground). It does not matter if the output is positive or negative logic (as long as it is in positive voltages)

Does this circuit work?

Do you see other solutions or improvements?

One problem I see is that out goes negative if "True".

simulate this circuit – Schematic created using CircuitLab

EDIT

easier to compensate the voltage drop of the diodes by tuning the resistances. and I can invert the logic easily.

simulate this circuit

EDIT

What I finally did, it works well:

The comparator has built-in reference, just tune the voltage divider to match it. I didn't use hysteresis, the comparator has a built-in hysteresis too, but only few mV.

simulate this circuit

• How many volts of negative voltage are we talking about? May 17, 2019 at 9:06
• around +/- 20 V May 17, 2019 at 9:52
• Regarding your second circuit, add a diode in series with the resistor which is now connected to the positive terminal of the opamp and ground, to compensate for the diode drop. May 17, 2019 at 10:59
• And you need some hysteresis as MartinF also suggest. Maybe use a Schmitt trigger instead of an opamp? May 17, 2019 at 11:01
• Not sure why you put a JFET in your first circuit. An NPN would work just fine there. May 17, 2019 at 11:25