Wondering what's the weather? Let's check it out with your Raspberry Pi! This tutorial provides step by step instructions how to detect temperature and humidity with the dirt cheap I2C sensor HTU21D and open source code on your Raspberry Pi.
If the embedded video does not appear on your mobile device, here is an alternative link. If you like this tutorial, please subscribe to my YouTube channel, give a star to the project in GitHub and have a look at my Instructables and videos.
For this tutorial you need the following hardware components:
HTU21 (or SHT21) modules are popular for hobby electronics. In general they are available for less than 5 USD per unit.
I have a couple modules here. They have different colors but the sensor is actually absolutely the same on both modules. Beware that the other physical difference is the position of the lines for data and clock. I am going to use the blue HTU21D module for the rest of the tutorial.
I have published free and open source example for reading temperature and humidity on Raspberry Pi using HTU21D. They are available in GitHub. Perform the following steps to use it:
git clone https://github.com/leon-anavi/rpi-examples.git
cd rpi-examples cd HTU21D/c make
sudo ./HTU21D_test