4
\$\begingroup\$

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?

\$\endgroup\$
8
  • 3
    \$\begingroup\$ What is it when it isn't high impedance? A lightning bolt? An open collector pulling to ground? A 5mA current source? \$\endgroup\$
    – Phil Frost
    Commented Jun 6, 2013 at 21:24
  • 1
    \$\begingroup\$ pull-up resistor. [The question is vague, though. What are you testing the impedance of? And why?] \$\endgroup\$ Commented Jun 6, 2013 at 21:26
  • \$\begingroup\$ I added a truth table. \$\endgroup\$
    – Codeman
    Commented Jun 6, 2013 at 21:31
  • \$\begingroup\$ @PhilFrost this is in CPU terms, so it would likely be somewhere in the realm of 0V-1.8V to 0V-5V \$\endgroup\$
    – Codeman
    Commented Jun 6, 2013 at 21:32
  • 1
    \$\begingroup\$ 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) \$\endgroup\$ Commented Jun 6, 2013 at 21:56

1 Answer 1

3
\$\begingroup\$

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.

enter image description here

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.

\$\endgroup\$
5
  • \$\begingroup\$ 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! \$\endgroup\$
    – Codeman
    Commented Jun 6, 2013 at 23:23
  • \$\begingroup\$ LM339 is cheap ($0.33 in single pieces) and you get four comparators (two copies of this circuit) per chip. \$\endgroup\$
    – markrages
    Commented Jun 6, 2013 at 23:24
  • \$\begingroup\$ 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. \$\endgroup\$
    – markrages
    Commented Jun 6, 2013 at 23:26
  • \$\begingroup\$ 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. \$\endgroup\$
    – Codeman
    Commented Jun 6, 2013 at 23:27
  • \$\begingroup\$ Also, the 10k+10k+10k divider chain can be shared among any number of comparator circuits. \$\endgroup\$
    – markrages
    Commented Jun 6, 2013 at 23:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.