Go Down

Topic: AnalogRead (Read 937 times) previous topic - next topic

astroz78

Reference says that AnalogRead returns int value. Unit value represents 4.9 mV, so if I want mV value i use:
float millivolt = analogRead(A1) * 4.9;

Is that true also with Arduino Due?

I'm trying to read TMP36 temperature sensor value, but I can not get the right value. The code is:

   float temp = analogRead(A1) * 4.9;
   temp = (temp - 500) / 10;
OpenDomotica ...la domotica con Arduino - www.opendomotica.it

Grumpy_Mike

Quote
Is that true also with Arduino Due?

No.
This is because the Due has a 3V3 reference voltage not a 5V one. So each step will be 3.3 / 1024 = 3.22mV

Go Up