AM2320 temp/ hum sensor. Same as DHT22?

A forum where Flowcode v7 user created components can be shared, discussed and reviewed.

Moderator: Benj

User avatar
E*2Engineer
Posts: 35
Joined: Wed Dec 25, 2013 6:54 pm
Has thanked: 12 times
Been thanked: 6 times
Contact:

AM2320 temp/ hum sensor. Same as DHT22?

Postby E*2Engineer » Wed Jan 31, 2018 8:28 am

Hello,
This sensor appears to be just the ticket for the project I am working on, with its 12 bit
accuracy in both temp/hum. No need for calibration,price, and other features.

However, upon reading the datasheet for the AM2320, it appears to be a I2C device,
yet the only talk I have seen of it on the discussion boards treats it as a 1 Wire device.

I personally would like to use it as a I2C device, the macro for it shows no connection for the clock line.

I really could use some help getting started with some working sample code (Pic 16f1789, FC7, running clock at 19.660800Mhz)
A simple read/ write routine would be great, I can work out the math, and from a previous post that explains the data stream,
I think I can get going once I get a 2 finger grip on using this device. I will admit however that communications has not been
something I have much experience in. I am however willing to put in the research necessary to get this down pat.
This is a situation where I know what I don't know, and that is alot..

If anyone is successfully using this device, I would appreciate you sharing a simple as possible read/write routine. in FC6 or 7.
Thank You,
-Craig C

User avatar
LeighM
Matrix Staff
Posts: 1890
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 446 times
Been thanked: 640 times
Contact:

Re: AM2320 temp/ hum sensor. Same as DHT22?

Postby LeighM » Wed Jan 31, 2018 10:01 am

Hi,
I've not manged to find that device yet, but here are some links that should be of help...
https://www.matrixtsl.com/blog/simplifi ... c-and-spi/
http://www.matrixtsl.com/resources/file ... eation.pdf
Leigh
These users thanked the author LeighM for the post:
E*2Engineer (Thu Feb 01, 2018 8:48 pm)
Rating: 5.26%
 

mnf
Valued Contributor
Valued Contributor
Posts: 540
Joined: Wed May 31, 2017 11:57 am
Has thanked: 53 times
Been thanked: 302 times
Contact:

Re: AM2320 temp/ hum sensor. Same as DHT22?

Postby mnf » Wed Jan 31, 2018 12:18 pm

I have a simple program that reads all the data from a AM2320 sensor. It was written for the Arduino - but should work on PIC (you'll need pull-ups on the SDA and SCL lines)

am2320.fcfx
(13.96 KiB) Downloaded 91 times


Note that it reads a block of 8 bytes - First 2 mirror command (3, 4) and last 2 are CRC.
Humidity is at 2,3 and temp at 4, 5. The program just spits them out to UART with no attempt to convert them to anything meaningful...

The data sheet is at https://akizukidenshi.com/download/ds/aosong/AM2320.pdf and at first glance is a little confusing? (I wrote the above based on the Arduino AM2320 library)

Martin
These users thanked the author mnf for the post:
E*2Engineer (Thu Feb 01, 2018 8:50 pm)
Rating: 5.26%
 

User avatar
E*2Engineer
Posts: 35
Joined: Wed Dec 25, 2013 6:54 pm
Has thanked: 12 times
Been thanked: 6 times
Contact:

Re: AM2320 temp/ hum sensor. Same as DHT22?

Postby E*2Engineer » Thu Feb 01, 2018 8:58 pm

Thank you both Leigh & Martin,

Between the info from the both of you, I was able to start using the AM2320.
This was more valuable to me right now than than you might imagine, as this is not
for just a "pass the time" project.

I appreciate the information from both of you.
-Craig C