The ESP32-WROOM-32 module is a powerful and versatile Wi-Fi and Bluetooth combo module based on the ESP32 SoC
(System on a Chip). The module provides reliable and high-performance connectivity and supports a wide range
of applications including Internet of Things (IoT), smart home, and wearable devices.
Features
Dual-core Tensilica LX6 microprocessors with clock frequency of up to 240 MHz
Built-in 448 KB ROM and 520 KB SRAM for program and data storage
Integrated 802.11 b/g/n Wi-Fi and Bluetooth 4.2 BR/EDR and BLE connectivity
Support for a wide range of interfaces, including UART, SPI, I2C, I2S, PWM, and ADC
Onboard antenna and support for external antenna for improved signal strength
Low power consumption with sleep modes and power management features
Wide operating temperature range (-40°C to 125°C)
Applications
The ESP32-WROOM-32 module is suitable for a wide range of applications, including:
Smart home devices such as smart switches, thermostats, and lighting systems
IoT devices such as environmental sensors, smart meters, and industrial automation systems
Wearable devices such as fitness trackers, smart watches, and medical monitoring devices
Audio and multimedia devices such as wireless speakers and headsets
Robotics and automation systems
Development Tools
The ESP32-WROOM-32 module is supported by a wide range of development tools and platforms, including:
ESP-IDF (Espressif IoT Development Framework): a comprehensive development environment for building IoT
applications on the ESP32
Arduino IDE: a popular open-source development environment for building Arduino-compatible projects with
the ESP32
PlatformIO: an open-source platform for developing IoT and embedded systems applications with the ESP32
and other microcontrollers
Conclusion
The ESP32-WROOM-32 module is a powerful and versatile Wi-Fi and Bluetooth combo module with a wide range of
features and applications. Its low power consumption, support for a wide range of interfaces, and
easy-to-use development tools make it an ideal choice for IoT and embedded systems projects.
PlattformIO
Introduction
PlatformIO is an open-source ecosystem for IoT development that supports more than 800 microcontrollers and
development boards. It provides a unified and user-friendly interface for configuring, building, and
uploading code to different microcontroller platforms. PlatformIO includes a powerful and feature-rich
development environment that supports multiple programming languages, libraries, and frameworks, as well as
integrated debugging tools and a command-line interface for automation and integration with other
development workflows.
Setting up the ESP32 with PlatformIO
Here's a step-by-step guide on how to set up the ESP32 with PlatformIO:
Install PlatformIO: You can download and install PlatformIO IDE from their website at https://platformio.org/install. Follow the instructions
specific to your operating system to complete the installation process.
Create a new PlatformIO project: Open the PlatformIO IDE and click on "New Project". Enter a name for
your project and select "ESP32" as the board type. You can also select a framework if you're planning to
use one, such as Arduino or ESP-IDF.
Configure the project settings: PlatformIO will generate a basic project structure with some default
files. Open the platformio.ini file and add the following lines to configure the project
settings:
These lines set the target environment for the project to the esp32dev board, which is a
common ESP32 development board, and set the platform and framework to espressif32 and
arduino respectively.
Upload the code: In the PlatformIO IDE, click on the "Upload" button to upload the default code to the
board. You can modify the code in the src folder as needed and upload it again to the
board.
PlatformIO supports a wider range of microcontrollers and development boards than the Arduino IDE,
giving you more flexibility when choosing hardware for your projects.
PlatformIO is a more powerful and feature-rich development environment than the Arduino IDE, with
advanced features like project management, library management, and multi-platform support.
PlatformIO has a built-in command-line interface (CLI) that makes it easy to automate tasks and
integrate it into other development workflows.
PlatformIO provides a powerful project management system that allows you to create and manage complex
projects with ease.
PlatformIO includes a built-in library manager that allows you to easily install, manage, and update
libraries for your projects.
PlatformIO supports a wide range of microcontroller platforms, including Arduino, ESP-IDF, STM32, and
many others.
PlatformIO provides a complete integrated development environment (IDE) that includes a text editor,
build tools, debugging tools, and other essential features.
PlatformIO supports continuous integration and deployment (CI/CD), allowing you to automate the process
of building, testing, and deploying your code to different environments.
PlatformIO has a large and active community of developers and users who contribute to the development of
the platform, provide support to each other, and share their knowledge and experience.
How to make the light intensity of an LED change with a potentiometer and ESP32 on PlatformIO
Here are the steps to change the light intensity of an LED with a potentiometer using ESP32 and PlatformIO
and display the values of light intensity and potentiometer on the serial monitor:
Connect the potentiometer and LED to the ESP32: Connect the middle pin of the potentiometer to an analog
input pin on the ESP32 (e.g. pin 34). Connect one of the other pins to ground and the other to 3.3V.
Connect the anode (positive) leg of the LED to a digital output pin on the ESP32 (e.g. pin 27) with a
current-limiting resistor (e.g. 220 ohms) in series. Connect the cathode (negative) leg of the LED to
ground.
Set up the code: In your PlatformIO project, open the src/main.cpp file and add the
following code:
const int ledPin = 16; // Pin to control the LED
const int potPin = 34; // Pin to read the potentiometer
const int ledcChannel = 0; // LEDC channel to use
const int ledcFreq = 5000; // LEDC frequency in Hz
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(potPin, INPUT);
// Set up the LEDC module
ledcSetup(ledcChannel, ledcFreq, 8);
ledcAttachPin(ledPin, ledcChannel);
}
void loop() {
// Read the voltage from the potentiometer
int potValue = analogRead(potPin);
// Map the potentiometer voltage (0-4095) to PWM duty cycle (0-255)
int pwmDutyCycle = map(potValue, 0, 4095, 0, 255);
// Set the LED brightness using PWM
ledcWrite(ledcChannel, pwmDutyCycle);
// Delay a little bit to make the brightness change visible
delay(10);
}
Upload the code: Connect your ESP32 to your computer and upload the code using the PlatformIO IDE. Once
the code is uploaded, open the serial monitor in the PlatformIO IDE (click on the serial monitor icon in
the bottom toolbar or go to PlatformIO -> Serial Monitor in the menu bar) to view the
potentiometer and brightness values in real-time as you adjust the potentiometer.
After that being done, we should now have a working circuit that changes the LED brightness with the
potentiometer using
ESP32 and PlatformIO, and displays the potentiometer and brightness values on the serial monitor.