Thursday, 2 August 2018

sensor - Detecting an open circuit by sensing current flow using a shunt and comparator



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.




No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...