5
\$\begingroup\$

I need to detect if a load resistor is taken out of circuit. The load resistor is a photoresistor and can vary from 50k\$\Omega\$ up to 2M\$\Omega\$ and is driven by +5V to ground.

The approach I thought of was to put a small sense resistor between +5V and the load, and use a comparator to detect the voltage drop across the sense resistor. When current is flowing, there will be a drop across the sense resistor, one comparator input will be higher than the other and so the comparator output will go to (say) +5V.

When the load is disconnected, there is no drop across the resistor, and so the comparator inputs are (very close to) equal. However, I can't be sure if the output will switch to ground, since the output state of the comparator is undefined when the inputs are equal.

Is there a simple way to add a tiny offset so that the comparator switches at (say) \$ V_+ > V_- + offset \$? That would allow me to guarantee the comparator output when the inputs are equal. I don't want hysteresis here but just an offset to the point where the transition happens.

Alternatively, is there some other way to solve this problem? Basically, I want to detect the difference between even a small current flowing and no current flowing.

Edit: Especially to those who suggested the wheatstone bridge, what if the photoresistor varies from 50k\$\Omega\$ to 50M\$\Omega\$? At the higher end of that range, the two inputs to the comparator become very close to being equal again... If I use a gigantic (i.e ~50M) resistor (R3 in @markt's diagram) in the static arm of the bridge to compensate for the larger load range, then V- is going to be very, very close to rail; when the load is disconnected, the two comparator inputs are again very close to being equal to each other.

\$\endgroup\$
  • \$\begingroup\$ I think you need to tell us how the photoresistor will be connected to the rest of your circuit. You said you want to detect when the load resistor is "taken out of a circuit"...what sort of circuit? Are you trying to measure the light level or is this just an academic exercise? \$\endgroup\$ – Joe Hass Sep 16 '13 at 10:50
  • \$\begingroup\$ Not academic - real world :-) The photoresistor is acting as a light detector and is not physically on the same board as the circuitry. I'm trying to detect the situation where the light sensor is left disconnected. As far as the rest of the circuit is concerned, the photoresistor is part of a voltage divider which indirectly indicates the ambient light conditions. \$\endgroup\$ – Westerley Sep 16 '13 at 16:26
5
\$\begingroup\$

A good cookbook for op-amp designs (Application Note 31 - Op Amp Circuit Collection) can be found here from the former National Semiconductors (now part of Texas Instruments). On the lower part of page 26, you can find a current monitor circuit. It uses a small value sense resistor in series with the load, like your idea, to measure the current flowing through the voltage being dropped across the sense resistor.

http://www.ti.com/ww/en/bobpease/assets/AN-31.pdf

\$\endgroup\$
  • \$\begingroup\$ How does this circuit work? I see the drop across R1 caused by the load will get compared against the drop across R2, but what is Q1 for? \$\endgroup\$ – Westerley Sep 16 '13 at 0:03
  • 1
    \$\begingroup\$ @Westerley: there is no comparison involved. Q1 is controlled by the OPA to increase the current flowing through R2 in such a way that the voltages across R1 & R2 are the same. This way the current flowing through R3 is the same as the current flowing through R2, which has a fixed ratio to the current flowing through R1. A key to understand the circuit is that the current flowing through R2 is the same as the current flowing into Q1 (neglecting the input current of the OPA), which is the same as the current flowing out of Q1 to resistor R3 (neglecting the monitor output current). \$\endgroup\$ – Laszlo Valko Sep 16 '13 at 4:20
  • \$\begingroup\$ @LaszloValko Ah, ok! But with no feedback, doesn't the op amp swing from rail to rail (i.e. act as a comparator)? In which case Q1 would be driven off or on? \$\endgroup\$ – Westerley Sep 16 '13 at 5:26
  • \$\begingroup\$ @Westerley: there IS feedback! The output of the OPA controls Q1, which changes the resistance of Q1 between its Source & Drain, changing the current flowing through R3 & R2, thereby changing the voltage at the "-" input of the OPA. \$\endgroup\$ – Laszlo Valko Sep 16 '13 at 21:03
3
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Try this.

\$\endgroup\$
2
\$\begingroup\$

You probably need to use what is called a bridge circuit. This uses two limbs of resistors.

Here's a picture I just found that is similar to what you probably need: -

enter image description here

The comparator inputs connect to the mid points of the 2 limbs. It's called a wheatstone bridge if you want to look it up. Here is a link where I took the picture from.

This needn't run from +/-15V supplies providing you choose the right comparator or op-amp BUT watch out for leakage currents into the op-amp/comparator inputs if you are using large values of resistance.

\$\endgroup\$
1
\$\begingroup\$

With a 50 MΩ (presumably) dark resistance it will be very hard to differentiate between sensor present and an open circuit.

One option that might be worth considering is to mount an LED beside the sensor and pulse the LED periodically while simultaneously checking for a drop in resistance. If there is light on the sensor already the resistance will be low so it won't be necessary to blink the LED.

This solution requires at least one extra wire to drive the LED and due to the switching and checking it probably suits a micro-based project rather than a continuous analog-only circuit.

schematic

simulate this circuit – Schematic created using CircuitLab

You should probably check for short-circuits too while you're at it.

\$\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.