2C PCF8574" name="description"> MicroLib_DHT11
MicroLib_DHT11

If you want to connect one or more DHT11 Humiture sensors to your Arduino, you should try this library!

With this MicroLib your Arduino board will be able read the actual temperature and humidity from a DHT11 sensor. Due to limiting just to the DHT11-sensor this library occupies less than one Kilobyte of program-memory. All you need to do is to include the file MicroLib_DHT11.h to your program.

[Library API] [Example1] [DHT11 data sheet]
Library API

[DHT11_Init] [DHT11_Read]

Sub-routines and pre-processor macros

  • void DHT11_Init; Initialize port for DHT11 sensor, parameters:
    • uint8_t p_Pin - The digital port to which the DHT11 is connected
    You can use as many DHT11 sensors as digital-inputs are available at your system.
    Example: DHT11_Init(DHT11_pin);
    Quick-Links

  • int8_t DHT11_Read; Read temperature- and humidity-data from DHT11 sensor , parameters:
    • uint8_t p_Pin - The digital port to which the DHT11 is connected
    • int16_t* p_Humidity - The address of an int16_t variable to store the humidity-value
    • int16_t* p_Temperature - The address of an int16_t variable to store the temperature-value
    Example: if (DHT11_Read(DHT11_pin, &v_Humidity, &v_Temperature) == 0) ...
    Quick-Links
Example1

A minimalistic example: Initialize the DHT11 pin, then read the temperature- and humidity-values in a loop and print them to the serial console.

Back to the top of the document.