Low and unstable analog readings from Yun

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
georgejlee79
 
Posts: 1
Joined: Fri Sep 19, 2014 11:27 pm

Low and unstable analog readings from Yun

Post by georgejlee79 »

I got my Arduino Yun today and was able to set it up and run some simple sketches. I hooked it up to a TMP36 temperature sensor and get unusually low and unstable readings from the analogRead() call. I used the code at https://learn.adafruit.com/tmp36-temper ... emp-sensor, modified slightly to send the output to Console instead of Serial. I am using the 3.3V external reference. I am using the 1.5.7 IDE. I tried using other analog input pins but I see the same problem. I tried powering it off and powering it back on, this did not help. I also tried using two different power supplies with no improvement.

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
Output from the Uno:

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
Output from the Yun with more sensors hooked up, including a photo sensor and a DHT digital humidity/temperature sensor:

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
When I run the same sketch on the uno, I get higher readings for both the light and temperature sensors. The TMP36 temperature is pretty close to the DHT22 temperature (I'm printing out the DHT22 temp in Fahrenheit and TMP36 in Celsius below, but the temperatures are within about 2 degrees F).

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
Could there be something wrong with the ADC on the Yun? Or is there something else I need to do to make this work?
Attachments
sensor_yun.txt
The sketch with a TMP36, a photocell, and a DHT22 for the Yun.
(1.11 KiB) Downloaded 21 times
temp_yun.txt
The sketch with just the TMP36 sensor for the Yun
(1.57 KiB) Downloaded 18 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Low and unstable analog readings from Yun

Post by adafruit_support_rick »

We an try replacing the Yun. Please email [email protected] with a link to this thread for a replacement

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”