dht 0.0.8

  • README.md
  • Installing
  • Versions
  • 50

DHT Dart/Native library

A library for DHTxx and SHT3x sensors. Supported devices:

  • Raspberry Pi 3
  • DHT22/AM2302 (see https://www.adafruit.com/product/385)
  • SHT3x (see https://www.sensirion.com/en/environmental-sensors/humidity-sensors/digital-humidity-sensors-for-various-applications/)

Use of the DHT Dart/Native source code is governed by a BSD-style license that can be found in the LICENSE files in corresponding folders.

The Native library uses:

  • Adafruit Industries software which is governed by the license text in the headers of the corresponding files https://github.com/adafruit/Adafruit_Python_DHT

  • DHT22 Sensor Driver https://github.com/Filkolev/DHT22-sensor-driver

Your use of the DHT Dart/Native signifies acknowledgement of and agreement to the aforementioned licenses.


dht/ - Dart library

dht_native/ - Native library, includes Adafruit Industries source code

third_party/ DHT22-sensor-driver/ - Linux driver

Native lib installation/upgrade

$ sudo cp libdht_native.so /usr/local/lib/ $ sudo ldconfig

Linux driver insertion example (optional)

$ sudo insmod dht22_driver.ko gpio=4 autoupdate=1


Simple usage examples see in the dht/example/ folder

Features and bugs

Please file feature requests and bugs at the issue tracker.



  • Implemented SHT3x sensor support


  • Implemented sampling history:
    • Constructor DHT(DHT_Model model, RPI_Pin pin, [int bufferSize = _DEFAULT_BUFFER_SIZE])
    • Stream DHT.readHistory({final int begin = TIMESTAMP_MIN, final int end = TIMESTAMP_MAX, final int pageSize = _DEFAULT_HISTORY_PAGE_SIZE})


  • Implemented stream read:
    • DHT.readStream(Duration interval)


  • Native library is not binary compatible with version 0.0.3 - please upgrade as described further in [Native lib installation/upgrade]
    • Native library's DHT.read() returns sensor data as TypedData i.s.o. an array of two Doubles


  • Initial version, created by Stagehand

1. Depend on it

Add this to your package's pubspec.yaml file:

  dht: "^0.0.8"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:dht/dht.dart';
Version Uploaded Documentation Archive
0.0.8 Oct 27, 2017 Go to the documentation of dht 0.0.8 Download dht 0.0.8 archive
0.0.7 Oct 27, 2017 Go to the documentation of dht 0.0.7 Download dht 0.0.7 archive
0.0.6 Aug 20, 2017 Go to the documentation of dht 0.0.6 Download dht 0.0.6 archive
0.0.5 Aug 19, 2017 Go to the documentation of dht 0.0.5 Download dht 0.0.5 archive
0.0.4 Aug 13, 2017 Go to the documentation of dht 0.0.4 Download dht 0.0.4 archive
0.0.3 Jul 13, 2017 Go to the documentation of dht 0.0.3 Download dht 0.0.3 archive
0.0.2 Jul 12, 2017 Go to the documentation of dht 0.0.2 Download dht 0.0.2 archive
0.0.1 Jul 7, 2017 Go to the documentation of dht 0.0.1 Download dht 0.0.1 archive


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1


Describes how popular the package is relative to other packages. [more]
0 / 100
Code health derived from static analysis. [more]
99 / 100
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]


Detected platforms: Flutter, other

Primary library: package:dht/dht.dart with components: io.


  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use dht.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.20.1 <2.0.0
Dev dependencies
test ^0.12.0