Spark app to read a DHT11 sensor and publish humidity and temperature as Spark variables
C++ Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
dht11.cpp
hardware.jpg
xively.py

README.md

spark-dht11

Spark app to read a DHT11 sensor and publish humidity and temperature as Spark variables.

I got the Spark Core device from the Kickstarter project and this is my first project.

The circuit is a DHT11 connected to 3v3, GND and a data pin. I use the internal pullup on the data pin:

Photo of Spark Core with DHT11

I noticed a lot of people had issues with the DHT sensors and I could not get the Adafruit library working myself. The Adafruit code is pretty iffy, requires higher timing resolution than necessary and doesn't support the internal pullup resistor. So I wrote my own simple version that uses the internal pullup resistor. It reads the relative humidity and temperature from a DHT11 sensor every 10 seconds and stores them in the Spark variables rh and temp respectively.

There's also a Python script that reads the values every minute and uploads them to Xively.