Skip to content

Arduino Uno AM2320 I2C (temperature and humidity) sensor support in uLisp.

License

Notifications You must be signed in to change notification settings

rsm-lisper/arduino-uno-am2320.ulisp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Arduino Uno AM2320 I2C (temperature and humidity) sensor support in uLisp.

Connecting AM2320 Sensor to Arduino Uno

AM2320 Front
VDDSDAGNDSCL
5.5VSDA/A4GNDSCL/A5
Arduino Uno

(Front of AM2320 Sensor is where the markings on the cover are.)

Usage

gth (function)

To request sensor information, call gth (get-temperature-humidity) function:

> (gth)
(25 50)

It returns list with two values - temperature and humidity. In the example above - temperature 25C, humidity 50% (int values).

On connection problems returns nil.

Warning! AM2320 is very slow. It’s slow in response and slow in refreshing internal data (2s!). On the first request it can reply with some very old data, so it’s good idea to send another request after ie 3s.

Implementation

For some strange reason, sensor does not respond to the first connection. So we have to drop it and then connect again, to send request. Also for some strange reason, we can’t restart I2C to read the response. We have to close connection again, and then connect to read 8 bytes long response.

There is no CRC check implemented yet.

At the end we piece together information from the response we received.

About

Arduino Uno AM2320 I2C (temperature and humidity) sensor support in uLisp.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published