In this lesson I will show you how to display temperature and humidity readings from a DHT11 or DHT22 sensor in an SSD1306 OLED display using an ESP32 with C++ in Arduino IDE, we can also use Thonny IDE and write MicroPython code.
Important Libraries To Install:
Adafruit_SSD1306
Adafruit_GFX
DHT
The DHT11 and DHT22 are very similar, but differ in their specifications. The following table compares some of the most important specifications of the DHT11 and DHT22 temperature and humidity sensors. These sensors contain a chip that does analog to digital conversion and spit out a digital signal with the temperature and humidity. This makes them very easy to use with any microcontroller.
The DHT22 sensor has a better resolution and a wider temperature and humidity measurement range. However, it is a bit more expensive, and you can only request readings with 2 seconds interval. the DHT11 has a smaller range and it’s less accurate. However, you can request sensor readings every second. It’s also a bit cheaper.
Despite their differences, they work in a similar way, and you can use the same code to read temperature and humidity. You just need to select in the code the sensor type you’re using.
Project Source Codes : https://github.com/AnbuKumar-maker
Contact us for more projects: [email protected]
WhatsApp Support: +91-99725-77735
About us: https://www.codingscientist.com
Hackster Community: https://www.hackster.io/anbu-kumar
LinkedIn: / codingscientist
Facebook: / coding.scientist
Twitter: / robo_thoughts