Temp Sensor does not get reasonable result

wildbill:
This:

sensorValue_Light = analogRead(sensorPin_Light);

sensorValue_Temp = analogRead(sensorPin_Temp);




may be problematic. The analog pins share a single A2D converter. If you try to read from multiple pins in rapid succession, the later results tend to be inaccurate. Recent posts have suggested a couple of remedies: use a small delay between readings or take two readings for each input and ignore the first. In your case, just commenting out the analogRead for the light should show you if that is the issue.

I have tried both ways: only read temperature and read twice when there is light sensor. fortunately, both of them works well for me. Thank you very much. :slight_smile: