A perfSONAR User's Group

Temp/Humidity with Raspberry Pi


Found myself answering this question at the recent Internet2 Tech Exchange in Indianapolis —

Can you add temperature and/or humidity sensors to these small devices easily?

I have done this with Raspberry Pi more than once. I took old ribbon cables from floppy drives, shortened one connector with a hacksaw, and then cut the other one off, giving individual wires to play with.

Once you have a way to break out the pins —

(you may rather do something like: http://www.adafruit.com/products/914 )

the DS18B20 :

allows you to sense N > 1 temperatures per 3-wire connection on a bus,

and the DHT22:

gets you temp/humidity one-per-3wire-connection.

The attached graphs are from sensors at my house — the 5-line graph is a chain of DS18B20’s and the 3 line graph is temp and hum from a DHT11 (the cheaper version of the DHT22 I mention above), with calculated dewpoint. I would reach for the DHT22 if I did more sensors, given the aliasing noise you see on the graph.

Pins on the Raspberry Pi differ from model to model and can be really


Once you get the connections right, regular old Raspian, the default
Linux for Raspberry Pi, has a kernel module for Dallas 1-wire to read
the DS18B20’s and AdaFruit.com has source code for the DHTnn devices.

BeagleBone white/black also have the capacity to read pins, probably
duplicate each of the above, but I have RPi’s at home, and all my BB
belong to the UH, so I’ve done more interfacing with the personal stuff…

-Alan Whinery



Comments are currently closed.