Hello I¡m trying to do an analog read from a temperature sensor TMP36, so in arduino the conversion for the analog read is 5/1024 I have observed that it not the same for the CubeCell Board, how do I have to adjust this value to get the correct conversion for make a right analog read?
Here is my program
int Sensor = ADC;
void setup() {
Serial.begin(9600);
pinMode(Sensor, INPUT);
}
void loop() {
int lecture = analogRead(Sensor);
float voltage = 5.0/1024 * lecture;
float temp = voltage * 100 - 50;
Serial.print(“Voltage --> “);
Serial.print(voltage);
Serial.println(” V”);
Serial.print("Temperature --> ");
Serial.print(temp);
Serial.println(“ºC”);
delay(2000);
Serial.print("Lecture–> ");
Serial.println(lecture);
delay(2000);
}
And this is what I’m getting:
Voltage --> 11.05 V
Temperature --> 1055.47ºC
Lecture–> 2264
And I should get (Arduino Uno using —> 5/1024):
Voltage --> 0.77 V
Temperature --> 26.66ºC
Lecture–> 157