I need to detect a signal if it is greater than VDD or smaller than 0. I can't use comparator because the input signal is outside of common-mode input range and I have only one power supply VDD. Is there a simple way to do that?
-
1The greater signal is easy, voltage divider to analog input. – Passerby Apr 04 '16 at 04:46
-
The below-zero signal is easy too, but less obvious. Turn the divider upside down and connect the top to \$V_{DD}\$ and the bottom to the signal that goes below ground. You'll need two separate comparators for the over-voltage detector and the under-voltage detector. – Daniel Apr 04 '16 at 04:55
1 Answers
Use three resistors- one to the input, one to GND and one to Vdd. Each can be equal in value, say 10K. The other end of all three goes to one junction.
Now you will have the voltage at the junction < 1/3 Vcc for Vin < 0 and >2/3 Vdd for Vin > Vdd.
So, three more resistors in series from Vdd to gnd to give you the two thresholds. Again, 10K is fine.
And a dual comparator with open-collector output and a pullup resistor (another 10K maybe), eg. LM393 (check the common mode range for your particular Vdd). The outputs are connected together*. Which connection goes to inverting and which to non-inverting is left as an exercise. You may need an inverter afterward- output will be low for detected outside 0 to Vdd.
If the voltage can go way outside the supply range, consider clamping it with diodes to keep the comparator input voltages reasonable (though many comparators will behave reasonably if one of the input voltages is within range).
\$*\$ By convention this is called 'wired-or' (assuming that the signal is inverted) but it's really wired-and.
EDIT:
Created a https://www.falstad.com/circuit/ schematic of my interpretation of this answer:
File > Import From Text... available here: https://pastebin.com/NCueKteH

- 147
- 6

- 376,485
- 21
- 320
- 842