How to make a Temperature and Humidity monitoring system using the ESP32 DEVKITV1 board

How to make a Temperature and Humidity monitoring system using the ESP32 DEVKITV1 board

Hello and welcome back! In this project, we will learn how to make a temperature and humidity monitoring system using the ESP32 DEVKITV1 board. This system will help you track environmental conditions easily. For that, I have used the DHT11 sensor. If you need more accurate readings, I recommend using the DHT22 sensor, as it provides better precision and a wider range of values.

To monitor this system from anywhere in the world, I used the Blynk cloud platform. This allows you to view your temperature and humidity data in real-time on your smartphone or computer. You can also see the temperature and humidity values on an LCD screen. I have designed a printed circuit board (PCB) for this project to make the assembly process simpler and more organized. If you want to print the PCB, you can use my Gerber file with JLCPCB, which offers affordable printing options and new user coupons.

I believe this monitoring system is perfect for your room, office, or any other space where you want to keep track of the climate. Additionally, you can power this system with a 5V power supply, making it easy to integrate into your existing setup.

OK let’s do this project step by step. The required components are given below.

Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.

Step 1

Firstly, identify these components.

Step 2

Secondly, let’s order PCBs for this project.

  • First, go to the JLCPCB official website and log in to your account.
  • Also, you can get the $125 OFF coupons, Bulk order discount, and the chance to win a $150 Amazon gift card with the JLCPCB Engineers Day — Click on me (September 5 to October 5, 2024)
  • I ordered 5 PCBs in Green. You can change it as you like. Then, select the build time and shipping. Finally, click the save to cart button.
  • Now, click the instant quote button and upload the Gerber file. You can download it using the link below.
  • Gerber file — Download

Step 3

Thirdly, when you receive your package, unbox and inspect your PCBs.

Step 4

Now, solder the components on the PCB.

Step 5

Next, connect the LCD screen and ESP32 board to the PCB.

Step 6

Now, let’s set up the Blynk cloud. For that, follow the steps below.

  • First, go to the Blynk website and log into your account. If you don’t have an account, please sign up using your email.
  • Then create a new template. You can name it as you like. For that select Hardware as ESP32 and Connection Type as WIFI.
  • Next, click the Detastrems tab and create two virtual pins.
  • Virtual Pin > Name — Temperature / PIN — V0 / MIN — 0 / MAX — 100
  • Virtual Pin > Name — Humidity / PIN — V1 / MIN — 0 / MAX — 100
  • Now, click the dashboard tab and add two gauge widgets to the dashboard. You can customize them as you like.
  • Then, click the gear wheel icons in the widgets and select the data streams we created above. Now click the save button.
  • Afterward, click the Devices tab and select the template we created above. Now you can see the Blynk auth token in the project.

Step 7

Now, connect the ESP32 board to the computer. Then, copy and paste the following program to the Arduino IDE.

//Include the library files
#include <LiquidCrystal.h>
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <DHT.h>

#define sensor 22

LiquidCrystal lcd(2, 4, 5, 18, 19, 21);
BlynkTimer timer;
DHT dht(sensor, DHT11);

// Enter your Auth token
char auth[] = "******************";

//Enter your WIFI SSID and password
char ssid[] = "**************";
char pass[] = "*************";

void setup() {
  Serial.begin(115200);
  lcd.begin(16, 2);
  dht.begin();
  Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);

  lcd.setCursor(1, 0);
  lcd.print("System Loading");
  for (int a = 0; a <= 15; a++) {
    lcd.setCursor(a, 1);
    lcd.print(".");
    delay(200);
  }
  lcd.clear();

}

//Get the DHT11 sensor values
void DHT11sensor() {
  float h = dht.readHumidity();
  float t = dht.readTemperature();

  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
  Blynk.virtualWrite(V0, t);
  Blynk.virtualWrite(V1, h);

  lcd.setCursor(0, 0);
  lcd.print("Temp:");
  lcd.print(t);

  lcd.setCursor(0, 1);
  lcd.print("Humi:");
  lcd.print(h);

}

void loop() {
  DHT11sensor();
  Blynk.run();//Run the Blynk library

}
  • Next, download and install the library files above. Then copy and paste the Blynk auth token. You can find it on the Blynk web dashboard.
  • Afterward, enter your WIFI SSID and password.
  • Then, select the board and port After, click the upload button.

Step 8

Now let’s set up the Blynk mobile app. For that, follow the steps below.

  • First download and install the Blynk app from the App Store or Play Store. Then log into your account.
  • Now you can see your project template on the Home Screen. Then, click on this template and click the configure button. After, click the + icon and add two gauge widgets and two label value widgets to the dashboard.
  • Afterward, click the one-by-one widget and select the datastreams we created on the web dashboard. Finally, customize these widgets as you like.

Step 9

Finally, remove the USB cable and provide a 5v power supply to this system.

Now, you can test this project as you like. I have used the soldering iron and hot air gun. Then you can see the values on the Blynk mobile dashboard, Blynk web dashboards, and the LCD. If not display the values on the LCD, please adjust the contract level using the preset.

How to make a Temperature and Humidity monitoring system using the ESP32 DEVKITV1 board

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *