# Electrically detecting a not connected input

I have a 0-30V DC signal and it can be physically disconnected from a circuit. I need to detect and generate a TTL output when this signal is disconnected.

The "detector" circuit and the signal will share a common ground.

The thing I can't figure out is 0V (GND) is also a valid "connected" state for that signal. Using standart approach of a pulldown for detecting unconnected state is not going to work.

• Signal is not digital, varies between 0-30VDC. Sorry for misleading tag, removed that.
• Which side I need to detect: I need to detect at receiver side and also need report that to sender.
• Impedance of source: Low, but going higher than 50mA load will going to disturb other things that depends on this signal.
• Pulling down lower than 0, higher than 30: I actually thought that but it is not seems feasible since I don't have these.
• Pulling to middle: 15V is valid signal, can't use that.
• Injecting signal: Nice idea, but receiving side need to be "basic" as possible and I can't modify freely the sender side.

Is there any way to detect this electrically? Thanks

• What is the impedance of the source? How much are you allowed to load it? Commented Nov 27, 2018 at 18:53
• Try pulling down to a negative voltage or a voltage greater than 30 volts. Commented Nov 27, 2018 at 18:55
• On which side do you need to detect the signal loss? On the transmitter or on the receiver. Hit the edit link under your question. Commented Nov 27, 2018 at 18:57
• You don't have an MCU on the receiver side? @ChrisStratton's answer seems to be "basic as it gets". Commented Nov 27, 2018 at 19:23
• I'm finding it difficult to imagine that the signal can be disconnected and yet you will still have a ground connection and a means of signalling back to the sender. What are you really doing? You may be on the verge of discovering why the 'live zero' of a 4 - 20 mA system is such a useful feature. Commented Nov 27, 2018 at 19:32

Since you need a TTL signal, I assume you have +5V available.

simulate this circuit – Schematic created using CircuitLab

You can generate the -5 with a 7660:

• This worked in my situation. I used a 555-based chargepump instead of 7660 since I have it on hand. Thanks to this and all other answer/suggestions which all helped. Commented Nov 29, 2018 at 16:05

Depending on the impedance of the source and how much you are allowed to load it, you might be able to do something like have the receiving device inject its own time varying signal into its own input through a very large series resistance.

If it sees a corresponding variation in the measurement, then it knows that the source impedance is also high; likely because nothing is connected.

This will mostly easily be done with a system that includes an MCU or is able to run software. But you can easily add one. A 34-cent (in quantity 1) ATtiny10 has an ADC and is available in a SOT23-6 package. Pay the distributor a little more to pre-program it with your code, give it a resistive divider for the input range and a a large output resistor for injection and you should have a solution.

And it is only possible where slight "back contamination" of the source is acceptable, ie, you wouldn't want to do it to a source also feeding other sensitive gear.

• That signal could be turned off once it detects that there is a connection, diminishing the back contamination issue. (and turned back on once in a while to re-check). Commented Nov 27, 2018 at 19:01
• Yes, that is included in the meaning of "time varying" :-) Commented Nov 28, 2018 at 2:19
• woops! pardon my ignorance :P (I'll leave the comment just in case anyone else doesn't know that) Commented Nov 28, 2018 at 3:23

If your source is of low-enough impedance, you can pull-to-the middle and have a window-detector to sense the fault condition.

Basically place a pull/up pull/down to a middle voltage (e.g., a resistive divider to 15V) and use a couple of comparators (or transistors) to determine if the signal is around that window, at 0V or at 30V.

• If the signal is digital that (time filtered to not trigger during transition) could work, otherwise 15v is a legitimate input voltage. Commented Nov 27, 2018 at 18:58
• Oh, I guess I misunderstood the question. In that case the only option I see is either some sort of out-of-band impedance detector, or a pull-down to a negative voltage (or to a voltage equivalent that is higher than 30V) Commented Nov 27, 2018 at 19:00

Are you allowed to choose a connector? If so, many (if not most) barrel jacks have a third pin for detecting whether the connector is inserted. Alternatively, you could use a connector with a few extra pins and have it short those pins together when inserted.

For the latter option, the following two methods come to mind: In the first, the sending end has two wires going to the connector, and the connector contains two extra contacts that are shorted together. The receiving end can sense when this connector is connected by checking if the two sense pins are shorted. The easiest way would be to tie one to ground and pull the other high on the receiving board.

The second method uses only one extra contact: since you'll most likely sense by shorting it to ground, you can just short it to the signal ground and sense when that connection is made in the same manner. This doesn't provide the isolation that the other method does, though.

simulate this circuit – Schematic created using CircuitLab

The downside to these is that they only sense if a cable is connected. You could in theory put the short on the sending end board, which would let you know that the sending end is on the other end of the cable, though. It still won't be able to detect every fault condition; the main advantage is simplicity.

An interesting problem:

I have assumed in this solution that a voltage divider is required to measure your 0-30VDC.

There are really only two conditions that exist.

1. 0-30VDC with the probe point connected (and the voltage source and load represent a low impedance). Under these conditions you need to present a divided voltage (I assumed 0-3V here) to an A/D convertor.
2. An open circuit on the probe point.

This circuit would seem to provide what is needed assuming you have an MCU sensing the measured voltage.

simulate this circuit – Schematic created using CircuitLab

M1 is normally always on, so the voltage divider R1, R2, R3 provide a 0-3V signal to an MCU A/D.

If and only if the input voltage read zero, you can turn off M1 and measure the voltage. If it is ~2.8V then the probe is open circuit. This is enough voltage difference to be sure it is open circuit and requires very little software change.

What about using relays? Put the 30V through the relay coil, input the 5v output of the MCU to the common and the io pin to read into the NO of the relay. When its disconnected it will trigger a high in the io pin

• This would also report disconnected when the signal level is too low. The question asks about an analog signal that can be anywhere between zero and 30V. Commented Nov 28, 2018 at 3:11