Home > News & Updates > Electronics News Updates > Quick Arduino Hygrometer with OLED display

Quick Arduino Hygrometer with OLED display

Summary of Quick Arduino Hygrometer with OLED display


This article describes building a DIY hygrometer to monitor room humidity levels, aiming for 40-50% RH to combat condensation and mould in a well-insulated apartment. The project utilizes an Arduino Leonardo Pro Micro clone, an Adafruit SSD1306 OLED display, and a DHT11 sensor connected via I2C protocol. The code reads sensor data and displays temperature and humidity or errors on the screen.

Parts used in DIY Hygrometer:

  • Arduino Leonardo Pro Micro (clone)
  • Adafruit SSD1306 0.96" OLED Display
  • DHT11 Digital Temperature and Humidity Sensor
  • USB cable and mobile phone charger

We have been having some condensation and mould issues in our apartment recently due to, I think, the humidity levels. Our property is relatively newly built and, as such, has very good insulation properties (double glazed windows etc.). The side effect of this is that there is very little ventilation and therefore humidity rises over a period of time and water then condensates on windows causing puddles on the sills and mould in dark, cool corners.

Our solution to this problem was to buy a dehumidifier (pictured), however I would still like to know what the relative humidity in the room is (the target is between 40%RH and 50%RH) and thus the need for a hygrometer. I could of course have bought one, but having an Arduino and OLED display to hand I thought I would make one (obviously!).

Step 1: Design & Assembly

The design is dead simple. As I said, I had an Arduino and an OLED display to hand so all I needed was a humidity sensor which I picked up on eBay for ~£3. The full parts list is as follows:

  • Arduino Leonardo Pro Micro (clone)
  • Adafruit SSD1306 0.96″ OLED Display
  • DHT11 Digital Temperature and Humidity Sensor
  • USB cable and mobile phone charger or similar to power it all

The schematic shows how the various components were connected together and the picture show how they were arranged on a breadboard.

Step 2: Software

The code was created using the Arduino IDE and is attached. I created my own class for communicating with DHT11 sensor (which has it own particular protocol) and used the Adafruit and Wire libraries to communicate with the display which uses the I2C protocol.

The design is very simple indeed. The setup() function quite literally sets up the display. The loop() function then reads the temperature and humidity values from the sensor and prints them on the display via the displayData() function. If an error occurs when reading data from the sensor then it is displayed via the displayError() function.

Read more: Quick Arduino Hygrometer with OLED display

Quick Solutions to Questions related to DIY Hygrometer:

  • Why was this hygrometer built?
    To monitor relative humidity levels between 40%RH and 50%RH to prevent condensation and mould.
  • What caused the humidity issues in the apartment?
    New insulation properties like double glazed windows resulted in very little ventilation.
  • Which sensor is used for measuring humidity?
    A DHT11 Digital Temperature and Humidity Sensor picked up on eBay.
  • How is the OLED display powered and connected?
    The system uses the Adafruit SSD1306 library communicating via the I2C protocol.
  • What happens if the sensor reading fails?
    An error message is displayed on the screen via the displayError function.
  • What software environment was used for coding?
    The Arduino IDE was used to create the custom class and utilize necessary libraries.
  • Is a separate hygrometer purchase required?
    No, the user built one using existing Arduino and OLED display components.
  • What is the target humidity range mentioned?
    The target relative humidity is between 40%RH and 50%RH.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top