Book Image

Internet of Things Projects with ESP32

By : Agus Kurniawan
Book Image

Internet of Things Projects with ESP32

By: Agus Kurniawan

Overview of this book

ESP32 is a low-cost MCU with integrated Wi-Fi and BLE. Various modules and development boards-based on ESP32 are available for building IoT applications easily. Wi-Fi and BLE are a common network stack in the Internet of Things application. These network modules can leverage your business and projects needs for cost-effective benefits. This book will serve as a fundamental guide for developing an ESP32 program. We will start with GPIO programming involving some sensor devices. Then we will study ESP32 development by building a number of IoT projects, such as weather stations, sensor loggers, smart homes, Wi-Fi cams and Wi-Fi wardriving. Lastly, we will enable ESP32 boards to execute interactions with mobile applications and cloud servers such as AWS. By the end of this book, you will be up and running with various IoT project-based ESP32 chip.
Table of Contents (12 chapters)

Building an IoT weather station

In this section, we will build an IoT weather station with an ESP32 board and a DHT22 module. We build a web server inside ESP32 and create a /weather HTTP request to serve temperature and humidity. The scenario for our project is as follows:

  • The user can access a weather station via a browser application request to http://<esp32_server>/weather.
  • The ESP32 program serves a /weather request.
  • The ESP32 program reads the temperature and humidity from the DHT22 module.
  • The ESP32 program sends a response by sending HTML with the temperature and humidity data.

You can see our simple architecture in the following figure:

Figure 6.2: Implementing the weather station with ESP32

We will test our weather system using a browser. We need an existing Wi-Fi network to enable the ESP32 board and serve weather information.

So, let's start.

...