Reader small image

You're reading from  Hands-on ESP32 with Arduino IDE

Product typeBook
Published inJan 2024
PublisherPackt
ISBN-139781837638031
Edition1st Edition
Right arrow
Author (1)
Asim Zulfiqar
Asim Zulfiqar
author image
Asim Zulfiqar

Asim Zulfiqar is a blogger and tech content creator who has been writing tutorials on embedded systems and IoT on his blog and YouTube channel, High Voltages. Currently, he is working as a scientific programmer for IoT research projects. He completed his bachelor's degree in electronic engineering at Sir Syed University of Engineering and Technology, Pakistan. After that, he completed his Erasmus Mundus joint master's degree program in Photonics Integrated Circuits, Sensors, and Networks at Scuola Superiore Sant'Anna (Italy), Aston University (U.K), and Osaka University (Japan).
Read more about Asim Zulfiqar

Right arrow

Preface

The ESP32 is a great microcontroller for learning and creating Internet of Things (IoT) applications. It’s especially good for beginners in the IoT world. Setting up and connecting sensors to the ESP32 can be complicated, but the Arduino IDE makes it easier to write code, upload it to the ESP32, and use its features. This book is designed to help you understand the basics of using sensors, connecting to networks, processing data, and creating applications with the ESP32, giving you a solid foundation for IoT development.

Starting with the basics of the ESP32 and the Arduino IDE 2.0, you’ll learn how to connect sensors to the ESP32 through practical examples. Then, the book shows you how to use the ESP32 camera and display modules with examples. It also explains IoT networks and data protocols, providing you with different options for various IoT applications. Toward the end of the book, you’ll use your knowledge to work on exciting projects, from smart connected devices to data loggers and automation, experiencing real-world applications.

By the end of the book, you’ll be able to confidently work on ESP32 projects, choose the right IoT protocol for your application, and successfully create and deploy your own IoT projects.

Who this book is for

This book is for people who like electronics and IoT, whether you’re just a fan, enjoy it as a hobby, or work in the field. It’s written to help you really understand ESP32 and IoT protocols by giving you practical examples. You should know a bit about electronics and have some experience with programming, but it’s designed to be easy for beginners. So, if you’re interested in learning about ESP32 and IoT, this book is a good choice for you.

What this book covers

Chapter 1, IoT with ESP32 using Arduino IDE, begins with an introduction to IoT, outlining its characteristics and various applications. Following that, the ESP32 is introduced, and its capabilities are explored in detail. The chapter concludes by explaining and utilizing the Arduino IDE for a “Hello World” example.

Chapter 2, Connecting Sensors and Actuators with ESP32, provides an overview of the ESP32’s General Purpose Input/Output (GPIO) and peripherals. The chapter also explores communication protocols used to connect different sensors, including examples of UART, I2C, and SPI.

Chapter 3, Interfacing Cameras and Displays with ESP32, offers both theoretical insights and practical guidance on utilizing the ESP32-CAM board, along with various display modules in conjunction with the ESP32.

Chapter 4, Implementing Network-Based Protocols with ESP32, provides an overview of network-based protocols such as Wi-Fi, Bluetooth Low Energy (BLE), Cellular (5G and NB-IoT), and LoRaWAN. The chapter also explores the distinctions between these protocols, offering insights to help you select the most suitable network protocol for your upcoming projects.

Chapter 5, Choosing the Right Data-Based Protocols for Your ESP32 Project, explores various data-based protocols such as HTTP, MQTT, and webhooks. The chapter outlines the differences between these protocols, aiding you in selecting the most appropriate data-based protocol for your ESP32 projects.

Chapter 6, Project 1 – Smart Plant Monitoring System Using ESP32, Messaging Services, and the Twitter API, offers a step-by-step guide to reading environmental parameters such as temperature, humidity, and soil moisture using ESP32. Additionally, the chapter covers how to share these status updates on Twitter, Email, WhatsApp, and Telegram using ESP32.

Chapter 7, Project 2 – Rent Out Your Parking Space, provides a step-by-step guide to creating a prototype system. This system enables you to accept payments via PayPal to rent out your parking space.

Chapter 8, Project 3 – Logging, Monitoring, and Controlling Using ESP32, outlines a step-by-step approach to reading data from various sensors in different locations within a house, such as the kitchen and bedroom, using ESP32. Moreover, the chapter covers how to log this data in a database, visualize and monitor it, and control components using your smartphone.

Chapter 9, From Arduino IDE to Advanced IoT Development – Taking the Next Steps, offers a roadmap to advance your IoT development skills and suggests the next steps you can take to build on the knowledge gained from this book.

To get the most out of this book

This book is designed for beginners, so you only need a little knowledge about electronics and programming. To work on the projects in the book, you’ll also need some devices listed in the following table. For the software part, you’ll need the Arduino IDE, which works on all major operating systems. Additionally, the book mentions some free third-party services in different chapters, such as the OpenWeatherMap API, Twitter API, CallMeBot API, InfluxDB, Grafana, and PayPal API.

Software/hardware covered in the book

Operating system requirements

An ESP32 development board

Windows, macOS, or Linux

An ESP32-CAM board

Display modules

Sensors and actuators

Free API services (OpenWeatherMap, Twitter, CallMeBot, and PayPal APIs)

InfluxDB Cloud and Grafana Cloud

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

The specific uses of both software and hardware are thoroughly explained in their respective chapters with detailed instructions.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Programming-ESP32-with-Arduino-IDE. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “The WiFi.softAP() function is used to set up the ESP32 as an access point.”

A block of code is set as follows:

#include <WiFi.h>
const char* ssid = "MyESP32AP";
const char* password = "password123";
void setup() {
  Serial.begin(115200);
  WiFi.softAP(ssid, password);
  IPAddress apIP(192, 168, 4, 1);
  IPAddress subnet(255, 255, 255, 0);
  WiFi.softAPConfig(apIP, apIP, subnet);
  Serial.print("Access Point IP Address: ");
  Serial.println(WiFi.softAPIP());
}
void loop() {
  // Your code goes here
}

Bold: Indicates a new term, an important word, or words that you see on screen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Now, you can upload the code using Arduino IDE and open Serial Monitor."

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at customercare@packtpub.com and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you’ve read Hands-on ESP32 with Arduino IDE, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

  • Scan the QR code or visit the link below

https://packt.link/free-ebook/9781837638031

  • Submit your proof of purchase
  • That’s it! We’ll send your free PDF and other benefits to your email directly
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Hands-on ESP32 with Arduino IDE
Published in: Jan 2024Publisher: PacktISBN-13: 9781837638031
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Asim Zulfiqar

Asim Zulfiqar is a blogger and tech content creator who has been writing tutorials on embedded systems and IoT on his blog and YouTube channel, High Voltages. Currently, he is working as a scientific programmer for IoT research projects. He completed his bachelor's degree in electronic engineering at Sir Syed University of Engineering and Technology, Pakistan. After that, he completed his Erasmus Mundus joint master's degree program in Photonics Integrated Circuits, Sensors, and Networks at Scuola Superiore Sant'Anna (Italy), Aston University (U.K), and Osaka University (Japan).
Read more about Asim Zulfiqar