0

In working with the AM2315 temperature/humidity sensor, my program hangs at the am2315.begin(); line.

The only output I get is "Serial on"

Here is the code:

#include "cactus_io_AM2315.h"
AM2315 am2315;

void setup() {
     Wire.begin(0X20);
     Serial.begin(9600);
     Serial.println("Serial on");
     Serial.println(am2315.begin());     
     Serial.println("- - - - Weather station - - - - - - - -");
     Serial.println(" ");
     Serial.print("RH\t\tTemp (C)\tTemp(F)");
     Serial.println(" ");
}  // end setup

I have tried it both with and without the 10K pull-up resisters and get the same result. I'm not comfortable including them in any case because I will eventually use I2C&Power to link the I2C bus to many other devices and am not sure what that might do..

Right now none of that is hooked up. It is just the sensor and the Arduino and the laptop.

Voltages have been measured so I know the device is getting 5V power.

My connections and software are based on this article: http://cactus.io/hookups/sensors/temperature-humidity/am2315/hookup-arduino-to-am2315-temp-humidity-sensor


UPDATE: New information: When I am using I2C&Power, I provide power from only one of the dual-port units. But I discovered that leaving the SDA and SCL unterminated there it breaks the I2C that is trying to pass through it. By putting in 4.7K pull-up resistors there it restored the connection.

  • 1
    I added a DS3231 RTC module to the breadboard I2C bus and removed the 10K resisters, and now they both work. Apparently this sensor does not play well alone. But with the both of them it is fine. No need at all for the 10K resisters. (I am using a Nano) If I disconnect the RTC and reset, it again hangs at the am2315.begin statement, resistors or not. So this problem is solved now. – SDsolar Oct 29 '16 at 17:30
  • 1
    10K might have been to high a value. Test it with a lower value resistor (e.g. 1K). – Gerben Oct 29 '16 at 18:37
  • 1
    The Adafruit page mentions ~10k, but 4.7k is more typical for I2C pull-up resistors. Your RTC looks like it has 10k resistors built in, so that would have helped. Are you sure your resistors are 10k? Perhaps check with a multimeter. – Nick Gammon Oct 29 '16 at 21:42
  • All good ideas. I will try them out. Thank you. – SDsolar Oct 30 '16 at 5:10
  • New information: When I am using I2C&Power, I provide power from only one of the dual-port units. But I discovered that leaving the SDA and SCL unterminated there it breaks the I2C that is trying to pass through it. By putting in 4.7K pull-up resistors there it restored the connection. – SDsolar Nov 1 '16 at 2:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.