6
\$\begingroup\$

Here is revision 6 of the circuit. Hows it look? :)

(This is an ohmmeter circuit. It measures resistances from 1 to 10M ohm with an accuracy of 1%. The resistor (not shown) is measured between J5 and J6. The comparator goes to the wakeup pin of a uC. The uC then wakes up and takes a reading using the SPI interface on the ADC. )

enter image description here

\$\endgroup\$
6
  • \$\begingroup\$ Watch for leakage on your ESD protection. 3.3 nA will cause 1% measurement accuracy with 10 megohms resistance. \$\endgroup\$
    – markrages
    Commented Aug 30, 2012 at 15:37
  • \$\begingroup\$ Is the ADC by any chance an MCP3550? It's not mentioned on the schematic. \$\endgroup\$
    – stevenvh
    Commented Aug 31, 2012 at 13:58
  • \$\begingroup\$ Yes it is a Microchip MCP3550. I found it on Digikey. \$\endgroup\$
    – Bill
    Commented Aug 31, 2012 at 17:43
  • \$\begingroup\$ Should I put a weak pullup (like 100k) on the 1M transistor gate? That way it will be on when the uC is sleeping, pulling the comparator + to ground. Otherwise, won't the + float? \$\endgroup\$
    – Bill
    Commented Sep 1, 2012 at 4:49
  • \$\begingroup\$ The pullup is a good idea, though on second thought you could have left it the way it was, without U10 :-). You'll just have to keep R2 in mind when you calculate the resistor divider. (BTW, I would choose another refdes prefix for the FETs, like "Q"; "U" is usually used for ICs). \$\endgroup\$
    – stevenvh
    Commented Sep 1, 2012 at 6:17

2 Answers 2

10
\$\begingroup\$

Vref
Since you use the same voltage for the resistor divider and Vref the ADC reading will be independent of that voltage: if your ADC reading is 123 at 3.3 V it will also be 123 at 3.0 V. So the absolute value of Vref is not really important.

Nevertheless it's a good idea to have a Vref which is independent of other circuitry. In your schematic the 3.3 V is also used to supply the comparator and ADC with power. I would at least use an RC filter to get Vref from that 3.3 V. Like I said the actual value of Vref is not important, so you can afford some voltage drop across the resistor, allowing for a lower cutoff frequency.

Comparator
Your comparator may not work. Your reference voltage is at 0 V, which is the lowest voltage in the circuit. Many comparators have a built-in hysteresis, which means that the + input will have to go a bit below the - input to get the output low again, and you can't do that. Use a resistor divider to bring the threshold a bit higher, like around 50 mV.

1 % accuracy
Sorry, but this won't work at all. For the 1 Ω range you have a resistor divider of (10 kΩ + 1 Ω) | 100 kΩ. The 1 Ω is 0.01 % of the 10 kΩ it's in series with; if you want to know it to 1 % accuracy you'll have to start by knowing the 10 kΩ value to 1 ppm accurate. A 1 °C change in temperature will already drown the 1 Ω value.

Also the 1 Ω - 10 MΩ range is much too large for a single divider.

enter image description here

This graph shows the output of the divider relative to the ADC's full scale. Notice that the reading will hardly change between 1 Ω and 1 kΩ. Even with a 22-bit accurate ADC a 1 Ω resistor and a 1.03 Ω one will give the same reading. Note that 22-bit resolution doesn't mean 22-bit precision. Read the ADC's datasheet, and realize that 1 LSB is 0.25 ppm. Then everything matters: that 5 cm PCB trace may introduce more than an LSB error, for example. A 22-bit ADC doesn't help here. I would use different dividers for each decade.

edit re the updated circuit
You've got R1, R5, R7, R9 and R13 all in parallel giving an equivalent of a single 9 &Omega resistor. I wanted to add this about your R1 in the original circuit but forgot. It serves no purpose, it just reduces the measurement range for low resistances by 10 %. You can see in the graphs that you only go to 90 % of FS, and R1 is responsible for that. Ditch it. So that goes for the others I summed up as well.
R2 will always be parallel to one of the other resistors, so you either have to switch that as well, or remove it.

Your resistor divider voltage is still connected to Vcc. In order to have measurements independent of the voltage it must be connected to Vref.

The Si5406 you use is good: it has a low \$V_{GS(th)}\$ and \$R_{DS(ON)}\$. Note however that it has a leakage current of up to 1 µA, which will distort especially your high resistance measurements. (It's one of the things which makes precision measurements so hard.) Other FETs don't do much better, though: even so-called "low leakage" FETs may have a value around that, albeit at higher \$V_{DS}\$. A solution may be to use reed relays instead of FETs.

edit: Fine-tuning and some final thoughts
I know, adding FET U10 was my suggestion, but I changed my mind: we're going to remove it again, and use a fixed 1 MΩ resistor there. Not only does it saves us a part, but there was also the FET's leakage current: we don't have a good value for the equivalent resistor it represents, and when we use a fixed resistor we know what we have.

I also played a bit with the different dividers, and found that we only need two: the 100 Ω and the 10 kΩ.

enter image description here

The left part of the graph shows the ADC's input relative to FS with U6 switched on, the middle part with U8 switched on, and the right part with neither, just the fixed 1 MΩ R2.

enter image description here

This graph shows the difference in ADC reading for a 1 % difference in resistance value. For example a 100 Ω and a 101 Ω resistor give a 10 000 count difference, that's more than 13 bit! Even worst case, for 1 Ω and 10 MΩ the difference is more than 256 counts, or 8 bit. This means that we could have used a 14-bit ADC here as well. The 22-bit isn't bad, though: it's a sigma-delta, which suffers less from noise.

To get your required 1 % precision there are some things which still need to be looked at. First the resistors for the divider have to be precision parts, obviously: 0.1 %. There's still the FET's leakage current, which may cause a large error in the high resistance values. You mention a price of 5 dollar for the reed relay, but I found some, also at Digikey, which are only 1 dollar, and now you'll only need two of them anymore. They do need 5 V however, or at least 3.75 V.

Other leakage currents. For the comparator take a CMOS version, then input bias current will be negligible. But the ADC has a differential input impedance of 2.4 MΩ typical. If it were a fixed resistance we could just take it into the calculations, but it's very much unknown, so we better use a CMOS buffer opamp for the signal there as well.



edit re revision 4
If you swap the inputs of the comparator you won't need the inverter, and pull-up resistor R14 isn't needed either if you use an MCP6541 comparator, which has a push-pull output.

I'm a bit confused by the 74ABP04 buffers to drive the relays. The pin numbers don't agree with the datasheet and pins 1 and 4 look like enable pins, which the '04 doesn't have. I would have used common NPN transistors there anyway since they're a lot cheaper. You would only need P1.2 and P1.11. 4.7 kΩ base resistors will give you 0.5 mA base current, enough for the reed relays. Don't forget the diodes across the relays' coils.

The offset voltage of the buffer opamp is indeed a problem. I found the MCP6071, which has a very low input bias current (1 pA typical, 100 pA maximum), but the offset voltage is still 150 µV. The feedback from output to inverting input should also have the same impedance as the impedance on the non-inverting input, but that's not constant. You can trim the offset away with a potmeter and a high series resistance like 100 kΩ to the inverting input.

Don't forget decoupling capacitors for the comparator and ADC's power supplies.



edit re revision 5
Almost there! The resistors in series with the relays aren't required; the relay coil's resistance limits the current, and besides, the series resistance will lower the coil voltage so that the relay may/will not activate. I would take the comparator's input from the buffered output, so that the resistor divider only sees the buffer's input. And the offset trimmer will work, but be too sensitive to the slightest turning of the trimmer. Reduce the sensitivity by placing a 470 kΩ resistor between the pot's wiper and the opamp's inverting input.

\$\endgroup\$
9
  • 1
    \$\begingroup\$ What software did you use for the graphs? That seems pretty handy. \$\endgroup\$
    – Bill
    Commented Aug 31, 2012 at 3:41
  • \$\begingroup\$ @BSEE - Mathematica \$\endgroup\$
    – stevenvh
    Commented Aug 31, 2012 at 7:25
  • \$\begingroup\$ Major oops on the parallel resistors. What was I thinking? I don't know. The purpose of R2 to ground was to have a voltage for the comparator when the probes were used. \$\endgroup\$
    – Bill
    Commented Aug 31, 2012 at 23:37
  • \$\begingroup\$ I checked Digi-key for reed relays and they are around $5 each. I think the best bet is to lower my accuracy target for small and large resistances. \$\endgroup\$
    – Bill
    Commented Aug 31, 2012 at 23:50
  • \$\begingroup\$ I was looking for SMD reed switches but found the TH ones you mention. I found a 74ABT buffer part to drive the reed switches but I am not sure what to look for in the ADC buffer. I assume an op amp follower with ultra low distortion and CMOS inputs. Is that correct? \$\endgroup\$
    – Bill
    Commented Sep 3, 2012 at 22:41
1
\$\begingroup\$

Stabilizing Vref is mandatory if you want accurate, stable readings. Also, I don't see any decoupling capacitors there but it's also true I don't know if this another board or just a piece of a larger one; still, they're needed. The ICs supply may not need it as much as the probes do, so a stabilizing IC should be used (LT1084-3.3 for example). As for the capacitors for stabilizing, you could add one in parallel with R2, but also with an anti-parallel diode, a BAT54 will do (or 1N4148, depending what minimum values below GND the ICs accept, see their datasheets).

\$\endgroup\$
2
  • \$\begingroup\$ I am not sure I understand. For the LT1084 suggestion, I have a regulator that takes the battery voltage 4.8V to 3.3V. What is the purpose of the diode? \$\endgroup\$
    – Bill
    Commented Aug 31, 2012 at 18:52
  • \$\begingroup\$ For discharging any potentially unwanted voltage across the capacitors. A capacitor in parallel with R2 should also have an anti-parallel diode with anode to ground. But that's only if you decide to add them, that's why I said "could". (edit) I see the schematic has changed, the link took me directly to the reply. The diodes are not neede anymore since the MOSFETs have one, each. \$\endgroup\$
    – Vlad
    Commented Sep 1, 2012 at 5:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.