# Current Drain on ADC

I am looking at a MCP3008 datasheet and it says that it has a maximum current drain of 150uA, and a typical current drain of 100uA.

I am building a voltage divider to knock down 96V to 3V. As this is for a solar car, I would like to reduce the amount of current and power used. I would like to be able to read a maximum voltage of 115V, and a minimum of below 75V, and be able to waste the least amount of power nessassary. How does the current drain factor into my calculations?

My calculations are as follows:

• Using ohms law with E=115V I=0.00015, I get 76666 ohms
• Using a voltage divider I get R1 = 76666 and R2 = 2053.55

Are my calculations correct? Can I knock more power out of this circuit?

-
Do you want to map a [75,115] V range into a [0,3] V range? Also, the current drain specified is for the REFERENCE input. Do you want to apply a variable voltage such as the [0,3] V range to the reference input? Why? –  Telaclavo Apr 20 '12 at 9:39
@Telaclavo: well observed about the current. Edited my answer accordingly. –  Federico Russo Apr 20 '12 at 13:58

If you want to express resistor values in 5 significant digits you should at least start with the right voltage:

$\dfrac{115\mathrm{\,V} - 3\mathrm{\,V}}{150 \mathrm{\, \, \mu A}} = 746667 \, \Omega$,

and the other resistor will be 20 k$\Omega$.

Anyway, the values you used will get you 1.5 mA, not 150 $\mu$A. And even with 10 times higher resistor values you won't get 3 V, since the input current to your ADC is actually a resistor parallel to the 20 k$\Omega$.

$\dfrac{115\mathrm{\,V} - V_{OUT}}{746.667 \, k \Omega} = \dfrac{V_{OUT}}{20 \, k \Omega} + 150\, \mu A$

Or $V_{OUT}$ = 78 mV. (1.5 mA would leave 2.7 V.)

Don't feed the divided voltage directly to the ADC, but buffer it first using a voltage follower opamp. Then the 150 $\mu$A won't load the divider, and you can safely use higher resistor values, > 1 M$\Omega$.

edit (see Telaclavo's comment)
I didn't look at the datasheet at first, I trusted the 150$\mu$A was a correct value. ADCs do often have a low input impedance. However, checking the datasheet, Telaclavo is right, the 150$\mu$A refers to the reference input (page 3). On page 4 you can see the input leakage current for the analog input: 1$\mu$A maximum. That means the ADC has to have a buffer for the input signal.
Anyway, this changes things fundamentally. Suppose you choose the resistors so that they'll draw 100$\mu$A: 1.12M$\Omega$ + 30k$\Omega$.

$\dfrac{115\mathrm{\,V} - V_{OUT}}{1.12M \Omega} = \dfrac{V_{OUT}}{30 k \Omega} + 1 \mu A$

Then $V_{OUT}$ = 2.97V. That's for a worst case input current of 1$\mu$. If you would use an LF411 as buffer, which has an input current of 50pA, the output would be 3V for both the typical leakage current of 1nA, and the maximum of 1$\mu$A.

-
You'll want some way of calibration too, either in software (which I would prefer) or in hardware (a small potmeter in the voltage devider). The values you read from the datasheet are typical / max. values and they will differ from device to device. You can't build a reliable measurement fromt that. The opamp is a good option. –  jippie Apr 20 '12 at 7:02
An opamp is already included in the circuit, but good catch. –  Reid Apr 20 '12 at 7:11
@Reid if it helps in reducing leaking, an additional opamp can still be good –  clabacchio Apr 20 '12 at 7:40
@Reid: if you use the buffer then there's absolutely no need to calculate the divider for 150uA. Even if there flows only 1uA the opamp will supply the necessary current to the ADC. –  Federico Russo Apr 20 '12 at 7:42
@FedericoRusso consider that also the buffer will leak something –  clabacchio Apr 20 '12 at 8:41
show 6 more comments

The calculations are wrong, but you are also using in the divider the same leakage current of the ADC. Now you have about a 100% error, but you want something better.

So if you want to save power, it would be better to use a current ten times bigger (1 to 10 mA), so the error due to ADC leakage will be smaller. And you can consider also the leakage in the equation, so reducing the error.

Consider a circuit like this:

You want 3V over R2, so you'll have 112V over R1; at 1 mA, you need a 112KOhm resistor.

With this circuit, you will still have an error depending on the leakage of the ADC (measure it for the best accuracy) (1uA over 1 mA is about 0.1% error), but the consumption is limited, as 1mA in a car application is acceptable.

Note that in this case, the power dissipated by R1 is 112 mW, which is close to the limit if you use 1/4 W resistors; consider using 1/2 W ones.

But also the buffer solution suggested by Federico is good: if you can, use an amplifier.

## Update according with real datasheet values

Since leakage is only 1 uA, you can also scale down the current to 100 uA while having 1% error, which is good enough considering the use of 1% resistors.

-
If the calculated resistor current = ADC current the error won't be 50%, but nearly 100%: 2.6uV! –  Federico Russo Apr 20 '12 at 8:22
True :) but the reality is that's useless anyway –  clabacchio Apr 20 '12 at 8:40
Er, 2.6uV will be 78mV with the corrected resistor value of 746k instead of 766k. –  Federico Russo Apr 20 '12 at 9:05

As the other guys suggested, adding an op-amp as a follower is quite a good idea, but you can do just as well by adding a small capacitor, about 0.1uF.

The ADC has a small internal sample capacitor which is charged up to the input voltage during the sample period.

If you have 2-channel an oscilloscope, it is well worth carrying out the following experiment. Put one channel on the analog input of the ADC (AC coupling, reasonably high gain), and put the other channel on the CLK input to the ADC (DC coupling, 2v/div).

What you may see is that at the sample period, the ADC input droops slightly as the internal capacitor is charged. If the signal hasn't come back up to its normal level by the end of the sample period, then you are not going to get an accurate reading, and will likely also get a noisier reading.

The reason it droops is that you don't have enough current from those high value resistors to charge the internal capacitor during the short sampler period.

You may also see a problem if you are using an amplifier with high gain as the ADC input (for example in strain gauge applications). The sudden appearance of the cap can cause an instability in the OpAmp, which will appear as a little blip:

You have two options, firstly you can lengthen the sample period, as I have done in the image above. This is actually very easy to do, because the sample period can be placed between two consecutive SPI bytes, so the pause comes naturally.

#define SPI_XCEIVE(out, in) {SSPBUF = out; while(!(SSPSTAT&0x01)); in = SSPBUF;}

typedef union
{
int16u  word;
int8u   byte[2];
}union16;

union16    mcp_result_union = {0};

void mcp320x_read(int8u chan) __wparam
{
overlay int8u control_byte_0;

control_byte_0 = B8(00011000) | chan;                   // Set up control byte:
// b4 = start bit
// b3 = single ended
// b2:0 = channel number

SPI_ChipSelect(MCP320x_CS_PORT);                    // BEGIN

SPI_XCEIVE(control_byte_0, control_byte_0);             // Send control byte. Ignore the return value.

SPI_XCEIVE(0, mcp_result_union.byte[1]);                // Get the sample back. Put it straight into its destination.
SPI_XCEIVE(0, mcp_result_union.byte[0]);                // Get the sample back. Put it straight into its destination.

mcp_result_union.word    >>= 1;                         // Shift the sample into the correct position
mcp_result_union.word    >>= 1;                         // (doing it in two stages is actually faster)
mcp_result_union.byte[1]  &= 0x0F;                      // and mask off the unused bits.

SPI_ChipDeselect(MCP320x_CS_PORT);                  // END


}

Alternatively, you can simply add a small capacitor between the ADC input pin and ground. This will act as as local charge supply which will prevent any noticeable signal droop during the sample. This way, you should be able to have pretty high value resistors.

If you want to save even more power, then think about the ADC sample rate. If it's very slow (say once a second), then you might consider powering down the whole ADC during this period. Make sure to check the datasheet for the required power on timing.

-
The sample capacitor is 20pF. When you use a 100nF buffer you won't notice the droop on a scope. –  Federico Russo Apr 20 '12 at 14:36
@FedericoRusso - That is what I said. "prevent any noticeable droop". I just wanted to make sure none of the pedants around here complained that strictly speaking there would be some droop, even if the scope couldn't pick it up. –  Rocketmagnet Apr 20 '12 at 14:42