Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rsm-lisper/arduino-uno-am2320.ulisp

Arduino Uno AM2320 I2C (temperature and humidity) sensor support in uLisp.
https://github.com/rsm-lisper/arduino-uno-am2320.ulisp

arduino-library arduino-uno humidity-sensor temperature-sensor ulisp

Last synced: about 23 hours ago
JSON representation

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

Awesome Lists containing this project

README

        

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

** Connecting AM2320 Sensor to Arduino Uno
| *AM2320 Front* |
|------+--------+-----+--------|
| VDD | SDA | GND | SCL |
| |
| 5.5V | SDA/A4 | GND | SCL/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:
#+BEGIN_EXAMPLE
> (gth)
(25 50)
#+END_EXAMPLE
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.