I measured the voltage across the TMP36 with a multimeter and it looked correct (about .7V or so). I tried using different analog references (5V, 3.3V, internal 2.56V) and the readings were all lower than expected for the given reference voltages. I took the circuit and hooked it up to my Arduino Uno and ran the same sketch, and the readings look much more sensible. I also compared the values of an analog light sensor between the Yun and the Uno, and the Yun has consistently higher values as well. I also compared the output from the Yun and the Uno with more sensors hooked up, including a photo sensor and a DHT22 digital humidity/temperature sensor, and the Yun's readings look consistently lower for the analog inputs. Could the Yun have a defective ADC?
Output from the Yun with the basic temperature sensor:
Code: Select all
Temp reading = 144 - 0.46 volts
-3.59 degrees C
25.53 degrees F
Temp reading = 146 - 0.47 volts
-2.95 degrees C
26.69 degrees F
Temp reading = 142 - 0.46 volts
-4.24 degrees C
24.37 degrees F
Temp reading = 118 - 0.38 volts
-11.97 degrees C
10.45 degrees F
Code: Select all
Temp reading = 220 - 0.71 volts
20.90 degrees C
69.62 degrees F
Temp reading = 217 - 0.70 volts
19.93 degrees C
67.88 degrees F
Temp reading = 218 - 0.70 volts
20.25 degrees C
68.46 degrees F
Code: Select all
Temperature reading: 180
DHT Temperature: 75.38
Humidity: 62.10
Light level: 974
Temperature: 8.01
Temperature reading: 177
DHT Temperature: 75.38
Humidity: 62.40
Light level: 967
Temperature: 7.04
Temperature reading: 177
DHT Temperature: 75.38
Humidity: 62.40
Light level: 974
Temperature: 7.04
Temperature reading: 180
DHT Temperature: 75.38
Humidity: 62.70
Light level: 967
Temperature: 8.01
Code: Select all
Temperature reading: 229
DHT Temperature: 76.64
Humidity: 61.20
Light level: 1023
Temperature: 23.80
Temperature reading: 229
DHT Temperature: 76.64
Humidity: 61.20
Light level: 1023
Temperature: 23.80
Temperature reading: 228
DHT Temperature: 76.64
Humidity: 60.80
Light level: 1023
Temperature: 23.48