Electronic – Logic gate on negative signals

digital-logicdiodeslogic-gatesnegative-voltage

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".

schematic

simulate this circuit – Schematic created using CircuitLab

EDIT

I thought about this one too:

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

schematic

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.

schematic

simulate this circuit

Best Answer

This would be easier if the schematic had reference designators.

Both circuits have issues. In the upper schematic, (as above) an NPN bipolar such as a 2N4401 or 2N3904 as a common-base amplifier will work more "crisply". Base to GND, emitter to the diodes, collector to the output. To prevent the output from going below GND, add another diode in series with the collector and take the output from the diode/1K node.

In the lower schematic, two things. First, you cannot pull an opamp input 20 V below its negative rail. Add a diode from the inverting input to GND, anode to GND. This will clip the input at approx. -0.6 V. Also, is there a reason why the resistor values are so low? Power dissipation in the 1K going to the diodes node is 0.4 W, requiring a 1 W part. Consider raising the values of all resistors to 10K.

This applies to the first schematic also. You would be pulling approx. 20 mA through the base-emitter junction; that is unnecessarily high and affects long-term reliability.

Second, not all opamps can tolerate even -0.6 V below the negative rail on an input. Also, not all opamps can drive TTL logic levels when powered from +5 V. Read all of the datasheets and choose carefully.