Before measuring heartbeats, let's make sure your computer can talk to your XIAO ESP32S3. This section takes about 10 minutes and saves hours of debugging later.
🎯 What You'll Learn
- Installing Arduino IDE
- Adding ESP32 board support
- Selecting the right board and port
- Uploading your first test sketch
- Installing required libraries
Step 1: Install Arduino IDE
- Go to arduino.cc/en/software
- Download Arduino IDE 2.x for your operating system
- Install and open Arduino IDE
Step 2: Add ESP32 Board Support
Add the ESP32 Board URL:
- Go to File → Preferences (Mac: Arduino IDE → Settings)
- Find "Additional boards manager URLs"
- Paste this URL: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Click OK
Install ESP32 Boards:
- Go to Tools → Board → Boards Manager
- Search for "esp32"
- Install "esp32 by Espressif Systems" (version 2.x or 3.x)
- Wait for installation (takes 2-3 minutes)
Step 3: Select Your Board
- Connect your XIAO ESP32S3 via USB-C cable
- Go to Tools → Board → esp32
- Select "XIAO_ESP32S3"
- Go to Tools → Port and select the port that appeared (usually contains "USB" or "XIAO")
Step 4: Test Upload (Blink)
Let's verify everything works with a simple LED blink:
// XIAO ESP32S3 Blink Test
// The built-in LED is on pin 21 (active LOW)
void setup() {
pinMode(21, OUTPUT);
Serial.begin(115200);
Serial.println("XIAO ESP32S3 is working!");
}
void loop() {
digitalWrite(21, LOW); // LED ON
delay(500);
digitalWrite(21, HIGH); // LED OFF
delay(500);
}Click the Upload button (→ arrow). After uploading, you should see the orange LED blinking.
✓ Success Looks Like
- Console shows "Done uploading"
- Orange LED on board blinks on/off every 0.5 seconds
- Serial Monitor (Tools → Serial Monitor, 115200 baud) shows "XIAO ESP32S3 is working!"
⚠️ Troubleshooting
| Problem | Solution |
|---|---|
| No port appears | Try a different USB cable (some are charge-only). Use USB-C directly, not through a hub. |
| "Failed to connect" | Hold BOOT button while clicking Upload. Release after "Connecting..." appears. |
| Windows: Port not found | Install CP210x drivers or check Device Manager for unknown devices. |
| Mac: Permission denied | System Preferences → Security & Privacy → Allow the USB device. |
Step 5: Install Libraries
These libraries power the advanced examples (BPM calculation, OLED display, WiFi streaming).
How to Install Libraries:
- Go to Sketch → Include Library → Manage Libraries
- Search for each library name below
- Click Install (accept any dependencies if prompted)
| Library | Author | Used In |
|---|---|---|
| PulseSensor Playground | World Famous Electronics | Examples 2b, 3b, 4b, 5b |
| Adafruit SH110X | Adafruit | Examples 3, 5 (OLED) |
| Adafruit GFX Library | Adafruit | Examples 3, 5 (graphics) |
| WebSockets | Markus Sattler | Examples 4, 5 (WiFi) |
⚠️ Library Troubleshooting
| Problem | Solution |
|---|---|
| Library not found | Check spelling: "PulseSensor Playground" (not "Pulse Sensor"), "WebSockets" (not "WebSocket") |
| Multiple versions | Choose the one by the author listed above. Install the latest version. |
| "Install dependencies?" | Click "Install All" — this is normal for Adafruit libraries. |
✅ Setup complete! You're ready to see your heartbeat.