Is there such a thing as a circuit that outputs 1 if the input is high-impedance, and 0 otherwise?

I am trying to design a circuit that outputs a logical 1 if the input is high-impedance, and a 0 otherwise.

Any idea how I might implement this? I would prefer to use off-the-shelf parts (no programming).

Truth table:

I|O
---
X|1
0|0
1|0


I was thinking something along the lines of a pull up resistor with an NPN transistor. Thoughts?

• What is it when it isn't high impedance? A lightning bolt? An open collector pulling to ground? A 5mA current source? Commented Jun 6, 2013 at 21:24
• pull-up resistor. [The question is vague, though. What are you testing the impedance of? And why?] Commented Jun 6, 2013 at 21:26
• I added a truth table. Commented Jun 6, 2013 at 21:31
• @PhilFrost this is in CPU terms, so it would likely be somewhere in the realm of 0V-1.8V to 0V-5V Commented Jun 6, 2013 at 21:32
• I guess you could call it: "floating input detector". You could put a resistive voltage divider that pulls to Vcc/2, and with two comparators and an AND gate implement something like: OUTPUT = (lower_than_2/3_Vcc) AND (greater_than_1/3_Vcc) Commented Jun 6, 2013 at 21:56

1 Answer

A simple window comparator will do what you want.

The input is tied to midvoltage by the two 1Mohm resistors. The references are set at 1/3 and 2/3rds of the supply voltage. LM339 is open-collector output, so can be OR'ed together to get the desired truth table.

Google for "window comparator" to get more detail about this circuit.

Please notice that this circuit will not detect a low-impedance connection to half the supply voltage, only low impedances to high or low levels.

• Interesting. This might be tough to scale, as this is for a microprocessor, but I appreciate the effort, and I'll check this in my sim to make sure it's what I'm looking for. Thanks! Commented Jun 6, 2013 at 23:23
• LM339 is cheap (\$0.33 in single pieces) and you get four comparators (two copies of this circuit) per chip. Commented Jun 6, 2013 at 23:24
• Does your microcontroller have ADC inputs? You can do the same trick in software, just the 1M+1M midpoint supply is all the hardware you need. If your micro has switchable pull-up / pull-down resistors, you could use those in succession and avoid any extra components. Commented Jun 6, 2013 at 23:26
• the circuit is designed to be part of a CPU pipeline, so I'm not sure that will work. I am going to explore this, though. Commented Jun 6, 2013 at 23:27
• Also, the 10k+10k+10k divider chain can be shared among any number of comparator circuits. Commented Jun 6, 2013 at 23:36