How to Improve ADC Resolution

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
I am working on PSU project.
As of now I working on the code (mikroC Pro)
As I am not that good on coding I am asking for help.

I can get the voltage and current readings from Analog input but the Voltage resolution is 3mV.

I read around that this can be improved in software.
How can I do it.
I like to get 1mv resolution at best.
Vref is at Vdd (5V)
Max voltage is 35VDC scaled down by BB OPAMPS down to 5V for 35V output.

I searched a lot but I am getting no where.

Does any one got a working example of a 10 bit ADC displaying a Voltage at 1mV resolution ?
Or how can I do this or is it possible to do it in Software ?
 

ericgibbs

Joined Jan 29, 2010
18,766
Hi R!,
For a 10 bit ADC with a 5V input that gives 5/1024 ie: 4.88mV/Bit.
As you are scaling down from 35v to 5v that is a 7:1 reduction, so your resolution for 35V is only ~34mV.

You can over sample in s/w in order to improve the resolution.
E
 

Papabravo

Joined Feb 24, 2006
21,159
You cannot get 1 mV resolution with a +5V reference. That would require in excess of 12 bits. Software (aka Digital Signal Processing) can help you improve the frequency content of the signal via filtering, but your basic quantization error will be the reference voltage divided by 1024 for a 10 bit A/D converter or about 4.8 mV, or half of that if you will since an analog value in between two values will pick one or the other. Just having a converter with more bits may or may not help since at such levels your layout and other circuit considerations will be the dominant contributor to noise.

Oversampling might help depending on the relationship between the sampling rate and the highest frequency component in the signal. If the variance of the sample is small you can have more confidence that the mean of the samples approaches the mean value of the signal.
 

OBW0549

Joined Mar 2, 2015
3,566
The only way I know of to coax more effective resolution out of a successive-approximation ADC is to add a small amount of Gaussian random noise to the ADC's input signal, and then average the ADC results over a large number of readings. The attached application note discusses this method.

Aside from the added hardware complexity due to the noise generating circuitry, there is also a trade-off in speed. In the end, it may be better to start with a better ADC like a 12-bit (available in some PICs) or even a 16-, 18- or 24-bit sigma-delta converter like an MCP3551.
 

Attachments

crutschow

Joined Mar 14, 2008
34,285
The oversampling and averaging method that OBWO549 proposed should increase your resolution.
It's somewhat similar to the way a sigma-delta converter averages many coarse 1-bit conversions to get a high resolution result.
If your system has sufficient intrinsic noise such that the LSB is randomly changing on each conversion then you may not need to add any additional noise.

But whether you can get to 1mV resolution from a 10-bit converter for a 35V full-scale signal (a factor of 34 or about 5-bits) is problematic.
You need at least 15-bit resolution, so going to a sigma-delta converter of at least 16-bits is likely your best choice, as OBWO549 noted.
 

OBW0549

Joined Mar 2, 2015
3,566
But whether you can get to 1mV resolution from a 10-bit converter for a 35V full-scale signal (a factor of 34 or about 5-bits) is problematic.
Problematic to say the least; I've used the dithering/averaging method a few times and concluded that trying to get more than 2 or 3 extra bits of resolution was more trouble than it was worth. Far easier to just use a high-resolution Σ-Δ converter and be done with it.
 

Papabravo

Joined Feb 24, 2006
21,159
In finance we have an aphorism: "Don't fight the tape". In the A/D world a similar one might be: "Don't try for 13 bits of resolution with a 10-bit device".
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
Hmm!

Since I cannot add noise I need to change the uC Layout of the PCB and a 16 bit PIC. EH !

Some how I noticed a 34mV change when I probe the thing with my fluke.

Thanks all, that was very helpful.
Now I do not need to bang my head to see if it is possible.
My Supply is quite stable and it does not fluctuate.
Only thing I some how disliked was the change in 00.00V to 00.03V, which by the way is not actually an issue.
But I needed to know if that it can be improved. I guess it is but not easy, Since every thing is ready but the code.

I guess I will keep it that way for this project.

But I will be making a new one, so for the heck of it, what would you suggest to get a 1mv res without adding noise generator. The New one also go up to 30V. I am thinking
1 - Use a separate 12 to 16 bit ADC and a standard PIC.
or
2 - Use a 16bit ADC PIC.

What method would you suggest for a newbie in PCB designing.
I am asking that because I dunno how a PCB should be designed if using a 16 bit PIC ( read that they should be designed properly). Need to know easiest way so designing PCB will be easy.
 

OBW0549

Joined Mar 2, 2015
3,566
2 - Use a 16bit ADC PIC.
Are there any PICs with 16-bit ADCs? It's been a while since I looked, but I'm not aware of any. Quite a few PICs have 12-bit converters, but I haven't noticed any that go higher.

There are "16-bit" PICs, of course (the PIC24, dsPIC30 and dsPIC33 series) but that refers to their data word length, not the resolution of their ADCs.
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
So I was mistaken...my bad.

MCP3551. looks promising. I am tempted to try that
Just to make sure, is 16 bit ADC the minimum amount required for a 1mv resolution ?

So my option is use a separate ADC then ?
 

OBW0549

Joined Mar 2, 2015
3,566
MCP3551. looks promising. I am tempted to try that
Actually, I'd probably choose the MCP3553 since it will give you 60 conversions/second instead of just 13.75. If you need any faster than that you'll have to choose a different device from a different manufacturer. Shouldn't be too hard, as it seems everybody and his kid sister is making Σ-Δ converters these days.

Just to make sure, is 16 bit ADC the minimum amount required for a 1mv resolution ?
That's easy to figure out: 1 mV out of 35 V is one part in 35,000, which is close to 32,768 which is 2^15. So 15 bits would be the minimum to get 1 mV resolution.

So my option is use a separate ADC then ?
That's certainly the way I would go.
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
Very Helpful OBW0549
Thanks

Do I need fast ADC for Bench top Power Supply ?? I do not think so. Do you ?

MCP3553 is 22 bit, so go higher if I can buy, right ?

Which interface is easy to code for a newbie.....SPI or I2C ? I mean like coding ... ?

by the way I will have multiple ADC's like for Voltage and Current.
 

crutschow

Joined Mar 14, 2008
34,285
I second the idea of using a separate ADC.

But why do you need 1mV resolution?
You said the 30mV change in the reading was not actually an issue so you just want more resolution on a whim?

If you averaged to get another 2 or 3 bits resolution, that would give you perhaps 5mV or so of resolution.
The theoretical improvement in resolution is the square-root of the number of averaged samples so for 3-bit improvement you would do a running average of 64 samples (16-bit sum).

Note that this doesn't improve absolute accuracy, only resolution.
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
MCP3551 data rate is 66.67ms
MCP3553 data rate is 16.67ms

I will be updating LCD at 100ms.
Do I need MCP3353 ?
MCP3551 is cheaper.

Plus I have plenty of 16F886 which has MSSP (SPI) support in all 4 modes.(dunno what the heck a "mode" is yet, but)
Will 16F886 be suitable with a MCP355x ADC to Display 1mV resolution DVM?
 

OBW0549

Joined Mar 2, 2015
3,566
Do I need fast ADC for Bench top Power Supply ?? I do not think so. Do you ?
Nope. I should think that 60 samples/second would be adequate.

MCP3553 is 22 bit, so go higher if I can buy, right ?
I don't see any point in going higher; it wouldn't do any harm, of course, but 22 bits should suffice.

Which interface is easy to code for a newbie.....SPI or I2C ? I mean like coding ... ?
SPI, in my opinion.

Will 16F886 be suitable with a MCP355x ADC to Display 1mV resolution DVM?
Yup. Should be.
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
Just one more Q. from above. :D

MCP3551 data rate is 66.67ms
MCP3553 data rate is 16.67ms

I will be updating LCD at 100ms.
Do I need MCP3353 ?
MCP3551 is cheaper.
 

OBW0549

Joined Mar 2, 2015
3,566
Just one more Q. from above. :D

MCP3551 data rate is 66.67ms
MCP3553 data rate is 16.67ms

I will be updating LCD at 100ms.
Do I need MCP3353 ?
MCP3551 is cheaper.
Is your PIC going to be regulating the PS output? If it is, then the higher speed of the MCP3553 would be advantageous. If the PIC is just going to be measuring the output and displaying it, then the slower unit would suffice.
 

Thread Starter

R!f@@

Joined Apr 2, 2009
9,918
LM723 based Linear Regulator.
So Just measuring. :)

I am not that good in coding to make a PIC controlling a PSU Regulator (Voltage an d Current) u know :oops:
I will buy MCP3551 and design the new one based on it.
I will play with it once I get my hands on it.
:D
Thanks all
 
Top