Week 04 — Embedded Programming

Fab Academy 2026 · XIAO ESP32-C3 · Industrial FabLab UCuenca

Background

In this individual assignment, the objective is to understand the core principles of embedded programming through hands-on experimentation using the XIAO ESP32-C3.

This board is based on the ESP32-C3 microcontroller, featuring a RISC-V architecture, integrated Wi-Fi and BLE communication, and low power consumption. Its compact format makes it ideal for prototyping, IoT experimentation, and educational development in digital fabrication environments.

The practice focuses on controlling a digital output (LED) and parameterizing its blinking behavior within a simulation environment before implementing it physically. This approach aligns with iterative prototyping methodologies used in Fab Academy, where simulation reduces errors prior to hardware deployment.

Objective

Arduino IDE — Development Environment

The programming environment used for this assignment was Arduino IDE, which allows development, compilation, and uploading of firmware to ESP32-based boards.

Installation and Setup Steps:

  1. Download and install Arduino IDE.
  2. Open Preferences.
  3. Add the ESP32 board manager URL.
  4. Open Boards Manager and install ESP32 package.
  5. Select board: XIAO ESP32-C3.
  6. Select correct COM port.
  7. Verify that compilation completes without errors.

Wokwi — Online Simulation

Before physical implementation, the circuit was tested using Wokwi, an online simulator that supports ESP32 microcontrollers.

Simulation Steps:

  1. Open Wokwi platform.
  2. Select ESP32 board model.
  3. Add LED component.
  4. Add resistor (220Ω).
  5. Connect GPIO 3 → LED → Resistor → GND.
  6. Paste Arduino code.
  7. Run simulation.

Electronic Configuration

Components used:

  • XIAO ESP32-C3
  • 1 LED
  • 220Ω resistor
  • Jumper wires

Connection Logic:

GPIO 3 → LED Anode
LED Cathode → 220Ω resistor
Resistor → GND

Parameterized Code Structure

Instead of using fixed delays, timing variables were defined to allow flexible control of LED behavior.


// Parameter definition
const int ledPin = 3;
int onTime = 1000;
int offTime = 1000;

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

void loop() {
  digitalWrite(ledPin, HIGH);
  delay(onTime);

  digitalWrite(ledPin, LOW);
  delay(offTime);
}

Upload and Testing Results

ON (ms) OFF (ms) Result
1000 1000 Standard blink
500 500 Fast blink
2000 500 Long ON pulse

Hero Shot

Final result of LED blinking controlled by parameterized code.

Physical Assembly on Breadboard

  1. Insert XIAO ESP32-C3 into breadboard.
  2. Connect GPIO 3 to LED anode.
  3. Connect LED cathode to 220Ω resistor.
  4. Connect resistor to GND rail.
  5. Connect USB cable for power and programming.
  6. Upload final tested code.

Conclusion

This individual assignment successfully demonstrated the fundamentals of digital output programming using the XIAO ESP32-C3.

By integrating Arduino IDE for development and Wokwi for simulation, a complete iterative workflow was established:

Simulation → Validation → Upload → Physical Implementation

The use of parameterized variables improved flexibility and scalability of the code.

This practice strengthens understanding of GPIO configuration, embedded logic, simulation validation, microcontroller programming workflow, and hardware-software interaction.

Final Checklist

◁ Back to Home