I have been using the same analog temperature sensors with the Spark Core for a couple months now, and have had no reason to believe anything was wrong in the values I was receiving; until today
So I have 3 sensors, T1, T2, T3. T1 has been properly plugged into a wall socket for over a week and was reading what I thought was the correct temperature (today it was ~18C), it’s also fairly close to the ground. I plugged T2 into a powerbar that was approximately 7-8ft away from T1 and it’s slightly closer to the ground, didn’t think it would be a big difference in temperature; however, it was reading 14.5-15 C which to me seems like a big jump. So I grabbed T3 plugged it into the adjacent wall socket that T1 was using and placed T1 1cm away from T3, It was now reading 16C
Without getting into lengthy details, I switched sensors, plugged them all into the same location, made sure they all had the same firmware. In the end T2 and T3 are fairly close to one another, but T1 still seems to be way off.
This is how I’m reading the analog signal from the Core:
analogRead(tempPin); delay(10); int tempRead = analogRead(tempPin); float tempmV = (((float) tempRead) / 4095 * 3300); tempC = ((5.506 - sqrt(pow(-5.506, 2) + (4 * 0.00176 * (870.6 - tempmV))))/(2 * -0.00176)) + 30;
I got the tempC equation off the transfer function in the datasheet for my sensor here.
I realize sensors have error and each one to the next can be different, but I want to know if I’m doing something obvious wrong, if anyone sees anything and can point it out I would really appreciate it