You can easily wire this breakout to any microcontroller, we'll be using an Arduino compatible. For another kind of microcontroller, just make sure it has I2C, then port the code - its pretty simple stuff!

  • Connect Red wire to the power supply, 3-5V is fine. Use the same voltage that the microcontroller logic is based off of. For most Arduinos, that is 5V
  • Connect Black wire to common power/data ground
  • Connect the White wire pin to the I2C clock SCL pin on your microcontroller
  • Connect the Yellow wire pin to the I2C data SDA pin on your microcontroller

Don't forget to install two 2K-10K pullup resistors from SDA and SCL to Vin (3V or 5V, whatever logic level your microcontroller is)!

The AM2315 has a default I2C address of 0x5C and cannot be changed.

Install Adafruit Sensor

Open up the Library Manager in the Arduino IDE...

Search for Adafruit_Sensor to locate the Unified Sensor library and Install it

Download Adafruit_AM2315

To begin reading sensor data, you will need to also install the Adafruit_AM2315 library.

We also have a great tutorial on Arduino library installation at:
http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use

Load Demo

Open up File -> Examples -> Adafruit_AM2315 -> am2315test and upload to your microcontroller wired up to the sensor

Thats it! Now open up the serial terminal window at 9600 speed to begin the test.

You can try breathing on the sensor to increase the humidity.

The temperature output is in degrees Celsius.
This guide was first published on Oct 04, 2018. It was last updated on Oct 04, 2018.
This page (Arduino Code) was last updated on Oct 30, 2020.