EasternStarGeek
Member
Hi,
Just tried using my new AM2315 Humidity/Temperature sensor with a Teensy 2.0, and I am getting bad data.
This is an I2C device available from Adafruit Industries:
http://www.adafruit.com/products/1293
Link to the library:
https://github.com/adafruit/Adafruit_AM2315
The code is an example included with the AM2315 Library:
Everything is wired the normal way, using a pair of 10K pullups to Vcc. I have made many successful gadgets using I2C in the past.
When I first start the system, the first 11 readings were normal at 24degC and 55.4%rh (close to a DHT-22 I also have running on a different system), but then the numbers went all weird- the Temperature value stuck at 3331.80 and the Humidity at 22.00 with minor variation (+/- 0.02% or so).
I tried disconnecting the USB, waiting 15 seconds, then plugged it in. Same thing.
The software is an un-modified (except for deleting an extraneous "}" at the end) example sketch that came with the Adafruit AM2315 library.
I ran exactly the same code for days with an Arduino Uno, with no difficulty.
I am currently using the Teensyduino 1.02 IDE.
Any clues will be most appreciated!
I posted this topic on the Adafruit board as well:
http://forums.adafruit.com/viewtopic.php?f=19&t=40118
but have not received much helpful information yet.
Thank you!
Just tried using my new AM2315 Humidity/Temperature sensor with a Teensy 2.0, and I am getting bad data.
This is an I2C device available from Adafruit Industries:
http://www.adafruit.com/products/1293
Link to the library:
https://github.com/adafruit/Adafruit_AM2315
The code is an example included with the AM2315 Library:
Code:
#include <Wire.h>
#include <Adafruit_AM2315.h>
/***************************************************
This is an example for the AM2315 Humidity + Temp sensor
Designed specifically to work with the Adafruit BMP085 Breakout
----> https://www.adafruit.com/products/1293
These displays use I2C to communicate, 2 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
// Connect RED of the AM2315 sensor to 5.0V
// Connect BLACK to Ground
// Connect WHITE to i2c clock - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 5
// Connect YELLOW to i2c data - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 4
Adafruit_AM2315 am2315;
void setup() {
Serial.begin(9600);
Serial.println("AM2315 Test!");
if (! am2315.begin()) {
Serial.println("Sensor not found, check wiring & pullups!");
while (1);
}
}
void loop() {
Serial.print("Hum: "); Serial.println(am2315.readHumidity());
Serial.print("Temp: "); Serial.println(am2315.readTemperature());
delay(1000);
}
Everything is wired the normal way, using a pair of 10K pullups to Vcc. I have made many successful gadgets using I2C in the past.
When I first start the system, the first 11 readings were normal at 24degC and 55.4%rh (close to a DHT-22 I also have running on a different system), but then the numbers went all weird- the Temperature value stuck at 3331.80 and the Humidity at 22.00 with minor variation (+/- 0.02% or so).
I tried disconnecting the USB, waiting 15 seconds, then plugged it in. Same thing.
The software is an un-modified (except for deleting an extraneous "}" at the end) example sketch that came with the Adafruit AM2315 library.
I ran exactly the same code for days with an Arduino Uno, with no difficulty.
I am currently using the Teensyduino 1.02 IDE.
Any clues will be most appreciated!
I posted this topic on the Adafruit board as well:
http://forums.adafruit.com/viewtopic.php?f=19&t=40118
but have not received much helpful information yet.
Thank you!