Introduction: Connecting AM2320 With Arduino

Picture of Connecting AM2320 With Arduino

Hi guys. This is my first instructable. I decided to tell you how to connect a humidity and temperature sensor AM2320 to Arduino board.

This sensor is very accurate and sensitive so it's great for high precise measurements. However it's a new sensor and there is almost nothing about it. You must notice that AM2320 is not a DHT series and it requires I2C connection. This is very useful if you are using it for a weather station along with BMP180 which is also I2C.

I tried several libraries with no success until I made it. So if you want to buy an AM2320 here is how to use it with Arduino.

Step 1: What You'll Need

Picture of What You'll Need

Part list:

1. Arduino pro mini or compatible board.
2. USB to Serial adapter a.k.a. FTDI (just in case you are using pro mini)
3. AM2320
4. Some wires.
5. Arduino IDE

Some other things:

1. Solder.
2. Cutting tool or knife.
3. Some basic skills.

Step 2: Soldering the Wires

Picture of Soldering the Wires

You'll need to solder some wires to the AM2320 pins because they are very thin to use DuPont connectors directly. However I'm still using DuPont wires but cut in half. Just grab your solder and do it.

Now all you need is to connect everything and use some code of course.

Step 3: Connecting...

Picture of Connecting...

Well this is the easiest part. Just grab the wires and connect them until there is no open wire left.

I'm unable to make a circuit design at this moment so I'll describe the connections.

AM(1) -- 5Vcc
AM(2) -- A4
AM(3) -- Gnd
AM(4) -- A5

Step 4: Library and Codding

Picture of Library and Codding

This is the crucial step. I searched a lot and tested a lot and finally I succeeded to put this sensor to work. I found the library in the comments of a Russian blog post. This is how deep I searched for a proper solution :-)

Here is the link for the library at GitHub: AM2320-master

The code is as an example inside so just download and install the library.

Step 5: Final Tests

Picture of Final Tests

As you can see in the screenshot it works. And also you may note that the humidity went more than 99% when I breathed to the sensor.

And that's all. Don't be afraid to test this awesome sensor and share your experience.

I hope you enjoyed my first instructable and sorry for my non-native English :-)

Comments

KennethA54 (author)2017-09-30

Note that DHT22 emulation is supported - just connect pin 4 to GND (pin 3).

When in DHT22 emulation, one less wire is needed, of course. In DHT22 emulation wiring, my own GitHub project is available to enable multiple devices on Arduinos that have multiple Pin Change Interrupt (PCI) pins (most do). Every PCI pin can support its own DHT-compatible sensor. My demo code will display sensor readings (all or selected) and is intended as a starting framework for end-users willing to modify it to their purposes. It is called

Arduino_DHTs_on_Interrupt_steroids-and-pin-detailer-

Well it's helpful to know that but AM2320 is NOT a DHT series sensor so it won't work with it. But thank you for your note. If I choose to use DHT sensors I'll definitely gonna try it.

I am using three genuine AM2320 stamped with AOSONG labeling. With pin 3 and 4 shorted together, I am using self-written code following DHT22 protocol. Works perfectly emulating DHT22. I am not guessing, this is real life supported by manufacturing engineering/application data.

อริยะแ (author)2017-05-31

Can I connect AM2320 more than 1?

Yes you can but with some additional hardware. There are two things you can try:

1. You can use an i2c multiplexer module which lets you to use up to 8 i2c sensors with the same address. You can find one here: http://www.ebay.com/itm/192035992071

2. You can use a logic switch to power up only one sensor at a time as described in this post: https://blogs.msdn.microsoft.com/laurelle/2012/02/24/using-2-identical-i2c-device-on-the-same-i2c-bus/

I prefer the first solution as it's cheap and stable.

I'll be happy if you try and reply with the results. Good luck! :-)

gmannz (author)2017-03-25

Thanks for the clear and simple instructions. The library proved very useful. After checking around various resources on the internet, it is still up to date. One note, I could not get this to work on the Genuino 101, only the uno.

sffaf (author)2016-09-01

Hi, большое спасибо! i needed this, i have a problem, i added the library and opened one of the examples, and without modifying anything it would not compile, i get this error:

am2320_I2Clcd2.ino:11:2: error: 'AM2320' does not name a type

am2320_I2Clcd2.ino: In function 'void loop()':

am2320_I2Clcd2.ino:30:13: error: 'th' was not declared in this scope

Error de compilación

any idea why?

fumble (author)sffaf2016-10-11

Try another version of Arduino-IDE - this should help...

hexadec. (author)2016-06-07

Great job, saved me some work and searching. Thanks

Your English is very good too. :-)

StanKaravelikov (author)hexadec.2016-06-07

Thank you! I'm happy to know that my efforts helped someone :-)

About This Instructable

20,986views

34favorites

License:

More by StanKaravelikov:Connecting AM2320 With ArduinoSmart Ideas
Add instructable to: