Humidity and temperature are the common parameters to measure the environmental conditions of surroundings. This time we are going to build an Arduino based Weather Monitoring Device Using OLED Display where you can measure temperature and humidity in your surroundings. The value will show in the OLED display after sensing via a humidity sensor. DHT11 is used here as the purpose to sense the temperature and humidity level. The sensitivity of DHT11 is very good than others. This project is very cost-efficient and accurate working.
Must Read Temperature And Humidity Monitoring System Using ESP8266 NodeMCU
Principle Behind Weather Monitoring Device
Basically, the Arduino weather monitoring device has three parts. The first part senses the humidity and temperature of the surrounding by DHT11 sensor. The second part is the time or delay when the DHT11 sensor’s output is read by the Arduino. Also, the data get extracted into temperature and humidity values into percentage form. We can measure the value in the Celsius scale as well as on the Fahrenheit scale. At last, the third part, where the Arduino display humidity and temperature in the OLED display.
Project

Circuit Diagram

Components Required
- Arduino
- DHT11 Module
- 1KΩ Resistor
- OLED Display
- Breadboard
- Wires
- 9V Battery
About Parts
Arduino

For the compact build, I choose Arduino Nano despite Arduino UNO. Arduino Nano is a small, flexible microcontroller board using an Atmega328p chip. It can also use as a substitute for UNO. All the functions are the same in these two boards. The size of its PCB is 18×45 mm. The clock speed is 16Mhz. Its input voltage is 5-12V. There are 30 pins including power pins, data pins, analog pins, and serial pins on this board.
DHT11 Module

The DHT11 is a low-cost temperature and humidity sensor based on a capacitive humidity sensor and a thermistor. It can measure the surrounding air quality and take the data on the data pin. The use of this sensor is very easy but needs proper care when data is captured.
As we already explain, we use the DHT11 sensor because this module has a feature of humidity and temperature complex with a digital signal. This module also gives us a precise value. So we can ensure the reliability and stability of the values. This sensor uses a resistive type humidity measurement and NTC type temperature measurement. DHT11 has an inbuilt 8-bit microcontroller that gives a very fast response. There is also a 4-pin single-row package available in this module.
DHT11 module works with single-wire communication. Data is sent in a specific time period in the form of a pulse. Before sending data to the Arduino, it needs some commands and a time delay. The time required for it is approx 4ms. 40-bit data transmission is happen in this process. For example, 8-bit integral RH data + 8-bit decimal RH data + 8-bit integral T data + 8-bit decimal T data + 8-bit checksum.
OLED Display

The OLED is known as an organic light-emitting diode or Organic electroluminescent diode. This type of display is made of many layers. It is sealed on the top or bottom with plastic or glass. There are four pins in an OLED module. Those are GND, VCC, SDA, and SCL.
Circuit Connection
An OLED display is used here to show temperature and humidity which is connected to Arduino. Pin of OLED display SDA, and SCL is connected to pin A4, A5 respectively. This display works on 5V so we connect the 5V pin of Arduino with it. The DHT11 sensor is also connected to digital pin 12 of Arduino with a 5K pull-up resistor (exceptional).
Arduino Nano | DHT11 Module |
---|---|
+5V | VCC |
GND | GND |
D2 | OUT |
Arduino Nano | OLED Display |
---|---|
+5V | VCC |
GND | GND |
A4 | SDA |
A5 | SCL |
PCB Design
For removing messy wiring and giving a clean look, I designed a PCB prototype for this project. It is also helpful for troubleshooting that runs great without any errors. To design this PCB board, I used EasyEDA as it is too easy to use. For ordering PCB for this, I prefer PCBWay.
Gerber file for Arduino Weather Monitoring Device Gerber.
PCB View


Order PCB From PCBWay
PCBs are the neatest and most professional-looking among the assembled circuit types. Any electronic circuit that needs to be professional looking uses PCB boards. But soldering is still required on the copper area on the PCB. In the early 1900s, the only way to make circuits for electrical or electronic components was by wiring them point to point on a chassis. These chassis were either pan or sheet. These methods made circuits very fragile and large or bulky, and expensive.
There are so many forums or communities for electronics online in today’s technical world, and one of the famous ones for PCB manufacturing is PCBWay. PCBWay is a place that brings manufacturers and customers together. They have more than a decade of experience in this field of fabrication and prototyping and assembling of PCBs. PCBWay has proved its focus on its customers’ needs in terms of cost-effectiveness, delivery, and quality. And this can be proved by their outstanding customer reviews. This PCBWay provided a platform for students and electronic hobbyists to display their projects to the community and give sponsorships if their work is attractive. Check out the large pool of sponsored projects here.
How PCB Manufacturing Process Done in PCBWay
Standard quality for any product needs to be maintained using some parameters. PCBWay gives that opportunity through quality control in designing and manufacturing. At first, they ensure the accuracy, clarity, and validity of the PCB files that we sent to them.
Then all the boards will go through the most stringent tests other than the basic visual check. They adopt most of the testing and inspecting equipment used in the industry, such as Flying Probe Tester, X-Ray Inspection Machine, and Automated Optical Inspection (AOI) Machine. PCBWay are having 50+ new engineers on the daily basis around the world using PCBs for their work, who trust for their reliable quality. They produce high-quality pink, orange, grey, and even transparent solder mask. Moreover, according to people’s needs, they can also provide Black core PCB. Check it out for a High-Quality PCB solder mask. There are some pictures below of the new colours of solder musks.



Features of PCBWay
PCB Prototyping & Manufacturing: PCBWay produces FR-4 and Aluminum boards and advanced PCBs like Rogers, HDI, and Flexible and Rigid-Flex boards, at a very reasonable price. Just check this Instant Quote to order premium PCBs for your hobby projects. In this Christmas Sale, you can order PCB for just $5. Do check it out.
PCB Assembly: It not only offers PCB Prototyping but also offers PCB Assembly service. You can order a full PCB board with attached components by uploading your file. SMT & THT assembly starts from only 30$ including free stencil and worldwide shipping. The components can be sourced and provided by PCBWay, or by clients themselves.
Open Source Community: It not only offers PCB Prototype & Assembly service but also gives opportunities to students for sponsorships. I think this is so great. They feature their projects on the website also.
3D Printing & CNC: It also produces Rapid Prototyping like 3D printing, CNC Machining, Sheet Metal Fabrication, and Injection Molding. The quality of the product is too premium and reliable. And also the best part is that you will receive your order within a minimum of 3 days. In this Christmas Big Sale, you can save Up to 52% Off for 3D Printing & CNC Machining.
PCBWay Store: More boutique gift modules are waiting for you to discover, giving your creativity wings. You can order all types of electronic equipment, components and many more with exciting offers. Go with the link and buy your needs, PCBWay Store.
Services: PCBWay offers great servicing of its products. It takes only 3 to 15 days according to the courier service to deliver your products. Also, it has a live support facility. Whenever you have any problems, you can always reach a live customer service person to respond to your emails or messages. They have the “Return and Refund” principle, for every unusable board caused by PCBWay, they will rebuild and refund the order soon.
Guide for Ordering PCB From PCBWay
Working Principle of Weather Monitoring Device
There are three main components used in this project that are Arduino (for processing) and the DHT11 sensor module (for sensing temperature and humidity), and the last is OLED display (for showing the output result). This project is processed with serial communication.
First, Arduino sends a signal to the DHT11 module and DHT11 gives the response. The DHT11 already contains humidity and temperature data with it in analog form.
Then Arduino collects the data from the DHT11 module and extracts it into two parts. The first one is humidity and the second is temperature. After extracting, Arduino sends the digital value to the OLED display for showing the result.
After sending a high or low signal to the DHT11 sensor, Arduino ensured that module detection works. This process happens with an 18 μs delay. Then it pulls the data line and holds for 30μs until the module responds. Then DHT11 sends a low voltage as a response after 80μs. Now the microcontroller of DHT11 pulls up the data and waits for 80μs until DHT11 arrange to send data.
A low voltage level indicates that DHT11 is sending a response signal. The data sent by the module starts with a 50μs voltage level. The data bit is 0 or 1. The last important thing is the resistor value. If we place the DHT sensor at a less than 20-meter distance, a 5KΩ pull-up resistor should be needed. If you use more than 20 meters of distance the resistor value must be correct according to the distance.
Advantages of Weather Monitoring Device
- This project can be used in heating, cooling, ventilation and air conditioning system.
- It can also be used as medical equipment.
- In-home automation system this system is very useful.
Disadvantages of Weather Monitoring Device
- The uses of this weather monitoring device are limited.
- It may not work for big areas.
- There is no detection of sudden changes in the environment sometimes.
Arduino Code
1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | #include "DHT.h" #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define DHT11Pin 2 #define DHTType DHT11 DHT HT(DHT11Pin,DHTType); float humidity; float tempC; float tempF; #define SCREEN_WIDTH 128 // define OLED display width in pixels #define SCREEN_HEIGHT 64 // define OLED display height in pixels // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { // For DHT11 HT.begin(); // For OLED Display I2C if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64 Serial.println(F("SSD1306 Allocation Failed")); for(;;); } display.display(); // Display Logo delay(1000); display.clearDisplay(); } void loop() { delay(1000); humidity = HT.readHumidity(); // Read Humidity tempC = HT.readTemperature(); // Read Temperature in C tempF = HT.readTemperature(true); // Read Temperature in F display.clearDisplay(); oledDisplayHeader(); oledDisplay(3,5,28,humidity,"%"); oledDisplay(2,70,16,tempC,"C"); oledDisplay(2,70,44,tempF,"F"); display.display(); } void oledDisplayHeader() { display.setTextSize(1); display.setTextColor(WHITE); display.setCursor(0, 0); display.print("Humidity"); // Display Humidity display.setCursor(60, 0); display.print("Temperature"); // Display Temperature } void oledDisplay(int size, int x,int y, float value, String unit) { int charLen=12; int xo=x+charLen*3.2; int xunit=x+charLen*3.6; int xval = x; display.setTextSize(size); // Set Text Size display.setTextColor(WHITE); // Set Text Color if (unit=="%"){ display.setCursor(x, y); display.print(value,0); display.print(unit); } else { if (value>99){ xval=x; } else { xval=x+charLen; } display.setCursor(xval, y); display.print(value,0); display.drawCircle(xo, y+2, 2, WHITE); // Print Degree Symbol display.setCursor(xunit, y); display.print(unit); } } |
Frequently Asked Questions
DHT11 sensor has 4 pins VCC, GND, NC, and DATA. You can connect VCC with 5V of Arduino. Data pin with any of the 12 pins of the Arduino. There is no need to connect the NC pin. GND pin should be connected to the ground. And for the DHT11 module, this process is the same as what I said above.
The temperature measuring range of the DHT11 module is 0-50°C with +-2 degrees.
Because it is less costly and easy to use. Also, it provides humidity and temperature in both measurement systems in it.
It is a capacitive humidity sensor.
DHT22 is better than DHT11 because it has a greater range of measuring temperature. But it is quite expensive.
Firstly open Arduino IDE and go to sketch. Then click on include library and then manage the library. Now search for DHT. From there you can install the DHT library from Adafruit. After installation, you can search for Adafruit unified sensor and add it.
Yes. You just need to connect Arduino with LCD pins with the I2C module or manually.
No. You can use DS18B20.
A hygroscopic dielectric material is placed in between two electrodes forming a capacitor.
Is it accurate always?