AM2315 Encased I2C Temperature and Humidity Sensor ($23.95)
Note: This product has been retired. The replacement part is the AM2315 with a Grove connector attached. You can easily cut off the connector if you wish to connect the wires directly. The Grove AM2315 is here.
Comments are now closed. Please go to the Product Support Forum at the top of the page.
[include-page id=”buy-include-file”]
The AM2315 I2C capacitive humidity sensing digital temperature and humidity sensor contains a temperature and humidity combined sensor calibrated digital signal device. It uses special temperature and humidity acquisition technology, to ensure that the sensor has high reliability and excellent long-term stability. The sensor includes a capacitive sensor and an integrated high-precision temperature measurement device.
This probe has been used in numerous SwitchDoc Labs projects including Project Curacao, WeatherPi and the upcoming SunRover solar powered robot.
Features
- 3.3V to 5.5V I2C interface and power (SwitchDoc Labs finds it works better on a 5.0V I2C bus in general, but it does work with the Raspberry Pi 3.3V I2C)
- 10 mA max current use during conversion
- Good for 0-100% humidity readings with minimum 2% accuracy
- Good for -20 to 80°C temperature readings ±0.1°C typical accuracy
- Updated every 500ms (0.5 Hz)
- Body size 98mm x 16mm diameter
- 20 inch long – 4 wire cable
- This board/chip uses I2C 7-bit address 0x5C.
SwitchDoc Labs uses these fine sensors on many of our projects, including WeatherPi, Project Curacao and SunRover (a solar powered robot). They are working well in these designs, so we decided to search out the manufacturer and carry this part for our customers.
A small microprocessor inside the AM2315 provides the readings and adjustments to the values from the sensors and supports an I2C interface for reading the finished & calibrated data. The sensor is in a rugged case and comes with a mounting bracket.
While it is not waterproof, it is weather resistant. This sensor does better for sensing temperature and humidity where there might be wind and rain. SwitchDocLabs also sells a plastic sunshield for this device, which will available shortly.
When looking for the AM2315 using i2cdetect (on the Pi) or I2CTest on the Arduino, remember that this device has a sleep mode and so you may have to look twice.
Hooking it Up
Connect the red wire to 5V (or 3.3V for the Raspberry Pi – note: it works better at 5.0V I2C) power, black to ground, yellow wire to your i2c SDA pin, and the white wire to the i2c SCL. You cannot change the i2c address so only one sensor per i2c bus. However, you can use the SwitchDoc Labs 4 Channel I2C Mux to support multiple devices in one project. You can also use the 4 Channel I2C Mux to convert the Raspberry Pi 3.3V I2C bus to 5.0V I2C.
Two ~10Kohm pullup resistors on the I2C bus are required for use, connected from the SDA and SCL lines to the power wire. Note that many devices, including the SwitchDoc Labs 4 Channel I2C Mux already have these pullup resistors. Further note that Arduino’s DO NOT HAVE 10K Pullups on their I2C bus.
TroubleShooting
If you don’t see it on your i2cdetect on the Raspberry Pi or I2C scanner on the Arduino, remember the following two things:
1) Check your wiring. Note that the colors aren’t a reliable guide to what wire goes where. Make sure you read the label on the wires. I’m sure you have done this, but check it again. The colors vary from batch to batch.
2) The AM2315 Outdoor temperature sensor is at address 0x5C. The manufacturer of the device puts the sensor into a sleep mode except when it is going to be used to avoid self heating of the sensor. That makes sense, however, it means you have to go through a funny sequence to make sure the device is awake and responding. It doesn’t respond to an Arduino I2C scan nor a Raspberry Pi I2C scan, i2cdetect.
You can run the i2cdetect -y 1 twice quickly and it will often pick the sensor up on the second run.
The best thing to do to determine if it is actually there is run the test software and see if you are getting data. That is how we detect if it is present.
https://github.com/switchdoclabs/Pi_AM2315
Full Specification
You can download the full specification here.
Software
The Arduino drivers are archived on github.com/switchdoclabs/Arduino_AM2315.
The Python Raspberry Pi drivers, test program and installation procedure are on github.com/switchdoclabs/Pi_AM2315.
Raspberry Pi
Sop with has provided an excellent tutorial for hooking up the AM2315 to a Raspberry Pi here. Note: We don’t recommend hooking up the Raspberry Pi I2C bus to 5.0V pull-ups as shown in the tutorial. We recommend 3.3V as the Pi I2C lines are not 5.0V tolerant.
I live in the northeast and I am wondering how this will stand up in the cold / ice / snow… I’m wondering if I should also get a radiation shield for this or do you think its ok alone?
Hi Hans,
Ice will lock anything unless you heat it. Snow? OK. Cold? OK. If you have an outdoor temperature sensor, it is a good idea to put it under a shield. So the sun won’t shine directly on it. I’ve had AM2315 humidity sensors quit working after baking in the sun for several months in the tropics. I knew better.
SDL
when will the sunshield be available for purchase?
thanks
-rebot
Next month is the plan!
SDL
I’m trying to add this temperature sensor to my weatherPi. When I remove the MUX and the weather rack sensors, running the test program shows temperatures.
But following the first layout of the Grove MUX homepage (‘Connected to the Raspberry Pi (3.3V) – all busses at 3.3V’) where I wire up the Pi to JP1 of the MUX and I’ve added a pin from vcc to the reset pin on JP1 of the Grove MUX. I have connected every pin of JP7 to JP6 to get power to all the bus’.
I have put the weather rack sensors on JP2, nothing on the INT pin.
I have put the correct wires on the other jumpers of the MUX but for the life of me I cannot get the temperature sensor to return anything from the test program.
Running the test TCA program I get this returned:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: — — — — — — — — — — — — —
10: — — — — — — — — — — — UU — — — —
20: — — — — — — — — — — — — — — — —
30: — — — — — — — — — — — — — — — —
40: — — — — — — — — 48 — — — — — — —
50: — — — — — — — 57 — — — — — — — —
60: — — — — — — — — 68 — — — — — — —
70: — — — 73 — — — 77
The temperature sensor from what I read shouldn’t be on 1b, but 0b. How should this sensor be wired up on the Grove MUX?
Sam,
I’m confused. You are trying to put the WeatherRack sensors on the Grove I2C Mux? They aren’t I2C sensors. Analog sensors.
What temperature sensor are you using? Go ahead and remove the VCC to reset pin on JP1 of the Grove Mux. It’s pulled high with a pullup resistor.
UU generally means that the I2C device is being used by another program.
Best,
SDL
Yes, thx for reminding me of the analog components of the WPA. The ac2315 sensor, leads correctly applied, and the ONLY i2c device on the Grove MUX on JP2 (Pi is attached to JP1 of the Grove as outlined in the GroveMUX instructions and the positive voltage removed from the reset jumper on JP1 returns no real change in output. The WPA has been removed from the Grove MUX.
Temperature returned from the a2315 program yields 0.0 for several cycles.
The test TCA program yields UU for the am2315 sensor, 73 for all bus, with only bus0 in use for the am2315 sensor.
If the WPA attached to the Grove MUX was the cause of the am2315 sensor not being seen, then having the am2315 sensor be the only i2c device should work. When the Grove MUX is removed and the am2315sensor is attached to the SCL, SDA ports of the Pi then the temperature is returned, so the sensor seems to be fine. It’s just this interaction with the Grove MUX that is not working. What am I doing wrong
Sam,
The AM2315 does not respond to i2c detect on the pi. From the product page: https://www.switchdoc.com/am2315-encased-i2c-temperature-and-humidity-sensor/
TroubleShooting
If you don’t see it on your i2cdetect on the Raspberry Pi or I2C scanner on the Arduino, remember the following two things:
1) Check your wiring. Note that the colors aren’t a reliable guide to what wire goes where. Make sure you read the label on the wires. I’m sure you have done this, but check it again. The colors vary from batch to batch.
2) The AM2315 Outdoor temperature sensor is at address 0x5C. The manufacturer of the device puts the sensor into a sleep mode except when it is going to be used to avoid self heating of the sensor. That makes sense, however, it means you have to go through a funny sequence to make sure the device is awake and responding. It doesn’t respond to an Arduino I2C scan nor a Raspberry Pi I2C scan, i2cdetect.
You can run the i2cdetect -y 1 twice quickly and it will often pick the sensor up on the second run.
The best thing to do to determine if it is actually there is run the test software and see if you are getting data. That is how we detect if it is present.
https://github.com/switchdoclabs/Pi_AM2315
Regarding the Grove I2C Mux. If you connect something on Bus0, you need to tell the I2C Mux to use Bus0. See how this is done in the TCA test program.
Best,
SDL
Troubleshooting step 1: Removing the Grove MUX and hooking the am2315 directly to the Pi returns temperature using the testam2315 program. It does NOT work with the Pi driving the Grove MUX using the testam2315 program. That would suggest that the am2315 is not faulty. It also suggests that my wiring is not likely to be the issue because if I wire it correctly to the Pi then it stands to reason I’m doing so correctly on the Grove MUX. I’ve looked so MANY times at the wiring on the MUX …
Hooking the WPA onto the BUS0 shows the bmp180, etc are responding as expected. Thus, the Grove MUX is not broken.
Frustrated, I looked up your revised Intractable and see the am2315 hooked up to 5v of the Sun board. I don’t have that, but do have a stable power supply. So I wired up the 5v pin (2) from the Pi to Grove I2C Mux / JP6 Pin 2 (VDU1) so that the am2315 will be powered by 5v, not 3.3v. The output of the test am2315 program yields 0.0 as before when the am2315 is hooked up to the MUX.
Let’s unpack your most recent statement: “Regarding the Grove I2C Mux. If you connect something on Bus0, you need to tell the I2C Mux to use Bus0. See how this is done in the TCA test program.”
If you mean the test program for the TCA it seems to me you are talking about the following declaration:
tca9545.write_control_register(TCA9545_CONFIG_BUS1)
As you have reiterated, the am2315 does not respond to the test TCA program, nor does the test am2315 program when hooked up to the Grove MUX. And I have this declaration in play in the main Weather program. But I still have no data retuned from the am2315 sensor using the MUX, especially when hooked up to the MUX.
Re-reading the overall project I note that I have an ADS1015 chip soldered to my WPA. Could this be affecting the am2315? I don’t see how in the code. However, the am2315 when it is the only device on the MUX, either BUS0 or BUS1 is not working.
That’s the only variable I can think that may have an impact.
Sam,
I think you are not programming the I2C Mux to talk to the bus that the AM2315 is connected to. This HAS to be it. Since the AM2315 works without the Mux connected, it is something about the Mux and I’ll bet it is the programming.
Simplify the problem for a test. Take the test TCA program and insert the AM2315 code to read the AM2315 in the Test code when the test code has turned on the correct bus. Post the resulting test code and let’s look at it.
No, the ADS1015 is at a different I2C address than the AM2315.
Thanks,
SDL
Yes, at first I was trying to determine why you suggested that because we keep using the testam2315 program. So I copied the operative parts into the testSDL_Pi_TCA9545 program. And amazingly, I got the following with the code pasted into BUS1.
addr =0x73 register = 0x0 data = 0x1
———–BUS 0——————-
addr =0x73 register = 0x0 data = 0x1
tca9545 control register B3-B0 = 0x1
ignore Interrupts if INT3′ – INT0′ not connected
tca9545 control register Interrupts = 0x0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: — — — — — — — — — — — — —
10: — — — — — — — — — — — UU — — — —
20: — — — — — — — — — — — — — — — —
30: — — — — — — — — — — — — — — — —
40: — — — — — — — — 48 — — — — — — —
50: — — — — — — — 57 — — — — — — — —
60: — — — — — — — — 68 — — — — — — —
70: — — — 73 — — — 77
———————————–
———–BUS 1——————-
addr =0x73 register = 0x0 data = 0x2
tca9545 control register B3-B0 = 0x2
ignore Interrupts if INT3′ – INT0′ not connected
tca9545 control register Interrupts = 0x0
temperature: 26.5
humidity: 39.0
crc: 1
temperature: 26.5
humidity: 38.5
crc: 1
temperature: 27.0
humidity: 39.4
crc: 1
In my WeatherPi program, I’ve assigned the am2315 to BUS1. Is that all I should do? Or is there more? thx, sam
Sam,
Wow! You have gone to the races! If you are aren’t using SunAirPlus, it sounds like you are done. SunAirPlus is usually assigned to Bus1 too.
SDL