Reading sensor data from a DHT11

Reading data from an DHT11 using an arduino is fairly simple. Library used: https://github.com/adafruit/DHT-sensor-library

Preliminaries

  • using arduino-mk

  • Arduino Linux 64bit package Version 1.0.5

  • (more see previous blogposts in arduino category)

Steps

  • Clone library in libs folder

  • Create Makefile

BOARD_TAG    = uno
ARDUINO_LIBS = DHT-sensor-library
USER_LIB_PATH = ../libs/

include /usr/share/arduino/Arduino.mk
  • try example code:

https://github.com/adafruit/DHT-sensor-library/blob/master/examples/DHTtester/DHTtester.pde

My DHT11 has a different pin layout: - + S. The rest of the example code works without modifications.