Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Internet of Things Projects with ESP32
Internet of Things Projects with ESP32

Internet of Things Projects with ESP32: Build exciting and powerful IoT projects using the all-new Espressif ESP32

eBook
€13.98 €19.99
Paperback
€24.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Internet of Things Projects with ESP32

Making Visual Data and Animation on an LCD

The ESP32 chip and module consists of general-purpose input/output (GPIO) pins to enable sensing and actuating. In this chapter, we will learn how to read sensor data from the ESP32 GPIO. We will also talk about using an LCD to display data with the ESP32 chip. In addition to this, we will show sensory information such as temperature and humidity in the LCD. Ultimately, we will build a simple IoT weather monitoring system with the ESP32 board.

We will see how to work with an LCD by following step-by-step instructions. You will also learn how to use the ESP32 board to detect the weather and display it on LCD by the end of this chapter.

The following topics will be covered in this chapter:

  • Introduction to ESP32 GPIO
  • Introduction to IoT for weather monitoring systems
  • Reading temperature and humidity from a sensor device
  • Displaying information...

Technical requirements

Before we begin, make sure that you have the following things ready:

  • A computer with an OS, such as Windows, Linux, or Mac, installed.
  • An ESP32 development board. The ESP-WROVER-KIT board from Espressif is recommended.
  • An ESP32 development environment configured on your computer.

  • An DHT22 sensor module.
  • The CoolTerm tool, which can read and write data over serial communication (UART). This is available for Windows, Linux, and Mac. We set our serial tool to the ESP32 board with Baudrate 115200.

Introduction to ESP32 GPIO

The ESP32 chip features forty physical GPIO pads. Some GPIO pads cannot be used or do not have the corresponding pin on the chip package. For development boards based on the ESP32 chip or module, some board makers probably expose all ESP32 GPIO pins. However, some board makers also expose ESP32 GPIO pins but add additional pins such as battery, voltage, exclusive sensor, and ground.

Since there are many ESP32 development board models, we cannot explore all board models. Instead, we will focus on the ESP-WROVER-KIT board from Espressif.

We can access GPIO pins on the ESP-WROVER-KIT board with three locations. You can see these locations from the ESP-WROVER-KIT board in the following image. Some GPIO labels are shown in the board body so that we can see all of the GPIO pins:

Figure 2-1: GPIO pins from an ESP-WROVER-KIT board

Some GPIO pins are used for...

Introduction to IoT for weather monitoring systems

A weather monitoring system senses the state of the atmosphere, such as its temperature, humidity, and weather conditions (clear, stormy, and so on). To get the state of the atmosphere, we need sensors.

We can design a simple model for an IoT weather monitoring system as shown next in Figure 2-2. An IoT board with sensor devices can sense physical conditions such as temperature and humidity. Some IoT weather monitoring systems can display their sensor values on a monitor or LCD display:

Figure 2-2: A simple model for an IoT weather Monitoring System

Now that we've discussed the weather monitoring system and its basic architecture, let's start building our weather monitoring system. In the next section, we'll learn how to read temperature and humidity using a sensor device and an ESP32 board.

...

Reading temperature and humidity from a sensor device

In this section, we'll build a simple program to read temperature and humidity from sensor devices. We'll use the DHT22 sensor module for this. This sensor device is easy to find on online stores such as Adafruit, SparkFun, and AliExpress.

Our project scenario is to read temperature and humidity values from a sensor device. Then, we will print sensor values on a serial Terminal. After doing this, we will implement our hardware wiring and develop a program.

Wiring

Let's begin by exploring the DHT22 sensor module. This module can sense temperature and humidity. In general, the DHT22 has four pins. You can see the sensor pinout in Figure 2-3:

Figure 2-3: A...

Displaying information using an LCD

Hardware wiring

If you have the ESP-WROVER-KIT board, you don't need an additional LCD to perform hardware wiring. Otherwise, if you use another LCD module, you can connect the LCD module to the ESP32 board via ESP32 SPI pins...

Making a weather monitoring system

In this section, we'll build a simple weather monitoring system. We'll use the skills that we've learned about, such as reading temperature and humidity from a DHT22 sensor device. Ultimately we'll be able to display the temperature and humidity on the LCD after reading from the sensor device.

Let's begin by creating a project.

Creating a project

To simplify our weather monitoring system project, we will copy the previous project named lcddemo and create a project called weather. Our main program is weather.c on the main folder. You can see a project structure shown in figure 2-16:

Figure 2-16: Project structure for the weather system

Now, let's move on to hardware...

Summary

In this chapter, we looked at a brief introduction that weather systems. Here, we made a simple ESP32 program to sense temperature and humidity using the DHT22 sensor module. Furthermore, we worked with the LCD on the ESP32 board, and were able to access the LCD modules through the ESP32 board. Lastly, we also displayed temperature and humidity data from a sensor to the LCD display. You can now compile and flash any program to your ESP32 board.

In the next chapter, we will learn how to build a simple game on an ESP32 board. We will also cover gaming-embedded systems.

Further reading

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Getting to know the all new powerful EPS32 boards and build interesting Internet of Things projects
  • Configure your ESP32 to the cloud technologies and explore the networkable modules that will be utilised in your IoT projects
  • A step-by-step guide that teaches you the basic to advanced IoT concepts with ESP32

Description

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.

Who is this book for?

This book is for those who want to build a powerful and inexpensive IoT projects using the ESP32.Also for those who are new to IoT, or those who already have experience with other platforms such as Arduino, ESP8266, and Raspberry Pi.

What you will learn

  • Understand how to build a sensor monitoring logger
  • Create a weather station to sense temperature and humidity using ESP32
  • Build your own W-iFi wardriving with ESP32. Use BLE to make interactions between ESP32 and Android
  • Understand how to create connections to interact between ESP32 and mobile applications
  • Learn how to interact between ESP32 boards and cloud servers
  • Build an IoT Application-based ESP32 board

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 30, 2019
Length: 252 pages
Edition : 1st
Language : English
ISBN-13 : 9781789956870
Category :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Mar 30, 2019
Length: 252 pages
Edition : 1st
Language : English
ISBN-13 : 9781789956870
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 110.97
Hands-On Internet of Things with MQTT
€32.99
Internet of Things Projects with ESP32
€24.99
Developing IoT Projects with ESP32
€52.99
Total 110.97 Stars icon

Table of Contents

11 Chapters
Getting Started with ESP32 Chevron down icon Chevron up icon
Making Visual Data and Animation on an LCD Chevron down icon Chevron up icon
Building a Simple Game with an Embedded ESP32 Board Chevron down icon Chevron up icon
Building a Sensor Monitoring Logger Chevron down icon Chevron up icon
Controlling IoT Devices over the Internet Chevron down icon Chevron up icon
Building an IoT Weather Station Chevron down icon Chevron up icon
Making Your Own Wi-Fi Wardriving Chevron down icon Chevron up icon
Building Your Own Wi-Fi Cam Chevron down icon Chevron up icon
Making IoT Devices Interact with Mobile Applications Chevron down icon Chevron up icon
Building IoT Monitoring with Cloud Technology Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Most Recent
Rating distribution
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
(8 Ratings)
5 star 12.5%
4 star 0%
3 star 12.5%
2 star 25%
1 star 50%
Filter icon Filter
Most Recent

Filter reviews by




Gema Mar 24, 2021
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
Compro el libro nuevo y me mandan uno subrayado y requeteusado.Devolución inmediata.En cuanto al contenido.... Un poco mediocre.
Amazon Verified review Amazon
Theresa Albright Jan 12, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I scanned through the book and was impressed how it walked through going from simple sensor reading to HTTP, CLOUD, and Android control of Smart Home automation.
Amazon Verified review Amazon
john Babrick Jun 05, 2020
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
I scanned through the book and was unimpressed. Many times the author merely lists a website as a place to go for instructions. The processor and how to program it really aren't taught, rather the examples simply include huge libraries and make trivial calls on those libraries. Just not worth the money I spent on it. Pffht!
Amazon Verified review Amazon
Dave Waller Feb 23, 2020
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
I had great hopes for this book, at last a book that would show you how to use the ESP32 without relying on the Arduino software.Unfortunately the book has a huge number of issues, some of which are as follows:1. The book is out of date and recommends you download an older version of the software - the ESP32-IDF and tool chain. (I accept there is not much that can be done about this, but I did get the book when it was released and it was out of date straight away2. The graphics / pictures are out of step with the titles and cross references3. Some cross references are missing (eg the page says "See the following for further details" but does not actually have anything following4. The example code is very poorly written. The samples provided in the ESP32-IDF are far better and well commented.5. There is missing code from some of the examples so that they will never compile6. There is very little explanation of the code samples or what the functions called actually do.Overall this book seems to have been a hasty rewrite of the many other books on Arduino devices, ie light one LED, then light several LEDs but does not give you any real feel of what can be done, or what are the advantages of programming using FreeRTOS and ESP32-IDF.
Amazon Verified review Amazon
Tobias Grussenmeyer Jan 02, 2020
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
The projects in the book are easy to follow, but you don’t learn why things are done that way. I was really dissatisfied by the lack of explanations and background info.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.