Page 1 of 1

Help - Choosing a Temperature Sensor

Posted: Sun Apr 10, 2016 8:01 pm
by Master_W
Pi 2 Model B (Raspbian Jessie)

I'm planning to make a Pi weather station that will make use of a temperature sensor. I was hoping to find a wireless sensor to avoid placing the whole Pi outside, but I haven't been able to find much, and the few ones I have found cost around $30 and up. It looks like I'll have to settle with a wired one. The DHT11 and DHT22 both look like they will work for my needs, but I'm not totally sure. My main concern is being able to somewhat easily read the data in a Python program.

If anyone knows if either of those sensors work well with the Pi, or know of a better sensor, please let me know.

Thanks!

Re: Help - Choosing a Temperature Sensor

Posted: Mon Apr 11, 2016 12:02 am
by jrbail01
The DHT22 is a good choice, especially when connected to a GrovePi+ hat as a Grove sensor (compact, no breadboarding or extra circuitry required). It has an easy-to-use Python library available and excellent accuracy. Having a combo temperature and humidity sensor is quite convenient. A tutorial that walks you through using a DHT22 + GrovePi+ is at https://github.com/InitialState/grovepi/wiki.

The DHT11 really sucks b/c it has a +/- 1 degree Celsius error. That is too much error that creates a really quantized looking output. If you really want to save $10, the tutorial above shows you how to use a DHT11 too (seriously, don't use this sensor).

The DS18B20 has great accuracy and even comes in a waterproof version. You can also read it with a simple Python script. The downside here is that you will need to throw a pull-up resistor on it, making a breadboard solution likely. It does not include humidity, another downside. A tutorial for hooking up a DS18B20 to a Pi is at https://github.com/InitialState/piot-10 ... ure-Sensor.

The temperature/humidity sensor on the sense HAT is pretty good too. It has a great Python library making it super easy-to-use. The biggest downside with the sense HAT is the fact that the Pi itself gives off enough heat to skew your temperature readings when the HAT is plugged in that close to the Pi's processor. You really need a GPIO extender to give your board some separation from the Pi (https://www.adafruit.com/products/1979). A tutorial of using the sense HAT is at https://github.com/InitialState/wunderg ... sehat/wiki.

Re: Help - Choosing a Temperature Sensor

Posted: Mon Apr 11, 2016 12:32 pm
by Master_W
jrbail01 wrote:The DHT22 is a good choice, especially when connected to a GrovePi+ hat as a Grove sensor (compact, no breadboarding or extra circuitry required). It has an easy-to-use Python library available and excellent accuracy. Having a combo temperature and humidity sensor is quite convenient. A tutorial that walks you through using a DHT22 + GrovePi+ is at https://github.com/InitialState/grovepi/wiki.

The DHT11 really sucks b/c it has a +/- 1 degree Celsius error. That is too much error that creates a really quantized looking output. If you really want to save $10, the tutorial above shows you how to use a DHT11 too (seriously, don't use this sensor).

The DS18B20 has great accuracy and even comes in a waterproof version. You can also read it with a simple Python script. The downside here is that you will need to throw a pull-up resistor on it, making a breadboard solution likely. It does not include humidity, another downside. A tutorial for hooking up a DS18B20 to a Pi is at https://github.com/InitialState/piot-10 ... ure-Sensor.

The temperature/humidity sensor on the sense HAT is pretty good too. It has a great Python library making it super easy-to-use. The biggest downside with the sense HAT is the fact that the Pi itself gives off enough heat to skew your temperature readings when the HAT is plugged in that close to the Pi's processor. You really need a GPIO extender to give your board some separation from the Pi (https://www.adafruit.com/products/1979). A tutorial of using the sense HAT is at https://github.com/InitialState/wunderg ... sehat/wiki.
The DHT22 it is then. The GrovePi looks really nice, but it seems like a waste to use it on a project with just the one sensor. The pigpio DHT22 library looks easy enough to use, so I think that's what I'll go with.

Thanks!

Re: Help - Choosing a Temperature Sensor

Posted: Mon Apr 11, 2016 10:07 pm
by Master_W
Before I order the DHT22, what's the difference between the standard one and the one that's mounted to a board like this? Does it need a resistor as well?

https://www.amazon.com/dp/B018JO5BRK/re ... dxb3KDZ6EC

Re: Help - Choosing a Temperature Sensor

Posted: Tue Apr 12, 2016 3:30 am
by jrbail01
Yes, you will need a pull-up resistor. You can see how to wire a non-grove DHT22 at https://learn.adafruit.com/dht-humidity ... g/overview. This is the advantage of the GrovePi board - no breadboarding, which makes for a really compact design.