# Resistance comparison

Status
Not open for further replies.

#### alok1982

##### Member
Dear All,

I am making a circuit which compares the ferrite insulation resistance.

Working/ Aim of the circuit:

Using comparator I am comparing the voltages of divider network. If resistor R7 is more than 100Mohm then the test is pass. A green LED will glow.

If R7 is less then 10Mohm, the test will fail and RED LED will glow.

IF R7 is not connected to the test-point, then ORANGE LED will glow.

Actually R7 is a resistance of a ferrite. I am developing this circuit to compare the ferrite insulation resistance.

Attached schematic I snipped from LTspice, where I tried simulations. We can see voltages available at different nodes.

First schematic : Comparator with test point resistor (R7) connected.

Second schematic : Comparator with test point resistor (R7) not - connected.

Issue

Problem is with the circuit when I remove the R7 resistor.

Both GREEN and ORANGE LED become ON. I only want ORANGE to be glow.

I know when I remove the R7 the resistance, at that node resistance become infinity so, the GREEN LED will glow.

For R7 open condition I just want to glow ORANGE LED.

Please guide and suggest changes in schematic .

Thanks.

#### Attachments

• 55.6 KB Views: 68
• 55.2 KB Views: 57

#### ronsimpson

##### Well-Known Member
First thing I see:
With R7 missing:
U3 sees about 0 volts from + to - inputs.
U3 has a job. Compare. Is (+) higher or lower than (-)?
When the two inputs are the same it has a hard time. The output might be high or low.
I think you need to add a small voltage to the (+) input.

#### ronsimpson

##### Well-Known Member
Another thing to remember is that the LT1017 is not perfect. Either is my spelling. lol
"Input offset" might be as high as 1mV max 0.4mV typical. (at 120C it might be as high as 1.4mV)
What is input offset? When the compare is done, the IC might see one input 0.4mV higher than it really is. (or 0.4mV lower)
There is an error of typically +/- 0.4mV. (real parts) (SPICE probably does not show this)

Also look up input current. It takes 5nA to run the input. 7nA worse case. (maybe as high as 25nA over temperature range)
Then one input will need slightly more or less current than the other. (off set current)

More on post #2. You really can't resolve voltage differences as low as 1mV. You need to change your circuit so that the difference between condition 1 and condition 2 cause a (greater than 1mV change on the input of U3)

#### Misterbenn

##### Active Member
I also think that your red led will come on as soon as your R7 resistance is lower than 99.9Mohms. You need a separate voltage set point for that function.

As Ronsimpson says, you need a 1mV voltage on the U3 + input, so use another voltage divider or similar to get that. Be aware that all these voltage dividers will make the circuit quite prone to drift so you might want to do a tolerance analysis if this is for production tests.

The green LED will come on whenever the resistance is >100Mohms so when your remove R7 of course the amber and green LED come on together. To get around this you should add some kind of NAND function to the U2 output, so that when U2 and U3 outputs are high the green LED is off. This could be done with a NAND gate or by adding a PNP transistor driven by U3 on the positive supply side of the green LED

Last edited:

#### AnalogKid

##### Well-Known Member
I know when I remove the R7 the resistance, at that node resistance become infinity so, the GREEN LED will glow.
For R7 open condition I just want to glow ORANGE LED..
From the circuit's point of view, those two conditions are exactly the same. The problem as I understand it is that you want to detect a middle state that is greater than 120 M and and less than infinity. If this is correct, then here is another approach.

Increase R12 to 50 M. Now the test divider string is Vcc - R5 (10 M) - R7 - R12 (50 M) - GND.
Bring the R7 - R12 node out to an extremely high input impedance voltage follower. It's output now can be run to conventional opamps or comparators in a window comparator configuration. Here are the comparison windows for Vcc = 12 V:
Bad part (less than 10 M) -- 8.57 V or more
Good part (between 10 M and 120 M) -- between 3.33 V and 8.57 V
Open part (greater than 120 M) -- less than 3.33 V

These are very easy values to detect, and large enough to swamp out offset errors.

ak

#### ronsimpson

##### Well-Known Member
alok1982,
I hope you do not take this wrong but I have more to say.
1) most voltage compare ICs; the output only pulls down, does not pull up. So a pull up resistor is often added. You chose a part that can pull up a little. 2o to 50uA. Yes micro amps. As you can see in SPICE the output voltage is less than a volt. If you use a different part when you build this the project will not work because most parts do not pull up.
2) Post #4; new transistor! Because the output of U3 will never get "high" the new transistor will never be turned off. (cleaver ides but will not work)
3) You could remove the transistors and drive the LED+resistor directly. (the logic will need to be reversed)

4) There are 3 states.
input<10M---Red
100M<input<1G--Green
input>1G---Orange

10M ohm...1uA....OK
100M ohm 100nA...now the "input current" will cause some errors.
1G ohm 10nA "input current" is a real problem.

Last edited:

#### MikeMl

##### Well-Known Member
I would reconsider how you make the basic Ohmeter. Here is a much better way to go:

Note that V(out) is well behaved in the region where R1 is ~10meg, and again where R1 is > 100meg, even when R1 is open .

You should be able to build a window comparitor that works reliably because the trip points are stable. U1 should have low input bias currents. DigiKey has lots of precision high-value resistors to use for R2

#### ronsimpson

##### Well-Known Member
U1 should have low input bias currents.
Input protection.
From experiance; input protection diodes add too much error.
Adding a resistor (and cap) will limit the input current to a safe level.

#### MikeMl

##### Well-Known Member

Note that the LT1017 is sinking current, not sourcing...

No circuit can discriminate between "no leakage" and "not connected", because there would always have to be some leakage if connected. I do not believe that is the case...

You will have to add a mechanical sensor switch or opto-beam break detector to tell if a ferrite is installed in the test fixture, or not!

#### Attachments

• 3.7 KB Views: 29
Last edited:

#### ronsimpson

##### Well-Known Member
LMC7221 input current 0.04pA
MAX9040 input current 1pA
If you want to stay with LINEAR so SPICE will work.
LTC1042 input current 300pA

#### alok1982

##### Member
Thanks guys for inputs. Implemented the changes suggested by you. I got output. Now circuit is working well.

#### alok1982

##### Member
Please find attached here with the LTspice simulation file. Which is working.
Please check and suggest if any enhancement has to be implement.

If resistor R10 is more than 149Mohm then the test is pass. A green LED will glow. (Now I changed the requirement from 100Mohm to 149Mohm).
If R10 is less then 149Mohm, the test will fail and RED LED will glow. Buzzer will also ON.
IF R10 is not connected to the test-point, then ORANGE LED will glow. Buzzer will also ON.

Also, included piezo buzzer in the schematic. In simulation using 0.014A current source as buzzer.

#### Attachments

• 7 KB Views: 41

#### MikeMl

##### Well-Known Member
[QUOTE="alok1982, post: 1298491, member: 71759"...
Please check and suggest if any enhancement has to be implement.
...[/QUOTE]

We did, and you ignored every one!

Your most serious mistake is that the LT1017 cannot source enough current to properly turn on the NPN transistors. I showed you how to eliminate the NPNs altogether.

You never resolved this problem: "No circuit can discriminate between "no leakage" and "not connected", because there would always have to be some leakage if connected. I do not believe that is the case...

You will have to add a mechanical sensor switch or opto-beam break detector to tell if a ferrite is installed in the test fixture, or not
!"

#### alok1982

##### Member
Can I use LM393? Or please suggest any other comparator which suits my requirement. It should source enough current to turn ON the transistor.
Q2 and Q4 I am using as NOR gate. For this instead of using transistor can I us any NOR gate IC?
Please check the LTspice simulation file again (posted yesterday) and suggest any other changes if there.

#### ronsimpson

##### Well-Known Member
Can I use LM393? Or please suggest any other comparator which suits my requirement. It should source enough current....................
Your most serious mistake is that the LT1017 cannot source enough current
most voltage compare ICs; the output only pulls down, does not pull up.
I know it is hard to find on the datasheet but it source current = 0!

You need to get a datasheet. Usually all companies make the part the same but this part is a little different from company to company. Also there is a "A" version that you want.
This is how the LM393 is made. Look at "Vo" it only pulls down! No pull up.

The part will not work right if both inputs are (below 0 volts or above 10.5 volts) [on a 12V supply]

You are trying to move from a good part to a very old part.
LM393(not A) could have a input offset as bad as 5mV at room temperature and 9mV over 0 to 70C.
LM393A is limited to 2mV max, 1mV typical at room temp.

Also look at input bias current. (the IC pulls up a little on its inputs)
LM393 20nA typical but 250nA max at room temp.
LM393A 20nA, 100nA max at room temp.

Repeating:
Input bias current, LM393 there is an error of 5 to 250nA injected into your unknown resistor. Can you live with that? Do the math.
Are you certain that U1 never has a case where both inputs are not above 10.5 volts? Do the math.
LM393 can not pull up! No math required. lol

#### alec_t

##### Well-Known Member
Be aware that with such high input and test resistances the least contamination (finger prints, moisture, flux residues etc) of the setup may well skew your results.

#### MikeMl

##### Well-Known Member
The '1017 will work, but you have to understand how to apply it. First, look at this:

Note that the commercial LT1017 is spec'd to sink 25mA, while it can only source 25uA. Now 25mA is enough to light an LED directly if the LT1017 is used to sink the LED current as I showed in post #9, above.

If a 2N2222 is used to sink the LED current as you show, then the LT1017 must be capable of sourcing the base current of the 2N2222. According to the 2N2222 data sheet, it requires 2mA of base current to fully turn-on (as a saturated switch), but the LT1017 can only source 25uA.

To take advantage of theLT1017's current sinking ability, look at what I did in the circuit I posted in #9, above. Notice that U2 drives D2 and its current-limiting resistor R7 without an intervening NPN! Look at how the - and + inputs of the comparitor are used. Compare that to how the inputs of U1 are used.

Last edited:

#### alok1982

##### Member
Thanks for guidance!
So I am now fixed with LT1017. Will not use 2N2222 or any other transistor.

Just as a doubt; want to ask can I pull up the LT1017 output?

Also, can I use a 14mA buzzer parallel to LED, if LED glows a beep sound also we can hear?

Q2 and Q4 I am using as NOR gate. For this instead of using transistor can I us any NOR gate IC?
Please check the LTspice simulation file again (posted yesterday-Not modified schematic) and suggest any other changes if there.

#### MikeMl

##### Well-Known Member
...
Just as a doubt; want to ask can I pull up the LT1017 output?

Also, can I use a 14mA buzzer parallel to LED, if LED glows a beep sound also we can hear?
....
You can place a pull-up resistor between the comparitor output, and the plus supply line. If the comparitor output is low, it will sink the current sourced by pull-up resistor, as long as it is less than 25mA.

But why would you want to do that, if you can just reverse the comparitor inputs?

What kind of buzzer? Post a link or its data sheet.

#### Attachments

• 227.8 KB Views: 44
Last edited:
Status
Not open for further replies.