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().






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.





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


2. analogReference()



3. Arduino Tutorials – Chapter 22 – the AREF pin


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


創作者 fishark 的頭像

魚的方舟 * 圖形語言的世界* - LabVIEW 工作室 & APP開發研究室 & Arduino整合開發 -

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