In this video, I set up a Raspberry Pi humidity sensor that makes use of the DHT22. You can use the same setup for the DHT11and the AM2302 sensors.
Tutorial: https://pimylifeup.com/raspberry-pi-h...
Ultimate Books of Pi: https://pimylifeup.com/ultimate-book-...
In this tutorial, we make use of Raspbian, so if you want to run into the least amount of issues, then I recommend using it.
The DHT22 a digital sensor, so we don't need to worry about any complicated circuitry. It is a bit slow as it has a sampling rate of two seconds. It should still be perfect for most projects.
There are just three pins that you will need to connect to the Raspberry Pi. One of the pins on the sensor doesn't do anything and won't need to be connected.
To utilize the DHT22, we will use a simple Python script that makes use of the Adafruit DHT library. It's pretty simple but also a great introductory to Python.
We also show how you can permanently save the data into a CSV file. You can change this so that the data is stored into a SQL database instead.
I hope that this video has shown you all you need to know about setting up a humidity sensor with the Raspberry Pi. If you have feedback, then please leave a comment below or over at pimylifeup.