The ESP32 Practical Guide
This document serves as a practical guide to the ESP32 microcontroller, covering its introduction, installation, and a wide range of project-based learning modules (Hacks).
Introduction to the ESP32
This section introduces the ESP32 microcontroller, its capabilities, and various development boards such as the ESP32-Pico-Board, ESP32-Pico-Discovery-Board, and the ESP32-Wrover-KIT. It also provides information on where to find downloads.
Installation and Setup
Details the installation process for the Arduino Core for ESP32, including necessary preparations, potential updates, and specific instructions for installation on Linux systems.
Hack 1: Input/Output Fundamentals
Explores basic communication with the ESP32, covering GPIO as input and output. It explains the general Arduino program structure, the Arduino development environment, calculating series resistors, and the color code for resistors. I²C support is also discussed.
Hack 2: Temperature Measurement
Focuses on measuring environmental influences using sensors like the DHT11. It introduces Blynk for IoT applications and the associated Blynk app.
Hack 3: Working with Bluetooth
Explains the fundamentals of Bluetooth, its workflow, and Android app development for Bluetooth communication. It covers variable declaration, BLE scanning, loading App Inventor projects, and reacting to brightness changes using an LDR (Light Dependent Resistor).
Hack 4: Fetching Weather Data
Introduces OpenWeatherMap and the JSON data format for retrieving weather information. It details the construction of an electronic weather station, including servo control with external power supply.
Hack 5: Port Expansion and Roulette Game
Covers IO expansion using the MCP23017 port expander. It includes the development of a roulette game and how the MCP23017 reads data.
Hack 6: Timer Fundamentals
Discusses timer basics and generating interruptions through programming.
Hack 7: External Interrupts
Explains how to handle interruptions from external sources and includes a section on dealing with unexpected behavior.
Hack 8: Reaction Game
Details the creation of a reaction game to test user reflexes, outlining the objective and implementation.
Hack 9: Pulse Width Modulation (PWM)
Covers PWM fundamentals for controlling LED brightness and implementing fading effects.
Hack 10: Digital-to-Analog Conversion
Explains how to convert bits into voltage using a resistor ladder (R2R) and details the circuit setup.
Hack 11: Generating Sounds
Focuses on creating sounds, including the implementation of a siren.
Hack 12: Keypad Input
Guides through building a keypad for input, including preparations and creating a small musical instrument using it.
Hack 13: Motors and Touch Sensors
Explores adding movement with motors and touch sensors. It covers transistors, diodes, H-bridges, and the L293DNE motor driver for controlling motor speed.
Hack 14: The ESPTrak - Part 1
Details the construction of a robot vehicle, including the membrane keypad, chassis, external power supply, and board integration.
Hack 15: The ESPTrak - Part 2
Focuses on the programming of the ESPTrak robot, covering header files, class files, the main file, and programming sequences.
Hack 16: Web Server
Guides on creating a web server and developing a web frontend for controlling ESP32 projects.
Hack 17: Web Server Controls Relays
Explains how a web server can be used to control relays and secure the web frontend.
Hack 18: External Web Server Access
Covers accessing the web server from anywhere on the network.
Hack 19: MQTT Fundamentals
Introduces the MQTT protocol, its installation on Linux and Arduino, and its role in IoT communication.
Hack 20: MQTT in Practice
Demonstrates practical MQTT applications, including sending sensor readings and working with multiple temperature sensors.
Hack 21: MQTT and Databases
Explains how to store data using MQTT, covering the installation of paho-MQTT and SQLite, basic database operations (creating tables, adding/displaying/deleting data), and using a Python script to save data.
Hack 22: Hall Sensor
Discusses the Hall effect and its application with Hall sensors.
Hack 23: Stepper Motor
Details stepper motors and their control using the A4988 motor driver, including pin descriptions.
Hack 24: Drawing Machine
Explores creative applications by building a drawing machine.
Hack 25: Seven-Segment Display
Covers controlling individual segments of a seven-segment display and improving ESP32 code for its use.
Hack 26: MicroPython Programming Language
Provides an introduction to the MicroPython programming language, including testing MicroPython, blinking an LED, using the uPyCraft IDE, reading a button, and executing scripts after boot.
Hack 27: Ultrasonic Sensor
Explains how to measure distances using the HC-SR04 ultrasonic sensor, including voltage division for 5V to 3.3V conversion and interaction with Processing.
Hack 28: Deep Sleep
Covers ESP32's deep sleep functionality, including code for deep sleep, waking up the device, saving data, and waking up via external signals (EXT0 and EXT1).