RobTillaart / AM232X

Arduino library for AM2320 AM2321 and AM2323 I2C temperature and humidity sensor
MIT License
13 stars 5 forks source link

AM2320: Single bus connection #26

Closed B-G-T closed 1 year ago

B-G-T commented 1 year ago

The AM2320 provides not only I2C but can be connected also via single wire. Do you plan to support this mode too?

RobTillaart commented 1 year ago

Thanks for the question. You're the first to ask. It is not planned for now.

Is the protocol described in the/a datasheet? Does the protocol looks like e.g like the DHT22?

If time permits I might dive into it.

B-G-T commented 1 year ago

It's the same protocol as used by DHT22. It's described in detail in the DS.

RobTillaart commented 1 year ago

Why not use my DHTNEW library then, and force the type to 22.

RobTillaart commented 1 year ago

It might be an idea to add new types to the DHTnew lib to explicit support the AM2320. Did that also for the Sonoff Si7021

RobTillaart commented 1 year ago

Note: datasheet page 20 section 8.3 Single bus communication (ONE-WIRE)

B-G-T commented 1 year ago

When I raising my questions, I was not aware yet that DHT22 and AM2320 use the same one-wire protocol (and AM2320 is also not listed under supported devices). Now it's working fine!

RobTillaart commented 1 year ago

Good to hear it works. I will make a note of it in the readme.md.

RobTillaart commented 1 year ago

I will add this section in the near future to the readme.


One Wire Protocol

The AM2320, AM2321 and AM2322 can also be read by using a "OneWire" protocol. This protocol is identical to the DHT22 and will only provide a temperature, a humidity and a CRC. See issue #26.

If one wants to use this protocol, one can use https://github.com/RobTillaart/DHTNew and optionally force the type to 22.