Hi Guys, I'm fiddling around with my new Arduino IOT 33 but I ran in to a problem.
In a sketch where I use a simple tmp36 sensor I get different analog data between the IoT device and all other devices. I tried my sketch on Mega, Uno and Leonardo there they all work fine (in3.3v logic) But as soon as I connect it to the IoT Device my numbers are about 25% off.
In the sketch below you can see that I tried some different Voltage logics. Both 5 and 3.3 work well on the Mega Leonardo and Uno.
The thing is that the Analog value is off. With around 20 degrees Celcius. I'm getting a Analog read of about 150 on most devices. But 190 on the IoT.
I hope somebody sees my wrongdoing here..
int temp = A0;
void setup() {
pinMode(temp, INPUT);
Serial.begin(9600);
}
void loop() {
float analogReading = analogRead(temp);
Serial.print("Analog: " + String(analogReading));
//float tempVoltage = analogReading * 5.0 / 1023.0;
float tempVoltage = analogReading * 3.3 / 675.18;
//float tempVoltage = analogReading * 3.0 / 614.05;
Serial.println(" & Volt: " + String(tempVoltage));
delay(1000);
float tempC = (tempVoltage - 0.5) * 100;
Serial.println (String(tempC) + " C");
}