Temperature & Humidity Sensor
Hey there 👋🏼👋🏼👋🏼, been a while!!! Welcome to another awesome tutorial from InvenTech. Today we’d be designing 👩🔧 👨🔧 a temperature and humidity sensing device with an LCD to give you that awesome experience, it’s pretty easy and straight forward let’s get into it🙂.
- DHTxx sensor
- LCD 16x2 display with I2C serial adapter
- 10k resistor
- Jumper wires
- Bread board
You can get most of your electronic components from: Amazon, hub360, ebay, or Aliexpress. Get an InventOne board 💳.
Wondering what an inventone board is 🤔? Check out this article 🧐.
The DHTxx sensor is a temperature and humidity sensor which could be interfaced with any micro-controller to get the temperature & humidity of a particular environment. The schematic below gives a complete wiring of the DHT22 sensor and the inventone board. For more info about the DHTxx check out 🔎 this article by Adafruit or the datasheet provided by Aosong industries.
We’d be using a 16x2 LCD display which has an I2C serial interface. This reduces the stress of connecting about 14 pins directly from the LCD to the inventone dev board – as you already know the job of every engineer is to make life easy 😀😀😀. A larger LCD display will work fine, just make sure you adjust the code provided to suit your LCD display.
The 10k resistor is a pull up resistor which ensures proper communication from the DHT22 sensor to the inventone board, its not necessary but its good engineering practice ✔️.
So we’d be programming the inventone board with the Arduino IDE – if you haven’t used the IDE with the inventone board before please visit this tutorial. Also, we’d be using open source libraries which can be downloaded for free from these github repositories: adafruit, LiquidCrystal_I2C. If you don’t know how to include a new library to your IDE just search it on google and am sure you’d get a chunk of videos teaching you how to add a new library to your Arduino IDE.
Upon downloading you could run the simple test codes with each component i.e the DHT22 and LCD separately to ascertain the functionality of the boards, its not compulsory but it reduces the stress of debugging later on.
If you’ve successfully carried out the above step 👍👍👍, there is virtually nothing you can't do with the sensor (related to temperature & humidity reading of course).
Based on the libraries we used for this tutorial we encountered some problems with the pin mappings so the SDA and SCL pins are D2 and D4 respectively. Hopefully our engineers at InvenTech would fix this problem soon. Asides that everything else works just fine 👍 👍.
You can uncomment the last few lines of the code if you want to view other values like heat index or temperature in Fahrenheit. Weldone ✔️✔️✔️ you are now officially an hardware engineer 👩🚒 👨🚒.