Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/rsm-lisper/arduino-uno-am2320.ulisp
- Owner: rsm-lisper
- License: mit
- Created: 2019-02-20T00:51:44.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-25T16:52:53.000Z (almost 6 years ago)
- Last Synced: 2024-11-06T00:37:10.575Z (about 2 months ago)
- Topics: arduino-library, arduino-uno, humidity-sensor, temperature-sensor, ulisp
- Language: Common Lisp
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
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.