IoT Tutorial

IoT Tutorial: Getting Started Quickly with XIAO ESP32-C3: Will the LED Light Up?

July 25, 2026

I used this IoT tutorial in a workshop I led at FOSS4G Europe 2026 in Romania. In another blog post, “Looking Back on FOSS4G Europe 2026 in Timișoara, Romania,” I share my experiences at that fantastic conference.

GIS has long since ceased to be solely about analyzing existing datasets. Geographic data is increasingly being collected in real time using IoT sensors. That’s why it’s becoming more and more important for geo-professionals to understand how sensor data is collected, processed, and fed into a GIS via Wi-Fi and protocols such as MQTT. This knowledge is indispensable in fields such as water management, infrastructure, agriculture, and smart cities. The blinking LED in this tutorial is the first step toward building professional Geo-IoT solutions with real-time geodata.

Every microcontroller project starts with an initial 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 be introduced to the basics of the hardware, software, and programming workflow used for developing ESP32 projects.

What hardware do you need?

Although a blinking LED may seem simple, it’s 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.

Before you upload your first program, you’ll need a few simple components. Don’t worry if you’ve never worked with electronics before: this circuit is easy to build 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 Picture of a breadboard for connecting without soldering

 

Red 5mm LED Picture of a 330-Ω resistor

 

Setting Up the Circuit

Now that you have all the necessary components, you can connect them to the breadboard as shown below:

Visualization of hardware setup on the breadboard

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

Programming the XIAO ESP32-C3

We’ll start by installing the Arduino IDE, configuring the software for ESP32 development, and connecting the board to the computer. Once everything is set up, we’ll upload our first program to make the LED blink.

Installing the Arduino IDE

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

On Windows:

  1. Download the Windows installer (.exe).
  2. Open the downloaded file.
  3. Follow the installation wizard and accept the default settings, unless you have a reason to change them.
  4. After installation, open the Arduino IDE from the Start menu.

On macOS:

    1. Download the macOS disk image (.dmg).
    2. Open the downloaded file.
    3. Drag the Arduino IDE to the Applications folder.
    4. Open the Arduino IDE from the Applications folder or via Spotlight.

On Linux:

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

Installing ESP32 Board Support

The Arduino IDE does not support the XIAO ESP32-C3 by default. You must therefore first add Espressif’s official package repository and then install the ESP32 board package.

  1. Open the Arduino IDE.
  2. On Windows or Linux, go to File > Preferences. On macOS, go to Arduino IDE > Settings.
  3. Look for “Additional Boards Manager URLs” and add the following URL: https://espressif.github.io/arduino-esp32/package_esp32_index.json
  4. Is there already a URL in this field? If so, use the button next to the field to add the ESP32 URL on a new line, rather than replacing the existing URL.
  5. Click OK to save the settings.
  6. Open Tools > Board > Boards Manager, or click the Boards Manager icon in the sidebar.
  7. Search for esp32.
  8. Find esp32 by Espressif Systems and click Install.
  9. Wait until the installation is complete, then restart the Arduino IDE.

Connecting the Board

Connect the XIAO ESP32-C3 to your computer using a USB-C cable.

Use a USB-C cable that supports data transfer. Some USB-C cables are only designed for charging devices. If the board doesn’t appear in the Arduino IDE, try using a different cable first.

Selecting the board

Go to 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.

Selecting the Correct Port

Go to Tools > Port and select the USB serial port associated with the board. You can also select it using the board selector at the top of the Arduino IDE window.

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

Not sure which port corresponds to the board? Disconnect the board, view the list of ports, reconnect the board, and check which port has appeared.

Check the installation

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

With any luck, everything went well and your program does absolutely nothing. Perfect. That means you can successfully program the board.

Uploading the Blink Sketch

Copy and paste the code below, then upload it to your XIAO by clicking the right-pointing arrow in the 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! If everything went well, the LED should now be blinking.

Troubleshooting

The board is not being detected

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

If the upload gets stuck on "Connecting…," press the RESET button as soon as this message appears and try uploading again.

So what now?

Congratulations!

You have successfully programmed your first XIAO ESP32-C3 and controlled an external LED.

Would you like to continue building practical IoT projects? Then the course “From Sensor to Board with C++ and XIAO ESP32 C3” takes you beyond the basics. You’ll learn how to connect sensors, send data via Wi-Fi, work with MQTT, generate GeoJSON, and visualize real-world sensor data on interactive maps.

Joram van der Vlist

Joram is a GIS developer specializing in cloud-native and web-based geographic solutions.

Get the best
Geo content delivered to your inbox every week

Joram van der Vlist

Joram is a GIS developer specializing in cloud-native and web-based geographic solutions.

Get the best
Geo content delivered to your inbox every week

Joram van der Vlist

Joram is a GIS developer specializing in cloud-native and web-based geographic solutions.

Get the best
Geo content delivered to your inbox every week

FAQs on IoT and Geo-ICT

More and more geographic data is being collected in real time using sensors rather than manually. This enables organizations to respond more quickly to changes and ensures they always have access to up-to-date geographic information.

IoT sensors collect data such as temperature, water levels, air quality, and GPS locations. GIS uses this data to analyze it spatially and visualize it on maps, revealing patterns and trends.

Geo-IoT is used in areas such as water management, infrastructure, agriculture, environmental monitoring, smart cities, and asset management. In all of these sectors, real-time sensor data helps monitor and manage objects and the environment.

More and more GIS projects are using live sensor data. By understanding how this data is collected, transmitted, and processed, GIS professionals can develop and manage comprehensive Geo-IoT solutions.

A basic understanding of programming is a major advantage. Using simple languages such as C++, you can control sensors, collect data, and automatically send it to GIS platforms, web maps, or databases. This gives you greater control over the entire data chain.