I try to increase th resolution of the analog signal. I think there are two methods to fillfull it. One is the adjustment the analog reference which is provided in Mega boards, another is to use higher resolution Arduino boards such as DUE.

I had tried  these two methods and I wrote down some tips in the following:

 

After I tried Mega2560 and DUE, Mega2560 board can implement the function of analogReference(), but Due didn’t.

Due only has 3.3V analog reference. If you want to change AREF of DUE, external AREF and some hardware modification are required.

 

There we focus on the topic of AREF of Mega2560 by using analogResolution().

 

analogReference():

功能:为模拟电压输入设置参考值;

形式:analogReference(type)

参数:type有以下几个选项:

DEFAULT: 默认参考值5v (在5V的 板子上 ) 或者 3.3 v  (在3.3V 的Arduino板子上);

INTERNAL:内置参考值, 在 ATmega168 或者 ATmega328板子上为1.1v;在ATmega8 板子上为2.56v (在Arduino Mega板子上不可获得)。

INTERNAL1V1: 内置的1.1V 参考值 (只在Arduino Mega板子上有效 )

INTERNAL2V56: 内置的2.56V 参考值  (只在Arduino Mega板子上有效)

EXTERNAL: AREF引脚加的电压 (0到5V)将作为参考值 。

 

We had tested analogReference(INTERNAL1V1) and analogReference(INTERNAL2V56) in setup() and these work very well.

 

void setup() {

…….

analogReference(INTERNAL1V1);      //for Mega

analogReference(INTERNAL2V56);    //for Mega

 

// choose one to use

…....

}

 

If your sensor signal is below 1.1V or 2.56V, maybe you can try the function of analogReference() for the better resolution.

 

 

 

References:

1. Arduino的详细介绍(基于Mega2560)——参考电压analogReference()

http://blog.csdn.net/yibu_refresh/article/details/40894423

2. analogReference()

 

https://www.arduino.cc/en/Reference/analogReference

3. Arduino Tutorials – Chapter 22 – the AREF pin

http://tronixstuff.com/2013/12/12/arduino-tutorials-chapter-22-aref-pin/

4. Using an external accurate voltage reference for the analog-to-digital conversions

https://github.com/MarlinFirmware/Marlin/issues/5719

arrow
arrow

    fishark 發表在 痞客邦 留言(0) 人氣()