ESP32 โ Pinout and Setup Quick Reference
notereference1c3d
Markdown
ESP32 โ Pinout and Setup Quick Reference
ESP32 DevKit v1 (30-pin) Pinout
| GPIO | Function | Notes |
|---|---|---|
| 0 | Boot mode | Pull high normally, low for flash mode |
| 1 | TX0 | USB serial TX |
| 2 | LED, SPI | Onboard LED on many boards |
| 3 | RX0 | USB serial RX |
| 4 | GPIO, ADC2 | General purpose |
| 5 | GPIO, SPI SS | SPI chip select common |
| 6-11 | Flash | DO NOT USE โ connected to internal flash |
| 12 | TDI, ADC2 | Boot-sensitive, avoid |
| 13 | TCK, ADC2 | General purpose |
| 14 | TMS, ADC2 | General purpose |
| 15 | TDO, ADC2 | Boot-sensitive |
| 16 | RX2 | UART2 |
| 17 | TX2 | UART2 |
| 18 | SCK | SPI clock |
| 19 | MISO | SPI MISO |
| 21 | SDA | I2C data |
| 22 | SCL | I2C clock |
| 23 | MOSI | SPI MOSI |
| 25 | DAC1, ADC2 | Analog out |
| 26 | DAC2, ADC2 | Analog out |
| 27 | ADC2 | General purpose |
| 32 | ADC1 | Input OK |
| 33 | ADC1 | Input OK |
| 34 | ADC1 | Input only, no pull-up |
| 35 | ADC1 | Input only, no pull-up |
| 36 (VP) | ADC1 | Input only |
| 39 (VN) | ADC1 | Input only |
Arduino IDE Setup
- File > Preferences > Additional boards URL:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Tools > Board > Boards Manager > search "esp32" > Install
- Select board: ESP32 Dev Module
- Upload speed: 115200 or 921600
- Hold BOOT button when upload starts if needed
PlatformIO Setup
; platformio.ini
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
Common Libraries
| Library | Purpose |
|---|---|
| WiFi.h | Built-in Wi-Fi |
| HTTPClient.h | HTTP requests |
| ArduinoJson | JSON parsing |
| ESPAsyncWebServer | Async web server |
| Preferences.h | NVS key-value store |
| SPIFFS.h | Internal filesystem |