Panda II TempSensor

lemme try.

The analog in ports can read values from 0 to 3300mV divided in 1024 steps or in other words 3.22mV per step.
If you comment the SetLinearScale line in the driver, you will see that you get back values ranging from 0 to 3300mV according to the measured temperature. Each mV corresponds to a certain temperature.

adc.SetLinearScale(-22,56) means -22 corresponds to 0mV and 56 corresponds to 3300mV. (I read in the brochure that the sensor range is -20 to 54°C, looks close to the values in SetLinearScale, right?)

Now, put your sensor into some water ice (0°C) and read the value you get back with SetLinearScale commented out. The rest of the math I leave up to you.

As suggested, I used ice to get the lower value, and I am still piddling around to get the correct higher value. What I have is: adc.SetLinearScale(-7, 52); I do not understand how these numbers are getting to the somewhat correct real temp values.

The program itself is displaying a change of temp in two degree increments, where in the program that is occurring, I do not know. Also the program uses ‘int’ for the variables, is there a valid designation to show decimal values? I suppose that will make some substantial changes to the program.

So far I am making some headway on this.

I’m a Googler myself, but this is good advice. Getting sub degree accuracy is possible, but requires more math, and may not be possible with this particular one. As others have said, it depends on the quality of the component. In general, these eBlocks are not designed to be highly sensitive/accurate. Hence the low price. They are meant to be more of a learning tool.

It looks like I am as close as I am going get with e-block, so now on to adding a time stamp function to the Rajesh program. If I am successful with that then the SD data logging feature will be next.

Thanks