With a polymeter I get a value of 136mV and with arduino, using value=analogRead(A0) I get random values regadless of analogReference(INTERNAL) or analogReference(EXTERNAL). With analogReference(INTERNAL) and 136mV input the value should be 1100*136/1023=146. What am I doing wrong? I connect the negative wire of ucurrent to arduino GND and the possitive to analog 0 pin. Here is the code:
Code: Select all
void setup() {
Serial.begin(9600);
analogReference(INTERNAL);
}
void loop(){
int value; double result; double Vcc;
value=analogRead(A0);
result = float(value) * (1.1/1023)*1000;
Serial.println(value,DEC);
delay(1000);
}
Code: Select all
0
0
0
0
1023
1023
0
951
1023
0
761
0
0
0
0
0
1023
0
1023
0
0
1023
595