Skip to content

Commit 16b26d3

Browse files
authored
feat: add article about getting started with arduino esp32 (#572)
* feat: add article about getting started with arduino esp32 * fix: update article with suggestions
1 parent 358b7d1 commit 16b26d3

File tree

8 files changed

+227
-0
lines changed

8 files changed

+227
-0
lines changed
230 KB
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: "Jan Procházka"
3+
---
34.4 KB
Loading
36.6 KB
Loading
17.6 KB
Loading
31.1 KB
Loading
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
---
2+
title: "Getting Started with ESP32 Arduino"
3+
date: "2025-10-01"
4+
summary: "Learn how to set up the ESP32 Arduino Core development environment, including Arduino IDE installation and ESP32 board package setup using both the Board Manager and manual Git installation methods."
5+
authors:
6+
- "jan-prochazka"
7+
tags: ["Arduino", "ESP32", "Getting Started", "Tutorial"]
8+
---
9+
10+
The [ESP32 Arduino Core](https://github.com/espressif/arduino-esp32) is a powerful development platform that brings the simplicity and accessibility of Arduino programming to Espressif's ESP32 series of microcontrollers. This integration allows developers to leverage the familiar Arduino environment while taking advantage of the ESP32's advanced features, including dual-core processing, built-in Wi-Fi and Bluetooth connectivity, and extensive peripheral support.
11+
12+
## What is the ESP32 Arduino Core?
13+
14+
The ESP32 Arduino Core is an open-source project developed by Espressif Systems that provides Arduino-compatible libraries and tools for programming ESP32 microcontrollers. It extends the Arduino platform to support the ESP32's unique capabilities while maintaining compatibility with the vast ecosystem of Arduino libraries and sketches.
15+
16+
### Key Features and Capabilities
17+
18+
The ESP32 Arduino Core provides comprehensive support for all Espressif mass-production SoCs and unlocks their powerful features:
19+
20+
- **Multi-SoC Support**: Compatible with all Espressif mass-production SoCs including ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-H2, ESP32-P4 (as of the time of writing, with new SoCs being added regularly)
21+
- **Built-in Connectivity Libraries**: Native support for Wi-Fi (802.11 b/g/n), Ethernet, Bluetooth Low Energy (BLE), Zigbee protocols
22+
- **Comprehensive Peripheral Support**: Extensive GPIO pins, ADC, DAC, I2C, I2S, SPI, UART, LEDC, Touch sensors, and many more peripherals
23+
- **Built-in Libraries**: Rich ecosystem of pre-built libraries including WebServer, HTTP client, OTA updates, Matter, file system support, and more
24+
- **Real-Time Operating System**: FreeRTOS-based multitasking capabilities for complex applications
25+
- **Arduino Compatibility**: Seamless integration with existing Arduino libraries and code while adding ESP32-specific functionality
26+
27+
### Why Choose ESP32 Arduino Core?
28+
29+
The ESP32 Arduino Core is particularly beneficial for:
30+
31+
- **Rapid Prototyping**: Familiar Arduino syntax and extensive library support
32+
- **Educational Purposes**: Easy learning curve for beginners
33+
- **Professional Development**: Powerful enough for complex applications while maintaining simplicity
34+
- **Huge Amount of Examples**: Extensive collection of example code covering all features and use cases
35+
- **Community Support**: Large community and extensive documentation
36+
37+
## Prerequisites
38+
39+
Before setting up the ESP32 Arduino Core, ensure you have:
40+
41+
- A computer running Windows, macOS, or Linux
42+
- [Arduino IDE](https://www.arduino.cc/en/software) installed (version 2.x recommended)
43+
- Any ESP32 development board with a USB-to-UART interface or a USB-capable device.
44+
- A good USB data cable to connect your ESP32 to your computer
45+
46+
## Installation Methods
47+
48+
There are two primary ways to install the ESP32 Arduino Core:
49+
50+
1. **Instalation via Arduino IDE Board Manager** (Recommended for beginners)
51+
2. **Manual Installation using Git** (Advanced users and developers)
52+
53+
We'll cover both methods in detail.
54+
55+
## Method 1: Installation via Arduino IDE Board Manager
56+
57+
This is the recommended method for most users as it's straightforward and handles all dependencies automatically.
58+
59+
### Step 1: Add ESP32 Board Manager URL
60+
61+
1. In Arduino IDE, **open Preferences**:
62+
63+
- Navigate to **File > Preferences** (Windows/Linux) or **Arduino > Preferences** (macOS)
64+
![Arduino IDE preferences window](arduino-preferences.webp)
65+
66+
67+
2. **Add Board Manager URL**:
68+
69+
- In the "Additional Board Manager URLs" field, add one of the following URLs:
70+
71+
**Stable Release (Recommended for most users)**:
72+
```md
73+
https://espressif.github.io/arduino-esp32/package_esp32_index.json
74+
```
75+
76+
**Development Release (Latest features, pre-release versions)**:
77+
```md
78+
https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json
79+
```
80+
81+
**For users in China (Mirror with better download speeds)**:
82+
{{< tabs groupId="config" >}}
83+
{{% tab name="Stable" %}}
84+
https://jihulab.com/esp-mirror/espressif/arduino-esp32/-/raw/gh-pages/package_esp32_index_cn.json
85+
{{% /tab %}}
86+
{{% tab name="Development" %}}
87+
https://jihulab.com/esp-mirror/espressif/arduino-esp32/-/raw/gh-pages/package_esp32_dev_index_cn.json
88+
{{% /tab %}}
89+
{{< /tabs >}}
90+
91+
![Adding board manager url](arduino-url.webp)
92+
93+
- If you have other URLs already, add this one on a new line
94+
- Click "OK" to save the settings
95+
96+
### Step 2: Install ESP32 Board Package
97+
98+
1. **Open Boards Manager**:
99+
- Navigate to **Tools > Board > Boards Manager...** or click on Boards manager icon in sidebar
100+
- In the search bar, type "esp32"
101+
- Look for "esp32 by Espressif Systems" in the results
102+
- Click the "Install" button
103+
- Wait for the installation to complete (this may take several minutes)
104+
105+
![Installing esp32](arduino-install.webp)
106+
107+
## Method 2: Manual Installation using Git
108+
109+
This method is recommended for advanced users who want more control over the installation or need to work with specific versions of the ESP32 Arduino Core.
110+
111+
### Prerequisites for Git Installation
112+
113+
- Git installed on your system
114+
- Python 3.x installed
115+
116+
### Clone ESP32 Arduino Core Repository and Install Tools and Dependencies
117+
118+
The following asciinema recording demonstrates the complete manual installation process:
119+
120+
<script src="https://asciinema.org/a/xpWMVXgwnxAzk7g01aQVc7hBd.js" id="asciicast-xpWMVXgwnxAzk7g01aQVc7hBd" async="true"></script>
121+
122+
**What the recording shows:**
123+
124+
1. **Navigate to Arduino Directory**:
125+
```bash
126+
cd Documents/Arduino
127+
```
128+
129+
2. **Create Hardware Directory Structure**:
130+
```bash
131+
mkdir -p hardware/espressif
132+
cd hardware/espressif
133+
```
134+
135+
3. **Clone the Repository**:
136+
```bash
137+
git clone https://github.com/espressif/arduino-esp32.git esp32
138+
```
139+
140+
4. **Navigate to Tools Directory**:
141+
```bash
142+
cd esp32/tools
143+
```
144+
145+
5. **Run Installation Script**:
146+
```bash
147+
python get.py
148+
```
149+
150+
**Platform Notes:**
151+
- **Windows**: Use Command Prompt or PowerShell instead of terminal
152+
- **Linux/macOS**: The commands shown work directly in terminal
153+
- **Alternative for Windows**: If Python is not available, you can run `get.exe` directly instead of `python get.py`
154+
155+
## Run your first sketch
156+
157+
To ensure everything is working correctly, let's create a simple test sketch:
158+
159+
1. **Open Arduino IDE**
160+
2. **Select Board**: Go to **Tools > Board > ESP32 Arduino > ESP32 Dev Module**
161+
3. **Select Port**: Choose the correct COM port for your ESP32
162+
4. **Create New Sketch**: Go to **File > New**
163+
5. **Paste Test Code**:
164+
```cpp
165+
void setup() {
166+
Serial.begin(115200);
167+
}
168+
169+
void loop() {
170+
Serial.println("Hello from ESP32 Arduino!");
171+
delay(1000);
172+
}
173+
```
174+
6. **Upload the Sketch**: Click the upload button (arrow icon)
175+
7. **Open Serial Monitor**: Go to **Tools > Serial Monitor** and set baud rate to 115200
176+
177+
If you see "Hello from ESP32 Arduino!" appearing every second in the Serial Monitor, your ESP32 Arduino Core installation is successful!
178+
179+
### Understanding the Serial Monitor
180+
181+
The Serial Monitor is a powerful debugging tool that allows you to communicate with your ESP32 board through the USB connection. It's essential for:
182+
183+
- **Viewing Output**: See text messages, sensor readings, and debug information from your ESP32
184+
- **Debugging Code**: Print variable values, status messages, and error information to troubleshoot your programs
185+
- **Interactive Communication**: Send commands to your ESP32 and receive responses
186+
187+
**Key Serial Monitor Features:**
188+
- **Baud Rate**: Must match the `Serial.begin()` rate in your code (115200 in our example)
189+
- **Auto-scroll**: Automatically shows the latest messages
190+
- **Clear**: Button to clear the display
191+
- **Send**: Text field to send commands to your ESP32
192+
- **Timestamps**: Optional feature to show when each message was received
193+
194+
**Common Serial Commands in Arduino:**
195+
```cpp
196+
Serial.begin(115200); // Initialize serial communication at 115200 baud
197+
Serial.println("Message"); // Print message and move to next line
198+
Serial.print("Value: "); // Print without moving to next line
199+
Serial.println(variable); // Print variable value
200+
Serial.available(); // Check if data is available to read
201+
Serial.read(); // Read incoming data
202+
```
203+
204+
The Serial Monitor is your window into what's happening inside your ESP32, making it an indispensable tool for learning and debugging!
205+
206+
## Next Steps
207+
208+
Now that you have the ESP32 Arduino Core installed, you can:
209+
210+
- Try the example to connect your ESP32 to [Wi-Fi](https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino) or try out any of the [ESP32 examples](https://github.com/espressif/arduino-esp32/tree/master/libraries) included with the installation. These examples can be easily accessed in the Arduino IDE by going to **File > Examples** and selecting one of the ESP32 example sketches.
211+
- Explore the [ESP32 Arduino Core documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/)
212+
- If you don't have any ESP32 boards yet, you can use the [Wokwi simulator](https://wokwi.com/esp32) to start with ESP32 Arduino Core.
213+
- Start building your first IoT project with built-in Wi-Fi and Bluetooth capabilities
214+
215+
The ESP32 Arduino Core opens up a world of possibilities for embedded development, combining the simplicity of Arduino with the power and connectivity features of the ESP32. Happy coding!

data/authors/jan-prochazka.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "Jan Procházka",
3+
"image" : "img/authors/jan-prochazka.webp",
4+
"bio": "Embedded Software Engineer at Espressif",
5+
"social": [
6+
{ "linkedin": "https://www.linkedin.com/in/jan-procházka-ab7399173/" },
7+
{ "github": "https://github.com/p-r-o-c-h-y" }
8+
]
9+
}

0 commit comments

Comments
 (0)