Giter VIP home page Giter VIP logo

webthing-esp32-humidity-am2301's Introduction

IoT Thing: Humidity sensor (AM2301/DHT21)

Introduction

This is web connected humidity and temperature sensor based on AM2301/HT21 sensor.

Dependencies

Requires:

Features

Humidity sensor thing has MultiLevelSensor @type and following read-only properties:

  • humidity, range 0..100 %, @type LevelProperty
  • temperature, range -40..80 Celsius, @type LevelProperty
  • dew point, range -20..40 Celsius, @type TemperatureProperty

Documentation

Start thing by running the following code

```
root_node_init();

//initialize thing and add to the thing server
add_thing_to_server(init_humidity_sensor_am2301("am2302 sensor"));
```

Data is read from sensor every 5 seconds (2 seconds are minimal according to AM2301 documentation). Sensor data include parity byte to validate data correctness. If the parity byte check fails, the received data is ignored.

The humidity and temperature obtained from sensor are used to calculate dew point. If the node has websocket clients data is sent to them if:

  • temperature: |last sent temperature - current temperature| >= 0.1
  • humidity: |last sent humidity - current humidity| >= 1
  • dew point: |last sent dew point - current dew point| >= 0.5

or 30 seconds have passed since the last data was sent.

AM2301 generates random spikes in temperature values, so you can enable digital filtering of received data. The filter introduces a dalay of about 100 sec between the data read from the sensor and the data sent to clients.

Configuration

GPIO number for receiving data from sensor can be set in idf.py menuconfig -> Humidity sensor AM2301 -> AM2301 data GPIO number. Default is 25.

Digital filltering is enabled in idf.py menuconfig -> Humidity sensor AM2301 -> Enable sensor data filtering. By default fillering is enabled.

Gateway web interface

humidity sensor

Scheme

scheme

Source Code

The source is available from GitHub.

License

The code in this project is licensed under the MIT license - see LICENSE for details.

Authors

  • Krzysztof Zurek - kz

webthing-esp32-humidity-am2301's People

Contributors

krzysztofzurek1973 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.