Git Product home page Git Product logo

dht11-it's Introduction

Non blocking DHT11 driver

This repository contains library for DHT11 temperature and humidity module. DHT11 requires 18ms delay in its read start sequence. This library has separate API for beginning and end of this sequence, it's up to the user to decide how to implement the delay (blocking, state machine or RTOS task based).

Usage

  1. Modify HAL include in dht11.h if needed.
  2. Configure pin that is connected to DHT11 as EXTI interrupt on falling and rising edge
  3. Configure timer for 1us tick
  4. Initialize DHT11_TypeDef with: pointer to data buffer, pointer to timer handle, GPIO pin and GPIO Port.
  5. Put DHT11_IRQHandler in interrupt handler or EXTI callback.
  6. Implement function void DHT11_RecieveCpltCallback(DHT11_TypeDef *dht)
  7. Call DHT11_Start_Init
  8. Wait for ~18ms
  9. Call DHT11_Start_End
  10. DHT11 will send data now, it will be available after callback executes.

Recieved data

Data is saved in 5 byte long buffer, meaning of bytes:

  1. Humidity - integral part
  2. Humidity - decimal part (always 0 on DHT11)
  3. Temperature - integral part
  4. Temperature - decimal part
  5. Checksum - should be equal to a sum of previous bytes in buffer

Interrupts and data transmission

Interrupts (orange) and transmitted bits (white): interrupts

Full data transmission: full-transmission

dht11-it's People

Contributors

mrutkowski2904 avatar

Stargazers

Oliwia Poćwiardowska avatar

Watchers

James Cloos avatar  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.