HTMAA course site

75 Amherst St, Cambridge, MA 02139

About

Name ---------- Daniel Harianto
Work ---------- Web Portfolio
Media --------- @danielharianto_
AffiliationMS, Architectural Studies - SMArchSMassachusetts Institute of Technology

** Open a selected work **
or visit the web portfolio

I explore how design and computation can make relationships between people, space, and complex systems more visible, legible, and actionable.

QR code

** Thank you and please come again **

Week 04

Electronics Design

10/07/26
Week 04 hero image

TLDR

I designed two circuits around Seeed Studio XIAO boards. First, I tested an LED circuit controlled by a push button with the XIAO RP2040 on a breadboard, then drew its schematic and laid out its board in KiCad.

Next, toward my final project, I built a circuit with the XIAO ESP32-S3 that drives two servo motors and took it from the breadboard to a single-sided PCB layout. These servos are the first step toward moving the modular bot from Week 03.

LED Circuit

Breadboard Prototype

I started by testing the circuit on a breadboard with the XIAO RP2040, three LEDs (yellow, green, and red), each with a current-limiting resistor, and a tactile push button. Pressing the button lights the LEDs, which confirmed the wiring and pin assignments before I moved into KiCad.

LED circuit on a breadboard with the XIAO RP2040 and a push button

Schematic (KiCad)

In the KiCad Schematic Editor, I placed the XIAO RP2040 module (M1) and extended the circuit to five LEDs (D1–D5). Each LED connects to its own pin, D6 to D10, through a 1 kΩ resistor (R1–R5), and all the cathodes return to GND. The push button (SW2) connects D1 to GND, so the pin reads low when pressed. I added a PWR_FLAG to the ground net so the electrical rules check knows it is driven, and marked the unused pins with no-connect flags.

KiCad schematic of the LED circuit with five LEDs and a push button

PCB Layout (KiCad)

I then updated the PCB from the schematic and arranged the footprints in the PCB Editor, placing the resistor and LED pairs in a row below the XIAO and routing each signal to its pin, then checked the result in the KiCad 3D Viewer.

Servo Motor Circuit

Breadboard Prototype

To make the bot modules move on their own, I prototyped a circuit that drives two micro servo motors from a Seeed Studio XIAO ESP32-S3. The servos take power from the 5V pin and their PWM signals from two GPIO pins. A push button triggers the motion and an LED shows the state. I chose the ESP32-S3 because its built-in Wi-Fi and Bluetooth will later let the modules communicate wirelessly.

Two servo motors wired to the XIAO ESP32-S3 on a breadboard

Schematic (KiCad)

I redrew the prototype as a schematic in KiCad. For the microcontroller (M1), I used the XIAO RP2040 symbol and footprint from the library, because the XIAO ESP32-S3 has the same size and the same pin positions for D0–D10, 5V, and GND, so the board fits either module. D1 and D2 send PWM signals to the two servos (M2 and M3). D3 reads the push button (SW1), which connects to GND, and D0 drives the status LED (D1) through a 1 kΩ resistor (R1). I added a 10 µF capacitor (C1) between 5V and GND to smooth the current spikes from the servos when they start moving, and PWR_FLAGs on the 5V and GND nets to pass the electrical rules check.

First KiCad schematic of the servo motor circuit

In the first version, the extra resistor R2 was wired incorrectly. I changed it to a 0 Ω resistor that links the servo ground to the main ground. On a single-sided board it works as a jumper, so the ground connection can cross over the signal traces without a via.

Revised KiCad schematic with R2 as a 0 ohm jumper

Design Rules (KiCad)

Before routing, I set the board constraints to suit milling: 0.4 mm minimum clearance, 0.4 mm minimum track width, and 0.5 mm copper-to-edge clearance. I also created a Power net class with 1 mm tracks and assigned the +5V and GND nets to it, so the servo current runs on wider traces, while the signal nets keep the 0.4 mm default.

KiCad Board Setup constraints and net classes

PCB Layout (KiCad)

In the PCB Editor, I placed the XIAO at the top with the LED, resistor, and button on the left and the two servo headers at the bottom edge so the cables can leave the board cleanly. I routed every connection on the front copper layer (F.Cu) only, with no vias, and used the Net Inspector to check each net's track length. The board ended up with 52 pads, 59 track segments, and no unrouted connections.

Servo board routed on the front copper layer with the Net Inspector open

I also checked the front solder mask layer (F.Mask) to confirm that the pads were exposed for soldering.

Servo board front solder mask layer

Board Outline and Ground Fill

Finally, I drew the board outline on the Edge.Cuts layer as a 37.5 mm × 41.5 mm rectangle and filled the free copper area with a ground zone. The ground fill reduces the amount of copper to mill away and gives the servos a solid return path.

Final servo board with Edge.Cuts outline and ground fill

3D View (KiCad)

I checked the finished board in the KiCad 3D Viewer to confirm the component placement, traces, and ground fill.

Reflection

Testing on the breadboard first made the KiCad work much easier, because I already knew which pins each part used. The hardest part of the layout was fitting everything on one copper layer, which meant changing the schematic itself to add the 0 Ω jumper. Setting the design rules and power net class before routing also saved me from rerouting the 5V and GND traces later.

Gert, a TA for the class, helped me review the board layout and make sure the formatting was right for exporting the Gerber files, so the design would be ready for fabrication.

Reviewing the board layout with a TA before exporting Gerber files