Skip to content
Advertisements

Measuring temperature and humidity using AM2320 (DHT12 ??) i2c sensor

 

Hello, in this tutorial I’m using  AM2320 (DHT 12 ??) temperature and humidity sensor with Arduino UNO board, this sensor is sold by Adafruit just like the DHT11 and DHT22, same design but this module has an i2c bus,  with a 0 – 99% RH ±3 and -40° – 80°C ±0.5 in humidity/temperature range.

 

 

You may find a name confusion, a lot of sellers tell that AM2320 is DHT12 but I looked after making the video and found may be DHT12 is a separate product (blue) correct me if I’m wrong.

Here’s the datasheet.

But as usual I bought a cheap chinese version because they’re widely available, and this version doesn’t work with Adafruit library and doesn’t even get detected by the i2c scanner code (it worked but not well for one or two single times then lost the detection, usually the i2c scanner works well and detects everytime), tried few libraries until I found one.

And don’t forget I’m using the module version which has a pull-up resistor, you can add it if you want.

 

Wiring:

 

5.jpg

 

6.jpg

 

Library:

-So the library that worked for me is this one: Download, you can try the official one it may work …

-Lcd i2c library: Download

Code:

-I2c scanner: Download

-The first code I tried which reads the data from the sensor and display it on the serial monitor is just from the example in the library.

-The second code which works with LCD i2c screen you can download it here.

 

If there’s a problem, contact me.

Advertisements

Yassine View All

Electronics, Automation engineering student... I try to share my little experience with other electronics amateur.

One thought on “Measuring temperature and humidity using AM2320 (DHT12 ??) i2c sensor Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: