Go Down

Topic: AnalogRead (Read 1 time) previous topic - next topic


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


Is that true also with Arduino Due?

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

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131