Threshold detector?

Thread Starter

snav

Joined Aug 1, 2011
115
I have a bias circuit that I want to put indicators on. The bias would be set for .7vdc +/-50mv and I'd like to have a green indicator on when it is within range. Also, and more importantly, I need to have a red indicator when the difference between two bias points is out of balance by more than 10mv. I have a readily available 8v supply and could provide a different voltage if required. If not to much added complexity, the setpoint/hysteresis for the bias should be variable.
 

wayneh

Joined Sep 9, 2010
17,496
This is a perfect application for a comparator, such as the common LM339 quad comparator. You'll just need to establish your reference voltage using a reference source and a resistor voltage divider. The source can be your 8V supply if it's regulated at 8v, or a zener diode, or a 7805 regulator, or a dedicated voltage reference IC. The latter may be the best choice to avoid drift and temperature changes.

Then just compare your voltage to the reference and use the comparator's output to do whatever you want. You need to pull the output up with a 3.3K resistor, and it can only sink ~5mA when it goes low. That's plenty to light an LED. If you need more current, use a MOSFET and drive its gate with the comparator.

The datasheet will demonstrate how to control hysteresis.
 

Thread Starter

snav

Joined Aug 1, 2011
115
I looked at the LM339 and don't know how to get detection so close to zero or whether I need to use one for each input. Would using a negative supply in addition solve that? For the bias level I could use a forward junction with a current limiting resistor for reference. Absolute precision is not required as the current method of adjustment is a rheostat.
 
Last edited:

#12

Joined Nov 30, 2010
18,224
The 339 chip allows inputs as low as zero point zero volts.
Using a forward junction for the reference voltage is asking for temperature drift problems. Even a resistive divider is better than a forward junction.

I think you are describing 2 window comparators. This is getting to the point that a schematic is necessary for proper answers. Can you please provide one?
 

wayneh

Joined Sep 9, 2010
17,496
Yes, it would be no problem to sense at 0.65 and 0.75V. As suggested, I'd use two comparators for the two levels - a window. The outputs can be ORed together, so I guess you'd use that to detect a fault - voltage too high at one comparator or too low at the other.

The hysteresis then is the slop around those two setpoints. In my experience, the LM339 will have about 5mV of its own hysteresis. That value can then be increased by the choice of the feedback resistor, and this tends to stabilize the switch from one state to another. The datasheet shows 10MΩ but I get smoother behavior at 5M or lower resistance.

Just for a starting point, here's a comparator circuit I used to detect the presence of the load, as shared recently here with another user. This arrangement will be "off" for an open circuit but will detect even your finger as a continuity, and turn on.
Picture 1 10-23-44.png
 

Thread Starter

snav

Joined Aug 1, 2011
115
This is the full circuit selected from a pdf, I hope it's readable. The bias adjustments start at R12-RV1 back through O/P at CN2. The midpoint of CN3 is gnd and the bias voltage is from the bias resistor(s), one side grounded, of 10ohms@70ma, each terminated at CN2. I an isolated 9v supply which I could use to derive a bipolar supply. the idea is to have a constant green showing bias in range and a red for balance out of range.
The previously mentioned 8v supply is unavailable for use without major design changes. Hope this helps
 

Attachments

Thread Starter

snav

Joined Aug 1, 2011
115
For some clarification, RV1 provides bias adjustment, and RV2 Provides balance. The bias voltage(s) at CN2 are positive with respect to gnd. My indicators would take their inputs from CN2.


The caps at C10 and C11 are correctly connected for the power supply to the main circuit.
 

Thread Starter

snav

Joined Aug 1, 2011
115
As I understand these replies, two comparators with a Vref set to the desired Bias point would be needed to create a 'window' for the bias indicator, and the incoming bias of one side would become the Vref for two other comparators to provide the out of balance indicator window. I am concerned about the effect of out of tolerance inputs on the comparator prior to adjustments.
 

wayneh

Joined Sep 9, 2010
17,496
I am concerned about the effect of out of tolerance inputs on the comparator prior to adjustments.
Anything at the inputs that is between the power supply rails is fine, and I think you should design to keep the inputs in that range. The IC can be powered up to 36V (or ±18). I believe you can make differential comparison to within ~2V of the positive rail and very close to the negative rail.
 

wayneh

Joined Sep 9, 2010
17,496
As I understand these replies, two comparators with a Vref set to the desired Bias point would be needed to create a 'window' for the bias indicator, and the incoming bias of one side would become the Vref for two other comparators to provide the out of balance indicator window.
Here's a standard setup as described in the datasheet. Note that it uses two references, one high and one low.
Picture 1.png

Here's another view
ComparatorWindow.gif
 

Thread Starter

snav

Joined Aug 1, 2011
115
Assuming that the bias setpoint is +/- 50mv then using the actual bias voltage is required for the balance Vref which has a tolerance of +/- 10mv. How would I establish a window around that variable setpoint.
 

wayneh

Joined Sep 9, 2010
17,496
In the second diagram I posted, you can choose R1,R2 and R3 to give any setpoint and window you want. You could also make them all variable.

If you can live with a slightly variable window, I think you could make just R1 (or just R3) variable and choose R2 to give you the "typical" delta of 50mV. Varying R1 (or R3) to adjust Vref will cause that window to move but also to change slightly in size, for instance from 45 to 55mV, but maybe that's OK?
 

Thread Starter

snav

Joined Aug 1, 2011
115
I think a variable bias window is fine. Often the bias is set at .56 to extend the life of the system. .7 is factory spec. Thank you for all your help.
 
Top