Git Product home page Git Product logo

dht11's Introduction

Description

This is a small tool that takes humidity and temperature measurements using a DHT11 sensor on a Raspberry Pi.

The code has been adapted from this blog post.

By default it outputs humidity (in %) and temperature (in degrees Celsius). Here's an example:

$ sudo ./dht11 
36,24

which means that the humididy is 36 % and the temperature is 24 degrees Celsius.

As shown above, you'll need to run it as the root user, or using sudo.

There are options to output the date and time before the measurements and to use the Farenheit scale instead of Celsius. Run:

dht11 -h

to see all options.

Wiring

Holding the DHT11 sensor towards you (the side with the grid), you should connect the left-most pin to 3V3 (GPIO pin 1 on the Raspberry Pi). The second pin from the left is the data pin. That should be connected to GPIO pin 7 on the Raspberry Pi. Leave the third pin unconnected. The right-most pin should be connected to a GND pin on the Raspberry Pi.

To prevent random data connect a 10K resistor between the data pin (the second from the left) and 3V3.

Installation

You will need to have wiringpi installed, so first run:

sudo apt-get install wiringpi

After that run:

make

and a dht11 executable should be created in the same directory.

dht11's People

Contributors

gapan avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.