Electronic – Detecting an open circuit by sensing current flow using a shunt and comparator

comparatorcurrentoperational-amplifiersensor

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.

Best Answer

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