cactus.io logo

How to Hookup Arduino to the AM2315 Temperature - Humidity Sensor

Overview

The AM2315 is a digital I2C humidity - temperature sensor that is mounted in a protective housing. It is not waterproof but sufficient to provide some protection to both sensors mounted inside. It use the DS18B20 along with a capacitive humidity sensor. It has it's own controller that provides a I2C interface to both of these sensors. We cannot change the address of device so it only supports one device per I2C bus. It is supplied with two mounting brackets depending on how you want to physically mount the device.

Images

AM2315 Humidty Temperature Sensor
Note: Images shown on this page are not to scale.

Hardware and Software Parts List

  • Arduino Board
  • AM2315 Sensor. We used the Adafruit PN 1293 AM2315 Sensor
  • 2 * 10K Pullup Resistor
  • Breadboard hookup wires
  • USB Cable to suite Arduino

Data Sheets


Wiring diagram for connecting the AM2315 Sensor to the Arduino

Connect Arduino to AM2315 Temperature Sensor Hookup

Breadboard Wiring diagram for connecting AM2315 Sensor to the Arduino Board

Connect Arduino to AM2315 Temperature Sensor Breadboard Hookup

Software

We can test this sensor using the simple sketch as shown below. It requires the cactus.io AM2315 Library to communicate with the sensor.

It reads the temperature and humidity every 2 seconds and then displays it on the console.

Limitations
  • Supports only one sensor on the I2C bus
  • Its blocking code.
AM2315 Sample Sketch
Download as (Arduino Sketch) (Text File)
1
/* Example sketch for AM2315 humidity - temperature sensor
2
Written by cactus.io, and requires the cactus_io_AM2315 library. public domain
3
This sketch will work with the Adafruit AM2315 sensor.
4
For hookup details using this sensor then visit
5
http://cactus.io/hookups/sensors/temperature-humidity/am2315/hookup-arduino-to-am2315-temp-humidity-sensor
6
*/
7
8
#include <Wire.h>
9
#include "cactus_io_AM2315.h"
10
11
// Create an instance of the AM2315 sensor
12
AM2315 am2315;
13
14
void setup(){
15
Serial.begin(9600);
16
Serial.println("AM2315 Humidity - Temperature Sensor");
17
Serial.println("RH\t\tTemp (C)\tTemp (F)");
18
19
if (!am2315.begin()) {
20
Serial.println("Sensor not found, check wiring");
21
while (1);
23
}
23
}
24
25
void loop(){
26
27
am2315.readSensor();
28
29
Serial.print(am2315.getHumidity()); Serial.print(" %\t\t");
30
Serial.print(am2315.getTemperature_C()); Serial.print(" *C\t");
31
Serial.print(am2315.getTemperature_F()); Serial.print(" *F\t");
32
33
// Add a 2 second delay.
34
delay(2000);
35
}

Sketch Console Output

Connect Arduino to AM2302 Humidity - Temperature Sensor

License