Max voltage level with 0.1V Resolution; 10 bit adc - Page 1
Forum section: electronics / beginners

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: October 06, 2016, 07:44:49 am
content: 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:10KB) Resolution of MCU with 5V: 5V/1023C) Resolttion required 0.1V.D) Resolution wih divider: (5V/1023) * (20) = 0.09775VSince resolution requied is greater than resolution with divider so I think I can measure4. I dont know how much accurate system will be. Will do testing for it.

author: danadak
author_rank: Super Contributor
timestamp: October 06, 2016, 11:55:59 am
content: 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 regulatorthen accuracy is pretty poor due to regulator tolerance and drift.Also look at A/D datasheet at its INL, offset, etc... That all factors intooverall accuracy. As well as your R divider accuracy.Some ref material -https://www.dropbox.com/s/aq8pyz7d9oc8r5t/analog_digital_conversion.zip?dl=0Do 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, thenadd all to get total error. Noise of course is handled (typically) as RMS, root ofsquares.Regards, Dana.

author: Kalvin
author_rank: Super Contributor
timestamp: October 06, 2016, 12:13:20 pm
content: Quote from: blueskull on October 06, 2016, 08:18:45 amIn other words, the divider should be set to 102.3 Volts.

author: tszaboo
author_rank: Super Contributor
timestamp: October 06, 2016, 12:30:36 pm
content: Quote from: Vindhyachal.takniki on October 06, 2016, 07:44:49 amYes, if you confuse resolution with accuracy.Accuracy includes INL, DNL errors, scaling error, offset, voltage reference drift, temperature drift, etc.

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: October 07, 2016, 05:11:28 am
content: 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 resultC) 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.0fF) Apply divider: voltage * 20

author: danadak
author_rank: Super Contributor
timestamp: October 07, 2016, 09:21:51 am
content: Depending on manufacturer LM7805 is ~ 5% accurate, which says yourabsolute accuracy for the A/D will be no better that ~ 5 bits equivalentA/D. Pile onto that resistor accuracy, temp, other effects your accuracyquite low.Start with Vref, use one to power the UP, power leds and display bysinking to ground (so current does not go thru Vref/Vdd) or if UP has aseparate Vref pin feed that with external Vref. If using Vref to supply Vddof UP make sure its current capability can handle UP worst case current draw.Regards, Dana.

author: max_torque
author_rank: Super Contributor
timestamp: October 07, 2016, 12:20:17 pm
content: 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!

author: danadak
author_rank: Super Contributor
timestamp: October 07, 2016, 09:51:39 pm
content: Actually UP noise tends to be highly correlated, so averaging isnot very effective. As you state it has to be white or nearly so togain ENOB.Regards, Dana.

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: October 08, 2016, 04:44:07 am
content: 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

author: max_torque
author_rank: Super Contributor
timestamp: October 08, 2016, 11:31:42 am
content: Quote from: danadak on October 07, 2016, 09:51:39 pmA 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)

author: David Hess
author_rank: Super Contributor
timestamp: October 08, 2016, 11:07:22 pm
content: Quote from: max_torque on October 07, 2016, 12:20:17 pmThis will improve resolution but does nothing for linearity which for microcontroller ADCs is usually 1 bit or more worse than the resolution anyway.