### Author Topic: Max voltage level with 0.1V Resolution; 10 bit adc  (Read 2192 times)

0 Members and 1 Guest are viewing this topic.

#### Vindhyachal.takniki

• Frequent Contributor
• Posts: 342
##### Max voltage level with 0.1V Resolution; 10 bit adc
« on: October 06, 2016, 06:44:49 pm »
1. I have a microcontroller with 10 bit adc. Adc ref voltage is 5Vdc.
So its resolution would be: 5V/1023.
Now in my system I have three segment display & max reading upto 99.9V. So that means I have to measure voltage with 0.1V resolution.

2. Can I measure the system upto 99.9Vdc with 0.1V accuracy using 10bit adc?

3. I think yes, calculation according to me:
A. TO make 100Vdc to 5V I will use resistor divider of 20 i.e 190K:10K
B) Resolution of MCU with 5V: 5V/1023
C) Resolttion required 0.1V.
D) Resolution wih divider: (5V/1023) * (20) = 0.09775V

Since resolution requied is greater than resolution with divider so I think I can measure

4. I dont know how much accurate system will be. Will do testing for it.

#### blueskull

• Supporter
• Posts: 10248
• Country:
• Power Electronics Guy
##### Re: Max voltage level with 0.1V Resolution; 10 bit adc
« Reply #1 on: October 06, 2016, 07:18:45 pm »
Design your divider so that at 100V, it reads 1000 rather than full scale 1023. Otherwise you may see inter-code interference, which causes uneven reading of your pot.

#### danadak

• Super Contributor
• Posts: 1875
• Country:
• Reactor Operator SSN-583, Retired EE
##### Re: Max voltage level with 0.1V Resolution; 10 bit adc
« Reply #2 on: October 06, 2016, 10:55:59 pm »
Accuracy a direct function of Vref accuracy, and other non linearities.
If 5V Vref is the UP Vdd, and is derived from a "normal" 3 terminal regulator
then accuracy is pretty poor due to regulator tolerance and drift.

Also look at A/D datasheet at its INL, offset, etc... That all factors into
overall accuracy. As well as your R divider accuracy.

Some ref material - https://www.dropbox.com/s/aq8pyz7d9oc8r5t/analog_digital_conversion.zip?dl=0

Do an end to end signal path error budget to see what total inaccuracy will be.
Easy way is to convert all errors to same unit of measure, for example ppm, then
add all to get total error. Noise of course is handled (typically) as RMS, root of
squares.

Regards, Dana.
« Last Edit: October 06, 2016, 10:58:41 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer

#### Kalvin

• Super Contributor
• Posts: 1706
• Country:
• Embedded SW/HW.
##### Re: Max voltage level with 0.1V Resolution; 10 bit adc
« Reply #3 on: October 06, 2016, 11:13:20 pm »
Design your divider so that at 100V, it reads 1000 rather than full scale 1023. Otherwise you may see inter-code interference, which causes uneven reading of your pot.

In other words, the divider should be set to 102.3 Volts.

#### NANDBlog

• Super Contributor
• Posts: 4087
• Country:
##### Re: Max voltage level with 0.1V Resolution; 10 bit adc
« Reply #4 on: October 06, 2016, 11:30:36 pm »
2. Can I measure the system upto 99.9Vdc with 0.1V accuracy using 10bit adc?
...
Since resolution requied is greater than resolution with divider so I think I can measure
Yes, if you confuse resolution with accuracy.
Accuracy includes INL, DNL errors, scaling error, offset, voltage reference drift, temperature drift, etc.

#### Vindhyachal.takniki

• Frequent Contributor
• Posts: 342
##### Re: Max voltage level with 0.1V Resolution; 10 bit adc
« Reply #5 on: October 07, 2016, 04:11:28 pm »
1. Resistor are 190K & 10K. Standard 5%

2. Adc ref is Vdd of MCU which is 5V coming from TO92 package LM7805.

3. This LM7805 also drives 6 segments. 3 for each voltage reading. Each segment is on sequentially for 30us & off for 150us. So it forms a total time base of 900us ofr 6 segments.

4. Algo for sampling each channel:
A)Take 100samples. Each sample in 250us.
B) Add them & average them out & store the result
C) Then 25 such sample reading are taken as obtained from (B)
D) Now arrange these 25 samples in ascending order. Reject lowest 5 & highest 5. Then again take average of 15 remaining.
E) Get voltage reading by formula: voltage=(result * 5)/1023.0f
F) Apply divider: voltage * 20

#### danadak

• Super Contributor
• Posts: 1875
• Country:
• Reactor Operator SSN-583, Retired EE
##### Re: Max voltage level with 0.1V Resolution; 10 bit adc
« Reply #6 on: October 07, 2016, 08:21:51 pm »
Depending on manufacturer LM7805 is ~ 5% accurate, which says your
absolute accuracy for the A/D will be no better that ~ 5 bits equivalent
A/D. Pile onto that resistor accuracy, temp, other effects your accuracy
quite low.

Start with Vref, use one to power the UP, power leds and display by
sinking to ground (so current does not go thru Vref/Vdd) or if UP has a
separate Vref pin feed that with external Vref. If using Vref to supply Vdd
of UP make sure its current capability can handle UP worst case current draw.

Regards, Dana.
« Last Edit: October 07, 2016, 08:23:23 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer

#### max_torque

• Frequent Contributor
• Posts: 885
• Country:
##### Re: Max voltage level with 0.1V Resolution; 10 bit adc
« Reply #7 on: October 07, 2016, 11:20:17 pm »
Depending on how fast the signal is you need to sample (i assume pretty slow if you're displaying it on a human readable screen!) then you can easily oversample and recover at least 1 extra bit of resolution.  There is typically enough white noise in most normal microcontroller 10b ADCs (including the noise coupled to the input circuitry to that ADC) to recover an extra bit, or possibly two.

For digital screen displays, you don't want the raw, rapidly changing values to display, because it makes the decimal digits very hard to actually read!

#### danadak

• Super Contributor
• Posts: 1875
• Country:
• Reactor Operator SSN-583, Retired EE
##### Re: Max voltage level with 0.1V Resolution; 10 bit adc
« Reply #8 on: October 08, 2016, 08:51:39 am »
Actually UP noise tends to be highly correlated, so averaging is
not very effective. As you state it has to be white or nearly so to
gain ENOB.

Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer

#### Vindhyachal.takniki

• Frequent Contributor
• Posts: 342
##### Re: Max voltage level with 0.1V Resolution; 10 bit adc
« Reply #9 on: October 08, 2016, 03:44:07 pm »
1. Will use resistor as 5% only in this project.
2. But reduced the range 0V-35V. Now will use the divider ratio: 78K:2K. This makes system upto 40V, 5V keeping upper margin.
3. Algo will be used as in last post.
4. One time calibration will be done: two point calibration. Calibration will be done at two voltage levels: 5V & 30V to remove any offset & gain errors.
5. Made the board will see results

#### max_torque

• Frequent Contributor
• Posts: 885
• Country:
##### Re: Max voltage level with 0.1V Resolution; 10 bit adc
« Reply #10 on: October 08, 2016, 10:31:42 pm »
Actually UP noise tends to be highly correlated, so averaging is
not very effective. As you state it has to be white or nearly so to
gain ENOB.

Regards, Dana.

A few years (maybe more than 10 yikes) back i looked at ^^^ this on one of my embedded projects, that used a typical 8b microcontroller (can't actually remember if it were a Pic or an AVR, but one or the other!) and i logged a LOT of data and ran it through some processing, and found that, in that particular application, there was 2 bits of valid extra resolution available.
OK, in that case, i had all sorts of noise sources, from the processor itself, the DC:DC switcher powering the board, 50Hz mains hum, even serial and CAN data buses flipping their bits all over the place in the locality of the ADC.  Those wide frequency range noise sources were all hetrodyned together and formed a rough approximation of pure white noise, enough to predictably get those two extra bits anyway.

I'll have to go an find the graphs i produced (must be on one of my back up HD's somewhere)

#### David Hess

• Super Contributor
• Posts: 7882
• Country:
• DavidH
##### Re: Max voltage level with 0.1V Resolution; 10 bit adc
« Reply #11 on: October 09, 2016, 10:07:22 am »
Depending on how fast the signal is you need to sample (i assume pretty slow if you're displaying it on a human readable screen!) then you can easily oversample and recover at least 1 extra bit of resolution.  There is typically enough white noise in most normal microcontroller 10b ADCs (including the noise coupled to the input circuitry to that ADC) to recover an extra bit, or possibly two.

This will improve resolution but does nothing for linearity which for microcontroller ADCs is usually 1 bit or more worse than the resolution anyway.

Smf