14520Views24Replies

Author Options:

increase analog read resolution arduino? Answered

Is there a simple, hardware based way to use two analogRead pins on an arduino together for higher resolution?  I have a project that only needs two analog values, but the more accurate the value the better. 
I do NOT want an external ADC, I am aware they exist, but I don't have time to get it shipped. 
It doesn't need to be fast, or multiply the pins (just a value of 0-2047 would be fine, but 12 or 20 bit equivalent would be better).  Preferably something with just resistors and diodes, if that exists, but more components is okay too.  I was thinking something like a resistor-divider or something, but I can't figure out a simple way for that to work.  
Again, I do NOT want a new ADC, I know how they works and that I can buy one, but I prefer just using the built-in one because there's no interface issue.  No matter how simple it "really is" I ALWAYS have a problem getting two components to communicate.   
I'm using an UNO

24 Replies

user
ElectricRCAircraftGuy (author)2014-05-20

I know this question is old, but I think this is worth mentioning: You can increase the resolution of the built-in Arduino 10-bit ADC (up to at least 16-bits) by using oversampling. I have written a basic library to do this, according to AVR121 application note. My library, and a bried article and explanation about it, are available at my website here: http://electricrcaircraftguy.blogspot.com/2014/05/using-arduino-unos-built-in-16-bit-adc.html

Select as Best AnswerUndo Best Answer

user
sufyanmughal2003 (author)2013-11-24

how we use arduino as a ADC?

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)2013-05-16

How long can you wait for the answer ?

Select as Best AnswerUndo Best Answer

user
jduffy54 (author)steveastrouk2013-05-16

about the rest of today, then I just have to go with the 10 bits, which is less than I need.

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)jduffy542013-05-16

I meant from the measurement, I was thinking you could make a very crude sigma-delta converter.

Select as Best AnswerUndo Best Answer

user
kasbah (author)2013-05-14

What voltage range are you measuring? Potentially you could make an R2R DAC that changes the analog reference voltage and hones in as closely as possible to the target voltage.

Select as Best AnswerUndo Best Answer

user
jduffy54 (author)kasbah2013-05-14

Thats an interresting idea. You're saying to change the Aref using other pins ? I might give that a try.

Is it possible to increase the ground reference for the analogread? if not, then high values will be lower resolution than lower values.

Select as Best AnswerUndo Best Answer

user
kasbah (author)jduffy542013-05-15

0-5v is the full range, if it was 0-2.5v say you could gain some resolution by simply lowering the reference voltage.

You can't increase the ground reference no. With different AVRs such as the Atmega32u4 used in the Leonardo you can actually do differential conversions which would basically allow you to trim your input by setting the negating input.

Select as Best AnswerUndo Best Answer

user
jduffy54 (author)kasbah2013-05-15

I do have a micro, so that could work. how will that work? setting the negating output?

Select as Best AnswerUndo Best Answer

user
kasbah (author)jduffy542013-05-16

See the Atmega32u4 datasheet under differential conversions in the analog to digital converter section.

You may have to eschew the comfort of the Arduino language and use straight C. Arduino will likely set up the ADC as single-ended so you will have to make sure that you set it up the way you want.

Select as Best AnswerUndo Best Answer

user
jduffy54 (author)kasbah2013-05-16

Thanks, bit I don't really like using "straight up" C, because I haven't used it on an arduino before. Is there something within arduino to do something similar?

Select as Best AnswerUndo Best Answer

user
jduffy54 (author)kasbah2013-05-14

Oh, also, I'm only measing 0-5, so its nothing it can't handle normally.

Select as Best AnswerUndo Best Answer

user
iceng (author)2013-05-15

If you have op-amp knowledge and two ADC pins on your micro
then you might get one more solid Bit that's all.

A

Select as Best AnswerUndo Best Answer

user
jduffy54 (author)iceng2013-05-15

How woruld this work? do you have a schematic?

Select as Best AnswerUndo Best Answer

user
jduffy54 (author)iceng2013-05-16

I am fully aware of how and where to get ADCs, I asked if theres another way.

Select as Best AnswerUndo Best Answer

user
astroboy907 (author)2013-05-15

Many times, and I have personally found this true, trying to jury-rig a solution without the correct parts ends up being much more complicated than buying the parts and troubleshooting the interfacing.

Just some advice :)
-Thomas

Select as Best AnswerUndo Best Answer

user
jduffy54 (author)astroboy9072013-05-15
user
astroboy907 (author)jduffy542013-05-15

Hehe, should of added a usually somewhere in there. Generally I jury rig too, but there are sometimes when it simply isn't worth the trouble.

Select as Best AnswerUndo Best Answer

user
verence (author)2013-05-15

No, no simple way. You could try to read the value more than once and add up the single values form an average value. This will work only, if the LSB is not perfectly stable and might get you another bit or two (if you try to get more, you'll just have a random number generator).

IMHO, you should try to find an external ADC that connects to the Arduino by a supported interface (I²C, SPI) or where you can find an Arduino library supporting the device.

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)2013-05-15

Sorry, not possible. There are very good technical reasons why on-board ADCs tend to be limited to 10 bits, on the low cost processors. Some top end (and not AVR) CPUs have higher res ADC, but they aren't AVR compatible

Select as Best AnswerUndo Best Answer

user
spiffomatic64 (author)2013-05-14

I dont think its possible, sorry
http://forum.arduino.cc/index.php/topic,14650.0.html

Select as Best AnswerUndo Best Answer

user

Here's another interesting read
http://forum.arduino.cc/index.php/topic,28290.0.html

Select as Best AnswerUndo Best Answer