How to Increase the Resolution of analogRead()! (from 10-bits up to 21-bits)
hello,
i wrote library 21-bits of precision (user-specified 10 21 bits) when reading in analog voltages arduino's built-in adc (analog digital converter). this useful when need precision reading in analog sensors, thought i'd post link library here.
realistically, based on limitations of oversampling, & fact single 21-bit reading takes ~500 seconds (8.33 minutes--refer table @ link below), i'd stick 16-bit resolution or less (where single 16-bit reading takes ~0.5 sec). however, specify "up 21-bit precision" because library accepts precision value of 21-bit without breaking. i'm not saying adc give reliable 21-bit result, i'm saying won't break code. having said that, think 16-bit precision results returned library valid, , have watched , compared them other commanded precisions while seeing them read potentiometer. doing in example codes can run come library when download it. i recommend run examples see yourself.
additionally, library permits data smoothing sampling many times (a user-specified amount), returning average of samples, @ user-specified sampling precision.
here is: http://electricrcaircraftguy.blogspot.com/2014/05/using-arduino-unos-built-in-16-bit-adc.html
happy coding! i hope find useful.
i love arduino!
sincerely,
gabriel
reference:
if click on link above, see explanation how doing this. you see reference, namely, that: the basis doing atmel application note "avr121 enhancing adc resolution oversampling" (found here: http://www.atmel.com/images/doc8003.pdf). please don't respond or make comments until have informed concept reading paper, , visited first link above, having read article on website, , downloaded & tested library.
i wrote library 21-bits of precision (user-specified 10 21 bits) when reading in analog voltages arduino's built-in adc (analog digital converter). this useful when need precision reading in analog sensors, thought i'd post link library here.
realistically, based on limitations of oversampling, & fact single 21-bit reading takes ~500 seconds (8.33 minutes--refer table @ link below), i'd stick 16-bit resolution or less (where single 16-bit reading takes ~0.5 sec). however, specify "up 21-bit precision" because library accepts precision value of 21-bit without breaking. i'm not saying adc give reliable 21-bit result, i'm saying won't break code. having said that, think 16-bit precision results returned library valid, , have watched , compared them other commanded precisions while seeing them read potentiometer. doing in example codes can run come library when download it. i recommend run examples see yourself.
additionally, library permits data smoothing sampling many times (a user-specified amount), returning average of samples, @ user-specified sampling precision.
here is: http://electricrcaircraftguy.blogspot.com/2014/05/using-arduino-unos-built-in-16-bit-adc.html
happy coding! i hope find useful.
i love arduino!
sincerely,
gabriel
reference:
if click on link above, see explanation how doing this. you see reference, namely, that: the basis doing atmel application note "avr121 enhancing adc resolution oversampling" (found here: http://www.atmel.com/images/doc8003.pdf). please don't respond or make comments until have informed concept reading paper, , visited first link above, having read article on website, , downloaded & tested library.
your theory misconceived.
the a/d sampling on arduino chip can detect 0-5 volts in 1023 steps. in round numbers 5 mv per step.
if feed 5 mv chip, a/d answer 1
if feed 10 mv chip, a/d answer 2 , on.
if feed 7.5 mv chip, you maybe 1, , 2. and if bunch of times, , 1 , 2 bunch of times, can averaging , average outcome of 1.5, , maybe can conclude voltage somewhere between 5 mv , 10 mv, so let's call 7.5 mv.
so, maybe, you can 1 bit of implied precision.
but here theory falls down in twisted wreck.
if input signal 6.25 millivolts, theory depend on getting a/d result 1, 75% of time, and a/d result 2, 25% of time. you then, supposedly, calculate "average" a/d outcome of 1.25, and interpolate result of 6.25 mv in between 5 mv , 10 mv.
the problem is, the a/d conversion not work way. response of device input voltage, looks staircase. for input voltage range, between 3 , 7 mv, you answer 1. for input voltage range between 8 , 12 mv, you answer 2. between 13 , 17 mv, 3. , on.
these flat parts of staircase. in small region - which might between 7 , 8 mv, or might not be, you uncertain answer, either 1 or 2. that's concept might work, for 1 bit. but place work.
for constant input in flat step regions, you same reason. if not close vertical part of step ( , don't know ), won't different measurement outcomes. if take bunch of measurements 5.1 mv input, you'll outcome 1. if repeat measurement 5.2 mv, you'll outcome 1. , @ 5.3 mv. and @ 6.3 mv. , anywhere else, up transition region of unknown location , extent, where device outcome jump 2.
you cannot distinguish a/d readings 21 bits of precision, as ludicrously claim.
the a/d sampling on arduino chip can detect 0-5 volts in 1023 steps. in round numbers 5 mv per step.
if feed 5 mv chip, a/d answer 1
if feed 10 mv chip, a/d answer 2 , on.
if feed 7.5 mv chip, you maybe 1, , 2. and if bunch of times, , 1 , 2 bunch of times, can averaging , average outcome of 1.5, , maybe can conclude voltage somewhere between 5 mv , 10 mv, so let's call 7.5 mv.
so, maybe, you can 1 bit of implied precision.
but here theory falls down in twisted wreck.
if input signal 6.25 millivolts, theory depend on getting a/d result 1, 75% of time, and a/d result 2, 25% of time. you then, supposedly, calculate "average" a/d outcome of 1.25, and interpolate result of 6.25 mv in between 5 mv , 10 mv.
the problem is, the a/d conversion not work way. response of device input voltage, looks staircase. for input voltage range, between 3 , 7 mv, you answer 1. for input voltage range between 8 , 12 mv, you answer 2. between 13 , 17 mv, 3. , on.
these flat parts of staircase. in small region - which might between 7 , 8 mv, or might not be, you uncertain answer, either 1 or 2. that's concept might work, for 1 bit. but place work.
for constant input in flat step regions, you same reason. if not close vertical part of step ( , don't know ), won't different measurement outcomes. if take bunch of measurements 5.1 mv input, you'll outcome 1. if repeat measurement 5.2 mv, you'll outcome 1. , @ 5.3 mv. and @ 6.3 mv. , anywhere else, up transition region of unknown location , extent, where device outcome jump 2.
you cannot distinguish a/d readings 21 bits of precision, as ludicrously claim.
Arduino Forum > Using Arduino > Sensors > How to Increase the Resolution of analogRead()! (from 10-bits up to 21-bits)
arduino
Comments
Post a Comment