# How can I minimize the variance in voltage drop across transistors - or eliminate transistors from this design?

I have a fairly simple circuit that I'm using with an arduino to measure the impedance on a very low-resistance circuit. The user plugs in a device at A and B and the arduino can compute the resistance across the user's device by measuring the voltage at A. No resistance on the user device means I read 0V, infinite resistance means I see about 1 volt. The most common user device will register about 1 Ohm. (For the sake of anyone familiar with arduino, I use the internal voltage reference so that 1V reads near the max for analogRead.)

+5V
|
z
z 220 Ohm Resistor (.1% tolerance)
z
|
A----------------------------------------\
|                                        |
z                                        |
z 47 Ohm Resistor (.1% tolerance)        |
z                                        |
|                                        |
|                                        |
GND---------------------------------------B


The trouble is that the circuit has to measure multiple user devices at the same time. I can't just replicate this chunk of circuit 3 times because changes on any one of the user devices will affect the values read on the other arduino input pins.

My solution to this was to put a transistor between 5V and the first resistor and compensate for the voltage drop across the transistor by choosing a smaller resistor. This makes the circuit look like this:

+5V
|    (Worst ASCII art transistor ever)
\
\|   1K Ohm
|-----NNN---- (To Arduino Pin to select this channel.)
/|
/
v
|
|
z
z 150 Ohm Resistor (.1% tolerance)
z
|
A----------------------------------------\
|                                        |
z                                        |
z 47 Ohm Resistor (.1% tolerance)        |
z                                        |
|                                        |
|                                        |
GND---------------------------------------B


This circuit gets replicated once for each user input. This works, but my input values are unpredictable because the voltage drops across the transistors isn't consistent. (A measurement of 27 on one channel might equal a 2 Ohm user device, while that same device on a different channel might read 47. A 10% jitter I could tolerate. Greater than 60% renders the project unusable.)

I don't think that I can get transistors that will be in the neighborhood of .1% tolerance without paying a fortune (assuming I can get them at all.)

Because the math is being done on the arduino, I can't easily take 3 measurements (using the transistor-free design) and solve the simultaneous system of equations fast enough. (I'm looking at 500 to 1000 measurements of all three channels every second.)

Is there any way to salvage the project?

• Welcome back. FYI. We now have a CircuitLab schematic editor on EE.SE. There is a Schematic button on the toolbar, when you edit the question. So, no need to do the ASCII art, unless you like it. May 8, 2014 at 21:11

No, I don't think you are looking at this correctly at all. If your 5V is stable then there is nothing wrong with your method using fixed resistors and no transistors. The problem is that each ADC input on your MCU has a different error voltage. Check out the dc offset error potential in the data sheet. Here is a typical example from maxim covering the offset error on ADCs and DACs: -

Around 0V, the error could be +/-50mV. In a perfect system, a 1 ohm resistor fed from 5V via a 150 ohm resistor produces a voltage of 33mV - you got a digital value of 27 and, assuming your ADC is 10-bit then 27 represents 132 mV - how do you rationalize this? Forgive me if it isn't a 10-bit ADC but, if it were 12 bits then 27 represents 32.9mV (possibly coincidentally of course) but 47 represents 57mV!!! Assuming they are all 1 ohm resistors and accurately matched (or you used the same resistor on a different channel) you have to conclude you are witnessing ADC offset error in action.

You don't show what kind of transistor (NPN Or PNP) you're using, but the implied 1.75V drop makes me think it's an NPN emitter follower.

You want a high-side saturated switch. You could use a P-channel logic-level MOSFET or you could use a PNP transistor such as a 2N4403/MMBT4403 with maybe a 1K base resistor. The 3mA or so base current will give you a saturation voltage of about 85mV that should be consistent within about 20%, so that's a variation of about +/-0.3% in current. With a MOSFET you can easily get down to 0.1% by choosing a logic-level p-channel MOSFET with an Rds(on) of less than 200m$\Omega$ over temperature.

In both cases, low = 'ON' so you'll need to reverse the logic.

Use a P-channel FET with an RDSon that is very small compared to your resistor values. If this isn't for production you could even use a device with a few mOhms of on resistance.

• Curious, what does "for production" or not affect whether the OP can use a FET with a mOhm(s) resistance? May 9, 2014 at 2:47
• @tcrosley It's just that it's overkill. They will be larger and more expensive than necessary for the function, but if it's a one-off type of thing it removes the need to optimize price/performance. May 9, 2014 at 3:34

replace point 'v' with a resistor and then a zener to ground that makes a new voltage reference (lower than 5v) - you'll lose just under 2v in the switching transistor so chooses a resistor that leaves a voltage just a bit above 3V (so the zener kicks in) maybe something in/around 30ohms or so (play a bit, it depends on the transistor you choose)

The ADC doesn't measure a voltage. Well, it does, but that's not how it does it.

That ratio happens to be in terms of a voltage, so yes, you measure voltage with it, but you're really measuring a ratio of voltages (namely, with respect to AREF).

And you're measuring a voltage ratio here, so that seems particularly well suited!

Ponder on this a bit.

If we're measuring voltage ratios, how can we best use the ADC?

Instead of using an internal reference, use an external reference. Use VDD (+5V). Preferably, even, use the top end of the voltage divider. (This would be very awkward, wiring AREF to a switched node, though!)

Or if using any arbitrary reference, take the ratio of ratios, so that the reference is cancelled out. This suggests sampling the voltage at the top of the divider (switch collector/drain*), then sampling across the load. Optionally you can sample "GND" as well, because it won't actually be exactly GND in general (it has resistance, too!), and subtract it from both prior measurements (before then dividing), nulling any offset. This makes a 4-wire measurement, assuming the measurement points are connected close to the DUT (thus avoiding contact resistance to the internal divider).

*Assuming PNP / P-ch type; see other comments.

~20 counts is also a rather poor measurement (1 LSB is a whopping 5% of the measurement), which, if that's enough for what you're doing, there you go; but it wouldn't make a great milliohmeter, say. Consider adding an op-amp to increase the sense signal (it can also be used to subtract the ground error signal), or using an Arduino with gain options (I don't know offhand what Arduino-supporting boards have this, but offhand, ATXMEGA family MCUs have quite flexible gain options, and probably some of the ARM based MCUs do too). Could also consider using an external ADC, to get higher accuracy -- this can extend your noise floor from several ~mV to several ~nV(!). Almost certainly overkill here, but surprisingly not much trouble (a \$5 ADC) for what they can do.

Alternatives are available with different speed/cost tradeoffs. For processing speed you can offload to a secondary processor. There are a few alternatives such as a Raspberry Pi Arduino Hat or alternatives up to the Arduino Portenta H7. At another extreme you might look at the Digilent Cora Z7 Zynq-7000 Dual Core Option for ARM/FPGA SoC Development. Suggest you have a look at the Analog Devices MAT14ARZ Quad NPN Transistor as one solution to your matching problem.