If you have been curious about building your own Wi-Fi connected gadgets, smart home devices, or IoT sensors, the ESP32 is the best place to start. It is powerful, affordable, beginner-friendly, and supported by a massive community. In this guide we will take you from zero — unboxing a brand-new ESP32 board — all the way to uploading your first program.
Components for This Project
| Component | Shop |
|---|---|
| ESP32 DEVKIT (WROOM 32) | View Product |
What is the ESP32?
The ESP32 is a microcontroller chip developed by Espressif Systems. Unlike a basic Arduino, the ESP32 has Wi-Fi and Bluetooth built right in, a dual-core 240 MHz processor, and a rich set of input/output pins — all for around RM 25–40 at most electronics shops.
Key Features at a Glance
| Feature | Detail |
|---|---|
| CPU | Dual-core Xtensa LX6, up to 240 MHz |
| Wi-Fi | 2.4 GHz, up to 150 Mbps |
| Bluetooth | BLE 4.2 + Classic Bluetooth |
| RAM | 520 KB SRAM |
| Flash | 4 MB (typical dev board) |
| GPIO Pins | Up to 36 usable on DEVKIT V1 |
| ADC | 18 analog input channels (12-bit) |
| DAC | 2 channels (8-bit) |
| Interfaces | UART, SPI, I2C, I2S, PWM, capacitive touch |
| Price | ~RM 25–40 for a dev board |
In short: think of the ESP32 as an Arduino Uno, but 10x faster, with built-in Wi-Fi, Bluetooth, and far more GPIO pins — at roughly the same price.
ESP32 vs ESP8266 — What Changed?
Many makers started out with the ESP8266. The ESP32 is its direct successor and improves on almost every front:
| Spec | ESP8266 | ESP32 |
|---|---|---|
| CPU Cores | 1 | 2 |
| Clock Speed | 80 MHz | Up to 240 MHz |
| Bluetooth | None | BLE + Classic |
| ADC Channels | 1 | 18 |
| GPIO Count | ~11 usable | Up to 36 |
| Touch Pins | No | Yes |
| Hall Effect Sensor | No | Yes |
| Price | ~RM 15–20 | ~RM 25–40 |
If you are starting fresh today, go straight to the ESP32 — it is not much more expensive and it will take you much further.
Choosing Your Board
The most popular and beginner-friendly option is the ESP32 DEVKIT V1 DOIT. It comes in 30-pin and 36-pin versions — both work the same way.
Why this board?
- Has a USB-to-UART bridge (CP2102 or CH340) built in — plug it straight into your computer
- Has both a BOOT and RESET (EN) button
- Built-in blue LED on GPIO 2 — handy for testing
- Built-in red power LED
- Standard breadboard-friendly pin spacing
- Tons of tutorials and community support
Other good options include the NodeMCU-32S, Wemos LoLin32, and Adafruit ESP32 Feather. The setup steps below work for all of them.
What You Will Need
| Item | Notes |
|---|---|
| ESP32 Development Board | DEVKIT V1 DOIT recommended for beginners |
| Micro USB cable | Must have data wires — charge-only cables will not work |
| Computer | Windows, Mac, or Linux |
| Arduino IDE 2 | Free download — covered below |
Common beginner mistake: using a charge-only USB cable. If the IDE cannot detect your board at all, swap the cable first — this fixes the problem 80% of the time.
Step 1 — Install Arduino IDE
Download Arduino IDE 2 from the official website:
Choose the installer for your operating system (Windows, Mac, or Linux) and run it. Accept all defaults during installation.
Step 2 — Install the USB Driver
When you plug in the ESP32, your computer needs a driver to talk to the USB chip on the board. Most boards use one of two chips:
| Chip | How to Identify | Where to Download |
|---|---|---|
| CP2102 | Printed on the small chip near the USB port | silabs.com — CP210x Universal Driver |
| CH340 | "CH340" printed on the chip | wch.cn — CH341SER driver |
After installing the driver, unplug and replug the board. Open Arduino IDE, go to Tools > Port — you should now see a COM port appear (Windows) or a
1/dev/cu.usbserialStep 3 — Add ESP32 to Arduino IDE
Arduino IDE does not know about ESP32 boards out of the box. We need to add Espressif's board package.
1. Open Arduino IDE then go to File > Preferences
2. Find the "Additional boards manager URLs" field and paste this URL:
textcode1https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
Click OK.
3. Go to Tools > Board > Boards Manager
4. Search for ESP32, find "esp32 by Espressif Systems", and click Install. This downloads about 200–300 MB of toolchain files and may take a few minutes.
5. After installation, restart Arduino IDE.
6. Go to Tools > Board and confirm you now see a long list of ESP32 boards.
Step 4 — Select Your Board and Port
1. Go to Tools > Board > esp32 > DOIT ESP32 DEVKIT V1 (or whichever matches your board)
2. Go to Tools > Port and select the COM port your ESP32 is on.
If you see multiple ports and are unsure which is the ESP32, unplug the board, note what ports are listed, then plug it back in — the new port that appears is your ESP32.
Step 5 — Upload Your First Program (Blink)
The classic "hello world" of hardware is blinking an LED. The ESP32 DEVKIT has a blue LED wired to GPIO 2 — perfect for this test.
Go to File > Examples > 01.Basics > Blink, then replace
1LED_BUILTIN12cppcode1#define LED_PIN 2 // Built-in blue LED on most ESP32 DEVKIT boards 2 3void setup() { 4 pinMode(LED_PIN, OUTPUT); 5} 6 7void loop() { 8 digitalWrite(LED_PIN, HIGH); // LED on 9 delay(500); 10 digitalWrite(LED_PIN, LOW); // LED off 11 delay(500); 12}
Click the Upload button (right-arrow icon). The IDE will compile and flash the code. If it succeeds, the blue LED should start blinking every half second.
Upload fails? Hold the BOOT button on the board while uploading. When you see a row of dots appear in the output window, the board is trying to connect — hold BOOT at that moment. Some boards require this to enter flashing mode.
Step 6 — Try the Wi-Fi Scanner
Now let us use what makes the ESP32 special — its built-in Wi-Fi radio. This example scans for nearby networks and prints them to the Serial Monitor.
Go to File > Examples > WiFi (ESP32) > WiFiScan and click Upload.
Once uploaded:
- Open Tools > Serial Monitor
- Set the baud rate to 115200
- Press the EN/RESET button on the board
You should see a list of all Wi-Fi networks within range, along with their signal strength and encryption type. That is your ESP32 using its built-in radio for the first time!
cppcode1// Example Serial Monitor output: 2// Scan done 3// 8 networks found 4// 1: MyHomeWifi (-45) 5// 2: Neighbour_5G (-67) 6// 3: ...
Understanding the GPIO Pins
The ESP32 DEVKIT V1 exposes 36 pins (18 per side). Here is a quick overview of the main groups:
| Pin Group | Pins | Notes |
|---|---|---|
| Power | 3V3, GND, VIN | VIN accepts 5V via the onboard regulator |
| Digital I/O | GPIO 0–39 | Most can be input or output |
| Analog Input (ADC) | GPIO 32–39, 0, 2, 4, 12–15, 25–27 | 12-bit resolution (0–4095) |
| Analog Output (DAC) | GPIO 25, 26 | True analog voltage output |
| I2C | SDA = GPIO 21, SCL = GPIO 22 | Default pins; can be reassigned in code |
| SPI | MOSI = 23, MISO = 19, CLK = 18, CS = 5 | Default VSPI pins |
| UART | TX = GPIO 1, RX = GPIO 3 | Used by USB Serial — avoid in most projects |
| Touch Pins | GPIO 0, 2, 4, 12–15, 27, 32, 33 | Capacitive touch sensing |
Important: GPIO 34, 35, 36, and 39 are input-only — they cannot drive output. Also, ADC2 pins (GPIO 0, 2, 4, 12–15, 25–27) are disabled when Wi-Fi is active. Use ADC1 pins (GPIO 32–39) for analog readings when Wi-Fi is running at the same time.
Common Problems and Fixes
| Problem | Most Likely Cause | Fix |
|---|---|---|
| Board not detected (no COM port) | Wrong or missing USB driver, or charge-only cable | Install CP2102 or CH340 driver; swap cable |
| "Failed to connect — Timed out" | Board not in flashing mode | Hold BOOT button when uploading |
| Upload succeeds but nothing happens | Wrong board selected | Check Tools > Board matches your hardware |
| Serial Monitor shows garbage text | Wrong baud rate | Set Serial Monitor to 115200 |
| ADC reads wrong values with Wi-Fi on | ADC2 conflict with Wi-Fi | Switch to ADC1 pins (GPIO 32–39) |
| Board resets repeatedly after upload | Crash or stack overflow | Open Serial Monitor — the error message will identify the crash |
What to Build Next
Once you have the LED blinking and Wi-Fi scanning working, here are great beginner next steps:
- Read a sensor — connect a DHT22 temperature/humidity sensor and print readings to Serial Monitor
- Build a web server — serve a simple webpage from the ESP32 that shows live sensor data
- Control an LED from your phone — toggle a GPIO over Wi-Fi from any browser on your network
- Connect to MQTT — publish sensor readings to an IoT dashboard like Node-RED or Home Assistant
- Deep sleep project — build a battery-powered sensor that wakes up every 10 minutes, reads data, sends it, then goes back to sleep
The ESP32 is capable of all of these and much more. The combination of a fast dual-core processor, Wi-Fi, Bluetooth, and plenty of GPIO pins means you rarely hit a wall with this board.
Summary
| Step | What You Did |
|---|---|
| 1 | Installed Arduino IDE 2 |
| 2 | Installed the USB-to-UART driver (CP2102 or CH340) |
| 3 | Added the ESP32 board package via Boards Manager |
| 4 | Selected the correct board and COM port |
| 5 | Uploaded the Blink example — LED flashing! |
| 6 | Ran the Wi-Fi scanner — ESP32 sees your network! |
You are now set up and ready to explore. Browse the ESP32 components in our store to pick up sensors, displays, and modules for your next project.
Happy building!
