Introduction: Connected Weather Station With ESP32

About: Ngo active in the field of digital mediation, based in Toulouse, France

In this tutorial you will learn how to set up a weather station based on ESP32, and how to monitor its readings remotely, via the Blynk app as well as via a website.


1x ESP32 board + usb power cable

1x DHT11 sensor

1x light sensor 1x 10 Kohm resistor

1x CJMCU CCS811 sensor

several jumper wires

a number of breadboards or a PCB (if you decide to do some soldering) female headers (if you decide to do the soldering)

Step 1: Setting Up the Weather Station

A timelapse of the assembling process is available here.

Wiring up the components

Connect the sensors as follows:

Light sensor

One end to 3V the other end to the 10kohm resistor which in turn is connected to GND. The same end of the LDR is also connected to pin D34 on the ESP32


3V →3V on the ESP32 board


SDA→D21 pin on ESP32

SCL→D22 pin on ESP32




VCC→3V on ESP32

OUT→D34 on ESP32

Step 2: Program the ESP32 Board

Launch Arduino IDE.

Select your ESP32 board from the Tools menu.

Make sure you’ve also selected the correct Port.

Upload this code on to the board.
If you open the serial monitor (set the baud rate to 9600), you should be able to view the values recorded by the different sensors

Step 3: Monitor the Weather Station Remotely Via Blynk App

Blynk app enables us to monitor the values recorded by the weather station remotely, directly on our smartphone, regardless our distance from the weather station.

All we need is the blynk app and an internet connection. In this project you’ll learn how to monitor the values recorded by the LDR sensor and the DHT11 sensor only.

Create a new project in the Blynk app

After you’ve download the app and you’ve successfully logged into your account, start by creating a new project.

Choose your hardware

Select the hardware model you will use. If you are following this tutorial you ll probably be using an ESP32 board.

Auth Token

Auth Token is a unique identifier which is needed to connect your hardware to your smartphone. Every new project you create will have its own Auth Token. You’ll get Auth Token automatically on your email after project creation. You can also copy it manually. Click on devices section and selected required device, And you’ll see the token

Set up the Blynk app

You will need to create a project on blynk which is tailored for the purpose of monitoring the parameters recorded by the weather station.
Grab 3 value display widgets.

Configure them one by one. The first will receive V6 as input, the second V5 and the third V0. You ll notice that they re all set to push mode.

Program the ESP32 board

Launch arduino IDE and open this program.
Select the board you re using from the Tools menu, as well as the correct Port. Upload the code. If upload is successful, you should be able to see a message from Blynk on the serial monitor.