In this tutorial I’ll be connecting ESP32 development board with integrated OLED screen and high-quality Humidicon HIH8121 sensor. I chose  Wemos ESP32 OLED MCU because integrated OLED screen is a great way to show temperature and humidity not only on Serial monitor to make you sure that data are successfully taken from HIH8121, but that you can place it anywhere you want and measure indoor/outdoor temperature and humidity. Power it up with the mobile phone charger or with portable battery and you have your own mini weather station! HIH8121 sensor is not a cheap one (around 9$ only sensor) but it is excellent since it has a filter that resists condensation (and thus faulty measurements) with recovery time if being exposed to water, which is not the case with so popular DHT11 sensor.

Wemos ESP32 OLED Specifications:

  • High performance

  • Integrated antenna and RF Balun

  • Power amplifier

  • Low Noise Amplifiers

  • Power Management Module

  • 2.4 GHz dual WiFi and Bluetooth chips

  • Easily embedded in other products

Humidicon HIH8121 Specifications:

  • One sensor does the work of two!

  • ±2.0 %RH accuracy (humidity performance)

  •  ±0.5 °C accuracy (temperature performance)

  •  -40 °C to 125 °C [-40

  • Low power consumption (650 µA active / 1 µA sleep mode)

  • Low supply voltage (minimum 2.3 V DC)

Effort Estimate: 

Complexity: Easy

Time Required: 45 - 60 min

* Intermediate tutorials require basic understanding of programming & familiarity with command line interface. 

What you will need:

  • Wemos Lolin ESP32 - Development board

  • Honeywell Humidicon HIH8121 - Temperature & Humidity sensor

  • Soldering Iron - To solder lead wires from HIH sensor 

  • Wires - To connect HIH sensor to breadboard if not ordered breakout board

  • Breakout board - To connect ESP32 with HIH8121 sensor


Connecting the Hardware

  • Solder thin wires to each pin of the HIH8121 sensor. Be cautious as it’s pins are thin and sensitive. It would be great if you can also protect each soldered pin to avoid one touching another (Better option is to use complete breakout board, but that doubles the cost of the sensor, so decide for yourself).

  • Connect the pins in the following order:

Software setup

If you are not familiar with Arduino IDE, follow this Article to set up the environment. When you have operative IDE on your machine, follow the next steps.

Wemos ESP32 OLED and Arduino IDE

Now you will have to add libraries to use ESP32 and uploading the code. This article will be of great help to set up the ESP32. When you have it within your IDE, we may continue with the code. 

HIH8121 sensor and Arduino IDE

This sensor will work perfectly with its predecessor, HIH61xx library, as they are quite similar.  To download the library for the sensor, please download the latest version from here.

Programming your ESP32 using Arduino IDE

  1. Make sure that you have installed libraries for ESP32 and HIH8121

  2. Choose the active board in Tools > Board > Lolin D32 Pro. Set up the upload speed to 115200 as it’s better for the board.

  3. Download the code from here and paste it to the opened IDE

  4. Upload the code (Note: when you press Upload button, hold down the BOOT button on the back side of the Wemos ESP32 board - this enables board to receive the code successfully).

  5. After you get the message Done uploading on the bottom of the code editor in Arduino IDE, restart the ESP32 with pressing the button EN also on the back side of the board.

  6. That’s it! Now you have your own mini Weather station to bring anywhere :) 

Selecting the Wemos ESP32 board

Finished project with Weather station

  1. Install the Arduino Software (IDE) on Windows PCs

  2. ESP32 With Integrated OLED (WEMOS/Lolin) - Getting Started Arduino Style

  3. Honeywell Humidicon HIH61xx Library

  4. Working Arduino Code

Get the Hardware:

  1. Wemos Lolin ESP32 with integrated OLED screen

  2. Honeywell Humidicon HIH8121 temperature & humidity sensor

Next Steps

This tutorial covers hardware which you may buy online from HW distributers, but we will soon publish the newer version of this using latest Arduino Nano 33 IoT development board and Grove sensor from OKdo Shop. Stay in tune! 😉


#include <HIH61xx.h>

#include "SSD1306Wire.h"

SSD1306Wire  display(0x3c,5,4); // 5=SDA | 4=SCL

HIH61xx<TwoWire> hih(Wire);

AsyncDelay samplingInterval;

void setup() {




  samplingInterval.start(3000, AsyncDelay::MILLIS);


  display.init();  // Display inizialization


  display.setFont(ArialMT_Plain_10); //sizes of the font: 10, 16, 20


bool printed = true;

void loop() {

  if (samplingInterval.isExpired() && !hih.isSampling()) {


     printed = false;


     Serial.println("Sampling started (using Wire library)");



  if (hih.isFinished() && !printed) {

    printed = true;  // Print saved values

    display.clear(); // clear the display



    display.drawString(10, 0, "WEATHER STATION");


    display.drawString(0, 20, "Temperature [°C]: " +   String(hih.getAmbientTemp()/100.0));   // showing on display


    display.drawString(0, 40, "Rel. Humidity [%]: " + String(hih.getRelHumidity()/100.0));   // showing on display


    display.display(); // display all data on the screen


    Serial.print("RH: ");

    Serial.print(hih.getRelHumidity()/100.0); //printing humidity

    Serial.println(" %");

    Serial.print("Ambient: ");

    Serial.print(hih.getAmbientTemp()/100.0); //printing temperature

    Serial.println(" deg C");

    Serial.print("Status: ");





Did this answer your question?