IoT Tutorial: Getting Started with the XIAO ESP32-C3: Make an LED Blink

July 17, 2026

Every microcontroller project starts with a first program. In this tutorial, you’ll learn how to set up the XIAO ESP32-C3, install the Arduino IDE, and upload a simple program that makes an LED blink. Along the way, you’ll become familiar with the basic hardware, software, and programming workflow used for ESP32 development.

While blinking an LED may seem simple, it is an important first step. Once you understand how to upload code and control hardware, you’ll be ready to build more advanced projects using sensors, wireless communication, and IoT technologies.

Hardware You'll Need

Before uploading your first program, you’ll need a few basic components. Don’t worry if you’ve never worked with electronics before, this circuit is simple to assemble and requires no soldering.

For this tutorial, you’ll need:

  • Microcontroller: XIAO ESP32-C3
  • Breadboard
  • 5 mm LED
  • 330-Ω resistor
An image of a microcontroller: XIAO ESP32-CR

The Microcontroller is the brain of the sensor setup: XIAO-ESP32-C3

Picture of a breadboard for connecting without soldering

A breadboard for connecting everything without soldering (learn more at https://learn.sparkfun.com/tutorials/how-to-use-a-breadboard/all)

 

Red 5mm LED

An LED (long leg is +)

Picture of a 330-Ω resistor

A 330-ohm resistor to prevent the LED from burning out

Building the Circuit

Now that you have all the required components, connect them on the breadboard as shown below:

Visualization of hardware setup on the breadboard

Breadboard visualization of hardware setup

 

Now that the circuit is assembled, we need to tell the microcontroller what to do, for this we can program the XIAO ESP32-C3.

Programming the XIAO ESP32-C3

We’ll first install the Arduino IDE, configure it for ESP32 development, and connect the board to the computer. Once everything is set up, we’ll upload our first program to make the LED blink.

Install the Arduino IDE

    1. Download the latest stable version of Arduino IDE from the official website: https://www.arduino.cc/en/software
    2. Choose the download for your operating system and follow the appropriate steps below:

On Windows:

  1. Download the Windows installer, which is an .exe file.
  2. Open the downloaded file.
  3. Follow the installation wizard and accept the default options unless you have a reason to change them.
  4. When the installation is complete, open Arduino IDE from the Start menu.

On MacOS:

    1. Download the macOS disk image, which is a .dmg file.
    2. Open the downloaded file.
    3. Drag Arduino IDE into the Applications folder.
    4. Open Arduino IDE from the Applications folder or with Spotlight.

On Linux:

      1. Download the Linux AppImage.
      2. Open the file properties and allow the file to run as a program.
      3. Double-click the AppImage to start Arduino IDE.

Install ESP32 Board Support

Arduino IDE does not support the XIAO ESP32C3 by default. You first need to add the official Espressif package source and install the ESP32 board package.

  1. Open Arduino IDE.
  2. On Windows or Linux, open File > Preferences. On macOS, open Arduino IDE > Settings.
  3. Find Additional Boards Manager URLs and add this URL: https://espressif.github.io/arduino-esp32/package_esp32_index.json
  4. If another URL is already present, use the button next to the field to add the ESP32 URL on a separate line instead of replacing the existing URL.
  5. Click OK to save the settings.
  6. Open Tools > Board > Boards Manager, or select the Boards Manager icon in the sidebar.
  7. Search for esp32.
  8. Find esp32 by Espressif Systems and click Install.
  9. Wait for the installation to finish, then restart Arduino IDE.

Connect the Board

Connect the XIAO ESP32C3 to your computer with a USB-C cable.

Use a cable that supports data. Some USB-C cables can only charge devices. If the board does not appear in the Arduino IDE, try another cable first.

Select the Board

Open Tools > Board > esp32 and select XIAO_ESP32C3. You can also use the board selector at the top of the Arduino IDE window and search for XIAO_ESP32C3.

Select the Port

Open Tools > Port and select the USB serial port that belongs to the board. You can also select it through the board selector at the top of the Arduino IDE window.

On Windows this is usually a COM port, for example COM3, COM4, or a higher number. On macOS or Linux the name usually starts with /dev/.

If you are not sure which port is the board, unplug the board, look at the port list, plug the board in again, and check which port appeared.

Verify the Installation

  1. Open File > New Sketch.
  2. Check that XIAO_ESP32C3 and the correct port are shown in the board selector at the top of the window. Select them again if necessary.
  3. Click the checkmark button, or choose Sketch > Verify/Compile, to compile the empty sketch. This checks whether the board package and compiler are working.
  4. Click the arrow button, or choose Sketch > Upload, to transfer the sketch to the board.
  5. Watch the output panel at the bottom of the window. Arduino IDE first compiles the C/C++ code into machine code and then uploads it to the board. Wait until the IDE reports that the upload is complete.

With a bit of luck, everything worked and your program does absolutely nothing. Great. That means the board can be programmed.

Upload the Blink Sketch

Copy and paste this code, then upload it to your XIAO using the arrow pointing to the right in Arduino IDE.


// XIAO has no built-in LED.
#define LED_NOTBUILTIN D10

void setup() {
  pinMode(LED_NOTBUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_NOTBUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_NOTBUILTIN, LOW);
  delay(1000);
}

That’s it: your LED should now be blinking!

Troubleshooting

The Board Is Not Detected

  • Use a USB-C cable that supports data.
  • Unplug the board and plug it in again.
  • Close the Serial Monitor if it is open.
  • Reopen the Tools > Port menu.
  • Press the RESET button on the board once.
  • Try another USB port.
  • Restart the Arduino IDE.

If uploading gets stuck on Connecting…, press RESET when the message appears and try the upload again.

What's next?

Congratulations! You’ve successfully programmed your first XIAO ESP32-C3 and controlled an external LED.

If you’d like to continue building practical IoT projects, the From Sensor to Map with C++ and XIAO ESP32-C3 course takes you beyond the basics. You’ll learn how to connect sensors, transmit data over Wi-Fi, work with MQTT, create GeoJSON, and visualize real-world sensor data on interactive maps.

Joram van der Vlist

Joram is GIS developer specializing in cloud-native & web-based geospatial solutions

Get the best
Geo content delivered to your inbox every week

Joram van der Vlist

Joram is GIS developer specializing in cloud-native & web-based geospatial solutions

Get the best
Geo content delivered to your inbox every week

Joram van der Vlist

Joram is GIS developer specializing in cloud-native & web-based geospatial solutions

Get the best
Geo content delivered to your inbox every week