Improving ADC resolution

Showcase your projects! We love to see what people come up with, so please share your creations here.
qwerty
Posts: 18
Joined: Mon Oct 07, 2013 11:54 pm

Re: Improving ADC resolution

Post by qwerty » Fri Oct 18, 2013 8:35 pm

qwerty wrote:So how stable is the voltage reading of the dithered ADC, over time and with changes in room temperature?

Naturally, I will run the circuit overnight, and see what it reads in the morning.

To put the results gained so far into perspective, good-quality general purpose metal-film resistors specify a temperature coefficient of 20 ppm/K.

I'm not willing to hang my hat on this just yet, but the indications so far are that drift with time and temperature of the dithered ADC is effectively zero, and in practice the drift will be dominated by external resistors. I find this extraordinary.
It's 7:30 in the morning, there is a light frost on the ground, the indoor temperature has plummeted to 14 degrees, and the ADC reading is still rock solid at 511.50 counts, and 22.643 DegC.

In ultra critical applications, you may need to pay attention to drift in your ADC reference, and drift in your resistors, but for all practical purposes the drift in the dithered ADC is zero. What a great result.
Last edited by qwerty on Sun Oct 20, 2013 6:56 am, edited 1 time in total.

doc_pyro
Posts: 5
Joined: Mon Oct 14, 2013 9:53 am

Re: Improving ADC resolution

Post by doc_pyro » Fri Oct 18, 2013 9:01 pm

hello qwerty,
i'm not so much after ultra high accuracy but an increase in effective temperature range of the controller. I'm working with 1M thermistors from a maverick ET732 because i have them and there is a fair bit of info out there already.

like this: http://hruska.us/tempmon/

I have also found a calibration information on the probes but when i did a spread sheet using various resistors in the voltage divider I found the effective range was a little lacking. This is why i'm interested in your idea.

qwerty
Posts: 18
Joined: Mon Oct 07, 2013 11:54 pm

Re: Improving ADC resolution

Post by qwerty » Fri Oct 18, 2013 9:47 pm

doc_pyro wrote:hello qwerty,
i'm not so much after ultra high accuracy but an increase in effective temperature range of the controller. I'm working with 1M thermistors from a maverick ET732 because i have them and there is a fair bit of info out there already.

like this: http://hruska.us/tempmon/

I have also found a calibration information on the probes but when i did a spread sheet using various resistors in the voltage divider I found the effective range was a little lacking. This is why i'm interested in your idea.
Perhaps your problem is not so much the Arduino ADC, but not using a suitable resistance value in the top leg of the voltage divider.

What temperature range do you wish to measure? What is the thermistor resistance at the top, bottom and middle of the range you wish to measure? Roughly speaking, the divider resistance should be the same as the thermistor resistance, at the middle of the temperature range you wish to measure.

doc_pyro
Posts: 5
Joined: Mon Oct 14, 2013 9:53 am

Re: Improving ADC resolution

Post by doc_pyro » Fri Oct 18, 2013 10:22 pm

here is the figures i borrowed of the a forum and my tests in an oven confirm the results.
º C R ohms
-60 224000000
-50 101000000
-40 48000000
-30 23900000
-20 12400000
-10 6680000
0 3730000
10 2160000
20 1280000
25 1000000
30 786000
40 493000
50 317000
60 209000
70 140000
80 95900
90 66800
100 47400
110 34100
120 25000
125 21400
130 18500
140 13900
150 10600
160 8110
180 4950
200 3140
220 2060
240 1400
260 971
281.1111111111 692
300 505
using a 22K resistor the working range would be from 40ºC to about 260ºC and 33K 10ºC to 220ºC assuming 1 bit per 1ºC ... so that is why I would like a bit more accuracy mainly due to the large working range that i would like ...

yes it is very accurate in some areas but it the range that i'm after more because i would like it and would feel happier if i can build it in, but could live with it in current state .

qwerty
Posts: 18
Joined: Mon Oct 07, 2013 11:54 pm

Re: Improving ADC resolution

Post by qwerty » Sat Oct 19, 2013 12:07 am

doc_pyro wrote:here is the figures i borrowed of the a forum and my tests in an oven confirm the results.

using a 22K resistor the working range would be from 40ºC to about 260ºC and 33K 10ºC to 220ºC assuming 1 bit per 1ºC ... so that is why I would like a bit more accuracy mainly due to the large working range that i would like ...

yes it is very accurate in some areas but it the range that i'm after more because i would like it and would feel happier if i can build it in, but could live with it in current state .
My quick calcs show that if you use a 22K resistor, then at the optimum operating temperature of ~125 degrees, 1 LSB = 0.13 degrees, which is presumably just fine.

At 45 degrees, 1 LSB = 0.22 degrees
At 250 degrees, 1 LSB = 0.28 degrees

Sounds OK to me, but if you want better, then the dither method that I described will certainly do it for you. How good do you want??

If you dither and average, then you will be able to detect temperature changes as small as you like. However, you may need to apply software calibration to improve the absolute accuracy of the readings.

As the dithered ADC drift is extremely small, and as drift in the ADC reference does not affect ratiometric resistance measurement, dithering should make it possible to get stable and accurate temperature measurments over your desired wide range, provide you are prepared to do an once-off calibration.

doc_pyro
Posts: 5
Joined: Mon Oct 14, 2013 9:53 am

Re: Improving ADC resolution

Post by doc_pyro » Sun Oct 20, 2013 2:37 am

I must have been calculating the the bits wrong in my spread sheet ... oh well lol

And i guess i was after a bit bigger range not quite to the level your talking about just a bit more but thanks for the input will get on with my build and keep an eye on this anyway may be able use it in something else or if get the urge to get much more accurate .... lol

Thanks for your time and i was answering also to let you know i was interested.

qwerty
Posts: 18
Joined: Mon Oct 07, 2013 11:54 pm

Re: Improving ADC resolution

Post by qwerty » Sun Oct 20, 2013 7:08 am

doc_pyro wrote:I must have been calculating the the bits wrong in my spread sheet ... oh well lol

And i guess i was after a bit bigger range not quite to the level your talking about just a bit more but thanks for the input will get on with my build and keep an eye on this anyway may be able use it in something else or if get the urge to get much more accurate .... lol

Thanks for your time and i was answering also to let you know i was interested.
Yeah, build it and see how you go, and if my calcs are right (remembering that they were quickly scratched on the back of an envelope) then you may find the resolution and useable range better than you expected.

Thanks for your interest.

qwerty
Posts: 18
Joined: Mon Oct 07, 2013 11:54 pm

Re: Improving ADC resolution

Post by qwerty » Sun Oct 20, 2013 7:58 am

It turns out that the achievable performance is even a bit better than I thought.

As per the program examples provided within the Arduino IDE, I have allowed a 1 mS delay between analog reads, supposedly to allow the ADC readings to stabilize.

However, in fact the averaged voltage reading seems to be just as stable and noise free if this delay is removed.

This is good news. In one of my applications that requires averaged readings only every 0.5 seconds, it means that the number of samples in each average can be increased from 500 up to around 5000, even further reducing the fluctuation between successive averaged readings, and thus the ability to detect very small changes. A change of 1 part in 100,000 of full scale is now easily detectable.

In another application, I will keep the 500 samples per average, but can now update the averaged reading at 10 Hz rather than 2Hz, fast enough to put inside a high-performance PID temperature control loop. This system is already operating in an all-analog implementation, and easily controls to 0.001K, but being able to do this in an all-digital implementation has many advantages.

Who would have believed that a lowly Arduino UNO could do that? Actually, it can't do the precision PID because it has no DAC, but I have a Due sitting here that does have a proper DAC (actually 2 DACs), so I'll use that instead. Unfortunately the DACs are only 12 bit which is not enough, so next challenge will be to significantly improve the Due DAC resolution, which I believe can be done. A bit of noise and drift in the upgraded DAC won't matter, because it is within the control loop.

I'm having a lot of fun making Arduino boards do things they were never meant to do. :D

A final note of caution. The dithered and averaged analog input performance I have described was done with an Arduino UNO or, more precisely, a Freetronics 11. It is possible that other Arduino boards may be inherently noiser, and not work as well. For example, I am finding that the ADC on the Due is very noisy, to the point that despite being 12-bits, it actually performs more poorly than the humble 10-bit Uno. Those extra 2 bits are buried in the noise. On the one hand that removes the need for external dithering, but because the said noise is unpredictable and large, the average reading fluctuates more than with my dithered Uno, and it seems to drift more as well. It should scrub up OK, but I'm a bit disappointed with the ADC in the Due board.

Post Reply