0
\$\begingroup\$

I am using a DC jack which has 3 pins. 2 for power and one pin which is connected to ground when there is nothing plugged into the jack and disconnected from the ground when the jack is plugged in.

I need a way to know wheater the jack is plugged or floating(ie. is this pin connected to ground or floating). I was thinking about large pull-up resistor from that pin to the positive voltage, but still unsure about that. It would create small current flowing from gnd through a resistor to positive voltage. Is that okay stuff to do in a system?

I am using LM393 to detect this voltage. Can't figure out what resistor value to choose. Positive voltage is at 17V, so 47K resistor would result in 0.36mA leak - not little and still unsure if LM393 would detect it.

(jack input is not only power input, there are batteries inside, so current would flow through this resistor on all times when jack is not plugged - draining the battery).

Are there any better ideas than pull-up resistor?

\$\endgroup\$
3
\$\begingroup\$

To expand on @Jon's answer, something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

95% of the current is consumed by the comparator (lower power ones are available).

R2/R3 set up a reference voltage of about 8.5V. When the switch is closed the voltage on the inverting input is about 2.8V and the output is high. When the switch is open the voltage rises to about 17V and the output is low. Response time is about 20ms (open) or 5ms (close).

\$\endgroup\$
3
\$\begingroup\$

If a current isn't flowing, there is no way to know whether the pin floating or connected to something. Just put a much bigger resistor - say 470k - and a small 0.1uF cap to prevent noise from causing false triggers. That should reduce power consumption to the point where it is no longer relevant (depending on your specific application of course).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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