A/D Precision on a budget

I'm a hobbiest who does not necessarily have access to very high precision passives, yet would like to maximize the performance of those that I *do* have. For example, if I'm using an 14 bit ADC with a 2 V input range and I want to monitor a 5v rail that only varies +- 1 v, I can use a difference amp with a 4v ref to expand the range that I am interested in. What can I do, however, if I want to monitor a complete 5v swing and still maintain 14 bit accuracy (or, at least as close as possible)? Are there any tricks to accomplish this when you are limited to .1% passives? Thanks for any hints or tips that you can share.

Hal

Reply to
Hal Foster
Loading thread data ...

If it's a one-off (presumably hobby use doesn't include large production quantities for any value of "large") the easiest way is probably to use an accurate instrument to measure the critical passives and crank those values into the code.

Some variations on that theme would include having a "calibration" option in the code where you jumper in a precision voltage reference and let the code determine the proper scale factors which would then be stored to onboard EEPROM. Or, an off board precision source accompanied by the calibration routine that hits multiple points on the curve.

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

Keep in mind that absolute accuracy is not the paramount thing here -- offsets and scale factor errors can be calibrated out. The things you really want to pay attention to are stability (e.g., aging and temperature dependence), nonlinearities and noise.

-- Dave Tweed

Reply to
David Tweed

n

nd I

n I

14

to

s

Farnell does stock very high precision passives and will sell them in small quantities. In the U.K. they used to sell to anybody with a credit card - there was a minimum order threshold but it wasn't all that high.

In the Netherlands I had to register a "hobby business" with the local chamber of commerce before the local branch of Farnell would do business with me, so you wil have to tell us which country you are posting from before we can be more specific.

In the current Farnell catalogue they list a bunch of precision thin- film resistive dividers with ratio tolerances of 0.05% and better, and a couple of Vishay thin film eight resistors arrays - 1k, 10k and 100k resistors with an absolute tolerance of 0.1% and a ratio tolerance of

+/-0.05%.

They alos carry a couple of ranges of 0,1% 15ppm resistors on the E96 grid and a much smaller range of 0.01% 0.6ppm/C resistors.

-- Bill Sloman, Nijmegen

Reply to
bill.sloman

I'm in the States - so I tend to use Mouser, Allied etc. - they have the precision values, just not always in qty

Reply to
Hal Foster

n

nd I

n I

14

to

s

If you don't mind a bit of slowness, you can take advantage of the fact that an analog switch has very low resistance when on in a PWMing trick.

A section of the a 4053 can switch the ADC to a "calibration" input to check the accuracy. The "calibration" voltage is made with another

4053 section and a PWM signal from the micro.

The PWM signal is turned into a near exact 0V and +5V waveform by the other two sections of the 4053. A couple of resistors from there to a capacitor form a low pass filter way below the PWM rate.

The micro very slowly steps the PWM duty cycle through the 0% to 100% range perhaps in 8 steps and then back down again. At each step, the voltage is fed into the ADC. The micro holds a table of the results from the ADC at each of the 8 points.

By averaging the upwards and downwards passes through the range the errors tend to cancel. This leaves the micro with 8 calibration points along the ADC's curve.

Reply to
MooseFET

That is pretty much what I do now - I suppose that I'm wondering about techniques other than the obvious. What brought this up for me was reading Atmel's app note "AVR121: Enhancing ADC resolution by oversampling" - I already use averaging to smooth out the noise; but the idea of using averaging and decimation to increase the effective resolution was new to me. Thing was, it didn't make much sense for me to sample 12 bits or so of a value that was only accurate to 10 bits to begin with. In reality, 10 bit resolution is generally PGE for anything that I do - increasing this accuracy is, for me, a challenge and a way to learn. As noted, I can usually compensate for temperature and such, but there is not much point in refining a value this is imprecise to begin with. So, I am sort of looking for "out-of-the-box" solutions that can, say, give me better than .2% return using .1% passives.

Thanks,

Hal

Reply to
Hal Foster

This is exatly the kind of idea that I'm looking for - but, isn't the accuracy still limited by the RC network and/or the supply?

Hal

Reply to
Hal Foster

The 14-bit ADC doesn't have 14 bit absolute accuracy... whatever voltage reference it uses won't be that good.

So use a resistive voltage divider made from low temperature coefficient resistors, then calibrate the system at 0 and 5 volts. Of course, you'll need a very accurate 5 volt source, or a stable source and a very accurate DVM.

To get real 14-bit accuracy, you'll probably have to signal average, too.

John

Reply to
John Larkin

As I don't have access to a precision DVM

Reply to
Hal Foster

As an aside - how the heck to I get Newsrover to automatically quote the message to which I am replying?

--
Hal
Reply to
Hal Foster

Reply to
Hal Foster

Reply to
bill.sloman

Digikey has some nice Vishay resistors, too:

formatting link
?name=Y0007-1.0K-ND

+/-2ppm/°C and +/-0.01% tolerance, but it costs $11.52.
--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Reply to
Frank Buss

I second the motion to convert to time and frequency. You have to be really careful about soakage (dielectric absorption) in the caps, though...stepping through the calibration curve up and down does help but isn't a complete solution unless you have enough padding points on each end for the soakage to completely die away---otherwise the errors don't cancel.

One approach would be to calibrate the soakage time constants, as Bob Pease did in one of his articles some years ago. My personal inclination would be to do the calibration in both directions as MF suggests, but then to do it over again at different speeds and apply Richardson extrapolation.

Richardson extrapolation is often used to improve the accuracy of numerical methods--it's a vital part of the Bulirsch-Stoer method for ODEs and the Romberg integration algorithm. The idea there is to compute an integral approximately several times with decreasing step sizes, e.g. h, h/2, h/4,..., fit a polynomial in h, and extrapolate to h=0. In this case you For certain classes of problems this works amazingly well. It's easy to code, or can be found in lots of public domain packages as well as in Numerical Recipes.

For series summation there is also the iterated Shanks method, which is specifically designed to remove N decaying exponentials in N iterations and so might be a better fit to the soakage problem. One would have to do a bit of math to figure out how to apply it to the problem at hand, but it might be as simple as forming the difference between successive approximants and applying the summation to that.

These series-summing methods reduce the error due to truncation (i.e. a finite mesh size or a truncated series). They can yield accuracy equivalent to a very fine mesh or a very long summation, without the horrible roundoff error. If the truncation errors really follow the given model (polynomial or sums of exponentials), summation methods are practically supernatural.

Cheers,

Phil Hobbs

Reply to
Phil Hobbs

n

ange and I

hat can I

14

tricks to

s

You can't do 14bits even if you have money to burn. 10 bits is your realistic maximum, even then you will struggle and still have to spend money. Why would you want to measure to that accuracy anyway?

Reply to
cbarn24050

[...]
[...]

You can measure *relative* resistances quite accurately if you can keep the environment stable. Using your existing ADC, simply measure (as fast as you can) the charging curve using one of the resistances in an RC network. You want the ADC running as fast as possible, and the capacitor charging as slowly as possible. By fitting a (1 - exp) curve, you can get the time constant. Repeat for the second resistor, and then the ratio of the resistances is the ratio of the time constants. Not so useful in a production environment, but can be useful if you need to make an accurate-ratio voltage divider ...

You can do a lot with relative resistances, but as mentioned getting a stable, accurate, reference voltage is probably the most difficult part. You can get IC precision voltage sources, but these tend to bottom out around

0.02%, which corresponds to about 12 bits. They're stable, though, so you can trim them in to a higher accuracy if you have something that is capable of measuring the voltage sufficiently accurately or if you have another better-precision voltage source.
--
Michael Brown
Add michael@ to emboss.co.nz ---+--- My inbox is always open
Reply to
Michael Brown

The quality of the analog switch, the quality of the capacitor and the accuracy of the supply matter. The exact values of the resistors and capacitors don't.

Reply to
MooseFET

urn

Oh, is THAT all. Remember that matching of resistors is more important than the 'precision' value. To make an attenuator, you use two resistors, and the attenuation depends NOT on the value of the resistors, but only on the value of the ratio. Similarly, an inverting or noninverting amplifier has a gain that depends on a resistor ratio. Using identical resistors, at identical temperatures, the tracking can easily be relied on for gain stability far in excess of the temperature-aging-limits on a single resistor value.

Make attenuators or amplifiers with resistor arrays, and the inexpensive 1% resistors can easily give you a .01% stability of the resistor ratio (and the value of the ratio can be calibrated easily).

As an aid to calibration, you want a standard voltage (used to be an Eppley battery, with a NIST certification), and a jumper wire (to generate zero). It's also useful to have a noise generator (ok, actually any stable AC source will do). If you measure zero plus some AC-coupled signal, and the average value of a few thousand samples comes up as a fraction of one LSB, you've just found the error at zero volts of your converter (or converter-plus- amplifier, or converter-plus-attenuator).

Similarly, if you measure 10.000 V plus some AC-coupled signal, the average of many measurements can give you an extra bit or two of resolution. Alas, the resolution you gain thus ONLY applies to the small range around your known value, and a fourteen bit converter has 4094 other small ranges that would require separate treatment...

Reply to
whit3rd

You're absolutely right - I think that I was initially hung up on initial as opposed to the attainable precision. I'm thinking now that the best approach is to pay more attention to the tempco of the components and calibrate at the approximately 1/3 and 2/3 points of the range. I've ordered a couple precision refs from AD to play around with - make a temperature controlled environment and calibrate with a friends Fluke 8845 (*envy*). As I've said, this is all about fun and learning for me - thanks to you and everyone else who has offered suggestions.

--
Hal
Reply to
Hal Foster

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.