Display Temperature and Humidity (Part 1)

Posted by AlexChu, 12/07/2018

It’s nice how our phones phones can show us the temperature currently outside, but sadly it cannot show us the temperature or humidity of the room we are presently in. Here I am going to demonstrate how you can display the temperature and humidity.


Hardware:

 

Software:

 


Step 1: Hardware

With my help, this part should be as easy as pie.

You will be required to connect a Qwiic connector from the ESP32 to the oled display and Qwiic connector from the display to male connectors to the SHT20

All Qwiic cables follow this color scheme and pin arrangement:
Black = GND
Red = 3.3V
Blue = SDA
Yellow = SCL

 

Step 2: Software


Here you can change the text size and text you want to put on the display.

display.setTextSize(0.75);
display.setTextColor(WHITE);
display.setCursor(10,0);
display.clearDisplay();
display.print(" Temperature:");
display.print(temp);
display.print("C");
display.print(" Humidity:");
display.print(humd);
display.print("%");

 

Now lets upload the code.

You can watch how the humidity or temperature changes quickly as you blow air onto the sensor.


In the next tutorial, we will show you how to turn this temperature sensor to an IOT device!

 

Leave a Comment