8. Electronics Production

Overview

This week focused on electronics production, taking a previously designed PCB from digital design through physical fabrication, assembly, programming, and functional testing.

For the group assignment, I characterized the design rules of the Roland SRM-20 milling machine by evaluating trace widths and clearances. I also explored the workflow for preparing and submitting PCB fabrication files to a commercial boardhouse.

For my individual assignment, I manufactured and tested a custom PCB using the Seeed Studio XIAO RP2040. This board serves as a prototype for the haptic feedback wristband associated with my Fabricademy final project, integrating a Velostat pressure sensor and a vibration motor.

The production process included exporting fabrication files from KiCad, preparing SVG files in Inkscape, generating toolpaths in Mods CE, milling the PCB, soldering components, checking electrical continuity, and programming and testing the assembled board using Arduino IDE.

Through this assignment, I gained a better understanding of how PCB design decisions, machine capabilities, and fabrication tolerances directly affect the functionality and reliability of electronic circuits.

Group Assignment

Individual Assignment

Reference: Fab Academy 2026 Electronics Production Assignment and Assessment Requirements.

Research & Group Assignment

As I continue developing my Fabricademy final project alongside Fab Academy, I am exploring how textile-based sensors, embedded electronics, and digital fabrication can be integrated into wearable technology. This week's assignment supports the development of my haptic feedback wristband prototype through the production of a custom PCB.

For the group assignment, I independently completed the PCB design rule characterization using the Roland SRM-20 milling machine. This involved milling a test pattern to evaluate trace widths, clearances, and the reliability of electrical isolation between conductive features.

The results helped me understand the physical limitations of the milling process and establish appropriate design rules for producing reliable PCBs in-house.

Additional documentation is available on the UNC Charlotte Week 08 Group Assignment page.

SRM-20 Minumum Feature Size

Test Pattern: Trace Widths and Clearances

To characterize the fabrication capabilities of the Roland SRM-20, I used a test pattern available through the EasyTrace5000 platform. Ricardo Marques assisted me in understanding the platform, its use with the SRM-20, and the importance of testing fabrication tolerances before producing a PCB.

The purpose of this test was to determine the minimum reliable spacing between conductive copper features. Insufficient clearance can result in copper bridges, electrical shorts, and unreliable PCB performance.

Clearance Test Results

Clearance (mm) Observed Result Reliability
0.8 Clean isolation with wide channels Reliable
0.6 Clean isolation Reliable
0.4 Clean isolation Minimum reliable clearance
0.3 Partial copper bridging in 2 of 5 runs Inconsistent
0.2 Copper bridging in every run Unreliable
Completed SRM 20 Milled Test Pattern

Trace Width Observations

During the fabrication of my individual PCB, I also found that 0.2 mm traces were too thin for reliable production. I subsequently increased the trace width to 0.3 mm during SVG preparation in Inkscape.

Design Rules and Conclusions

Based on my testing, clearances below 0.4 mm produced inconsistent results, particularly near the edges of the board. These observations informed the following design rules for subsequent in-house PCB production:

These values reflect my fabrication experience with the SRM-20 rather than the universal limitations of the machine. In subsequent KiCad projects, I intend to configure these values in the board design rules and perform a Design Rule Check (DRC) before exporting fabrication files.

This exercise demonstrated the importance of incorporating manufacturing tolerances into the PCB design process rather than correcting fabrication defects after milling.

Workflow for Sending Files to Mill

PCB Fabrication File Preparation

The file preparation process depends on whether the PCB will be manufactured in-house using the SRM-20 or commercially through a PCB boardhouse.

In-House PCB Milling

  1. Open the completed PCB layout in KiCad.
  2. Run a Design Rule Check (DRC) using the selected fabrication tolerances.
  3. Navigate to File > Plot and select SVG as the output format.
  4. Export the front copper (F.Cu) and board outline (Edge.Cuts) as separate SVG files.
  5. Import the files into Mods CE to generate the trace and outline milling toolpaths.
  6. Export the RML files for production using Roland VPanel and the SRM-20.

Commercial PCB Manufacturing

Commercial PCB manufacturers require Gerber and drill files rather than the SVG files used in my in-house milling workflow.

  1. Open the completed PCB layout in KiCad.
  2. Navigate to File > Fabrication Outputs > Gerbers.
  3. Select the applicable copper, solder mask, silkscreen, and board outline layers.
  4. Generate the Gerber and drill files.
  5. Combine the fabrication files into a ZIP archive using a compression tool such as 7-Zip.
  6. Upload the ZIP archive to a commercial PCB manufacturer such as JLCPCB.
  7. Review the board preview and configure the manufacturing options, including board thickness, copper weight, solder mask color, and quantity.
  8. Review the quotation, manufacturing lead time, and shipping costs before submitting the order.

Our group assignment documents the commercial fabrication workflow using JLCPCB, including Gerber export, file upload, board configuration, rendering, and quotation.

View the complete group boardhouse workflow and supporting images.

Group Assignment Reflection

This assignment helped me understand the importance of designing PCBs according to the capabilities of the intended manufacturing process. In-house milling allows for rapid prototyping and immediate design adjustments, while commercial fabrication provides additional manufacturing options and supports larger production quantities. Understanding both workflows will help me select the appropriate manufacturing method for future projects.

Individual Work

Board Design and Purpose

During Week 04 (Embedded Programming), I designed a custom PCB in KiCad as a prototype for the haptic feedback wristband associated with my Fabricademy final project. The board integrates a Seeed Studio XIAO RP2040, a textile-based pressure sensor, and a vibration motor.

For Week 08, I focused on manufacturing the previously designed board, assembling the electronic components, and verifying its functionality through programming and physical testing.

The board is intended to demonstrate how a wearable device can communicate with a computer while providing haptic feedback to the user.

Original KiCad Schematic Original PCB Layout

Board Functionality

Microcontroller Pin Assignments

Pin Component Function
A0 / D0 Velostat pressure sensor Analog input
D2 AO3400 MOSFET Digital motor control output
GND Circuit ground Common electrical reference
USB-C Computer connection Power, programming, and serial communication

Future Development

In future iterations of the wearable prototype, I intend to transition from the XIAO RP2040 to the XIAO nRF52840 to support Bluetooth Low Energy (BLE) communication. The similar physical form factor of the two microcontrollers provides an opportunity to retain much of the existing circuit design while adapting the firmware for wireless communication.

The MOSFET switching circuit, flyback diode, and motor connection are intended to carry forward into the next iteration, subject to electrical compatibility and further testing.

Bill of Materials

The following components were selected for the production and assembly of the haptic feedback wristband prototype.

Component Part / Specification Function Quantity
Microcontroller Seeed Studio XIAO RP2040 Sensor processing, motor control, and serial communication 1
N-channel MOSFET AO3400 Switches the vibration motor 1
Flyback diode 1N4148W Protects the switching circuit from inductive voltage spikes 1
Resistor 100 Ω MOSFET gate resistor 1
Motor connector 2-pin, 2.54 mm header Connection between the PCB and vibration motor 1
DC coreless vibration motor 3 V nominal, 1–6 V operating range, 70 mA maximum Provides haptic feedback 1
Tactile push buttons Momentary switches Original physical input components 2
Textile pressure sensor Velostat and conductive fabric Pressure-sensitive input for the wearable prototype 1

The original design included tactile push buttons. During prototype development, I transitioned to a handmade Velostat pressure sensor to better support the textile-based interaction required for my Fabricademy project.

Why Use a MOSFET?

The vibration motor requires more current than the GPIO pin of the XIAO RP2040 can safely supply. To address this, I selected an AO3400 N-channel MOSFET to act as an electronically controlled switch, allowing the microcontroller to control the motor without directly supplying its operating current.

AO3400 MOSFET Operation

The gate threshold voltage represents the point at which the MOSFET begins conducting, rather than the voltage required for reliable switching. Selecting a MOSFET suitable for 3.3 V logic helps reduce resistance, power loss, and heat generation during operation.

Supporting Circuit Components

Component Purpose
AO3400 MOSFET Controls the current flowing through the vibration motor.
100 Ω Gate Resistor Limits transient current during gate charging and discharging and helps reduce switching oscillations.
1N4148W Flyback Diode Provides a path for the motor's inductive current when the MOSFET switches off, helping protect the switching circuit from voltage spikes.
Common Ground Provides a shared electrical reference between the microcontroller and motor switching circuit.

This configuration allows the vibration motor to be controlled through firmware while reducing the electrical load on the microcontroller's GPIO pin. It also provides a foundation for implementing programmable haptic feedback patterns in future iterations of the wearable device.

Why use Mosfet?

The XIAO RP2040's GPIO pins are rated for 12mA maximum. The vibration motor draws up to 70mA. The AO3400 (gate threshold ~1V, rated 5.7A) lets a 3.3V GPIO signal switch the full motor current without touching the microcontroller's output stage.

MODS CE: Generating Toolpaths

Export SVGs from KiCad

I exported two separate SVG files from File: Plot, format set to SVG, output mode black and white, mirror unchecked. When I milled this board I had not run 0.4mm DRC minimum clearance before plotting. This was an issued when I milled the board because I had to manually clear the copper. This is the lesson from the design rules characterisation I ran earlier this week.

Inkscape Workflow

I used Inkscape to inspect and adjust the exported SVG files before generating the milling toolpaths. This follows a workflow I originally learned in 2023 for preparing PCB fabrication files.

  1. Open the front copper and board outline SVG files in Inkscape.
  2. Inspect the connections between traces and component pads for unintended gaps.
  3. Use the Path > Union operation where appropriate to combine overlapping conductive shapes.
  4. Increase the trace width from 0.2 mm to 0.3 mm after observing that the original traces were too thin during fabrication.
  5. Overlay the board outline and copper traces to inspect their alignment and the spacing between the outermost traces and board perimeter.
  6. Save the combined SVG for reference.
  7. Hide the copper traces and save the board outline as a separate SVG for the outline milling operation.
Inkscape PCB traces with adjusted trace widths

Although Inkscape allowed me to make immediate fabrication adjustments, future corrections to trace widths and clearances should be made directly in KiCad. This ensures that the original PCB design remains consistent with the manufactured board and can be validated using the Design Rule Check (DRC) before fabrication.

Mods CE trace pass settings

I used Google Chrome to access Mods CE after experiencing inconsistent behavior with the toolpath simulation in my previous browser. Chrome allowed me to calculate and preview the toolpaths more reliably.

Within Mods CE, I selected the Roland SRM-20 machine and the 2D PCB milling program. I generated two separate toolpaths: one for copper isolation milling and another for cutting the board outline.

Trace Pass Settings

The trace pass removes copper around the conductive traces and component pads, creating electrical isolation between features.

Setting Parameter
Tool 1/64 inch flat end mill
Tool Diameter 0.3969 mm
Cut Depth 0.1 mm
Maximum Depth 0.1 mm
Offset Number 4
Feed Rate 4 mm/s
X/Y/Z Origin 0, 0, 0
Mods CE images pass settings

After importing the SVG containing the copper traces, I entered the milling parameters and calculated the toolpath. I reviewed the simulation to inspect the isolation paths around the traces and component pads before exporting the RML file for use in Roland VPanel.

Mods CE outline pass settings

The outline pass cuts through the PCB substrate to separate the finished board from the remaining copper-clad material. For this operation, I used a larger end mill and increased the cutting depth.

Setting Parameter
Tool 1/32 inch flat end mill
Tool Diameter 0.7938 mm
Cut Depth 0.6 mm per pass
Maximum Depth 1.8 mm
Offset Number 1
Feed Rate 2 mm/s
X/Y/Z Origin 0, 0, 0

The maximum depth of 1.8 mm and cutting depth of 0.6 mm resulted in three cutting passes. After calculating and reviewing the outline toolpath, I exported the second RML file.

Both operations used the same X and Y origin to maintain alignment between the copper traces and the board outline. The Z origin was reset after changing the milling tool.

Mods CE images

PCB Milling: Roland SRM-20

Material Preparation and Machine Setup

Before milling, I prepared the SRM-20 and secured the copper-clad board to prevent movement during fabrication.

  1. Secure the sacrificial wax layer to the SRM-20 milling bed.
  2. Apply two layers of double-sided tape across the copper-clad board and press it firmly onto the sacrificial surface.
  3. Install the 1/64-inch flat end mill for the trace milling operation.
  4. Open Roland VPanel and position the tool over the desired starting location.
  5. Set the X and Y origins.
  6. Set the Z origin using the paper method, gradually lowering the tool until slight resistance is felt when moving the paper beneath it.

Accurate Z positioning is particularly important because the trace milling operation uses a cutting depth of only 0.1 mm. Incorrect positioning can result in incomplete copper removal or excessive cutting into the substrate.

Pre-Soldering Continuity Check

Before soldering any components, I tested the bare PCB using my Mastech MS8217 digital multimeter in continuity mode. Performing this check before assembly allowed me to identify fabrication defects while the copper traces were still accessible.

The purpose of continuity testing was to verify that intended electrical connections were continuous and that adjacent traces and pads were electrically isolated where required.

Identifying and Correcting a Copper Bridge

During testing, I identified an unintended copper bridge caused by insufficient clearance between conductive features. Although the board initially appeared clean after milling, the continuity check revealed an electrical connection that should not have been present.

I used an X-Acto knife to carefully remove the remaining copper and restore electrical isolation between the affected features.

This issue reinforced the importance of applying the minimum clearance established during the group assignment and performing a Design Rule Check in KiCad before generating fabrication files.

Continuity testing is an important quality control step because visual inspection alone may not reveal every electrical short or disconnected trace.

Soldering and Assembly

Surface Preparation

Before assembling the PCB, I cleaned the copper surface with isopropyl alcohol to remove residue and contaminants from the milling process. I applied flux to each pad immediately before soldering to improve solder flow and adhesion.

Soldering Order

I set the soldering iron to 350 °C and began with the smaller surface-mounted components before moving on to the larger components and connectors. This order provided easier access to the individual solder pads during assembly.

  1. 1N4148W flyback diode
  2. AO3400 N-channel MOSFET
  3. 100 Ω gate resistor
  4. 2-pin motor connector header
  5. Tactile push buttons
  6. Seeed Studio XIAO RP2040
  7. DC coreless vibration motor connection

Component orientation was particularly important for the flyback diode, MOSFET, and microcontroller. Incorrect orientation could prevent the circuit from functioning or damage components when power was applied.

Components on Board

After completing the component assembly, I connected the vibration motor through the two-pin header. The board was then ready for programming and functional testing.

During subsequent development, I incorporated the handmade Velostat pressure sensor as the input device to better support the textile-based interaction required for my wearable prototype.

Motor Troubleshooting

During initial functional testing, I encountered an issue with the vibration motor. Rather than immediately replacing components or modifying the firmware, I followed a systematic troubleshooting process to isolate the source of the problem.

Diagnostic Step Purpose
Check MOSFET gate voltage Determine whether the microcontroller is providing the switching signal.
Check MOSFET drain voltage Evaluate the operation of the motor switching circuit.
Test the motor independently Determine whether the motor itself is functioning.
Inspect the motor connector Identify potential electrical contact issues between the motor and PCB.

Problem Identified and Resolution

Using this diagnostic process, I identified a contact reliability issue with the motor connector in under five minutes. After addressing the connection issue, I was able to proceed with successful motor operation and functional testing.

Future Improvements

For future PCB revisions, I would replace the two-pin motor header with a screw terminal to provide a more secure electrical connection. I would also fabricate a second board incorporating the necessary design corrections rather than continuing to accumulate manual repairs on the original prototype.

This experience reinforced the importance of systematically isolating hardware problems before replacing components or making unnecessary changes to firmware.

Programming and Testing

Toolchain Setup

I used Arduino IDE to program and test the completed PCB. For the XIAO RP2040, I installed the Raspberry Pi Pico/RP2040/RP2350 board package by Earle Philhower through the Arduino Boards Manager.

Setting Configuration
Development Environment Arduino IDE
Board Package Raspberry Pi Pico/RP2040/RP2350
Package Version 5.6.0
Selected Board Seeed XIAO RP2040
Serial Port COM6
Baud Rate 115200

Board package installation URL:

RP2040 Arduino Board Package

I chose Arduino IDE over CircuitPython to maintain a consistent development workflow as I transition toward the XIAO nRF52840 for my final project. Arduino provides access to the BLE, SD card, and display libraries that I intend to use in subsequent development.

Firmware Development

The initial sketch structure was developed during my Week 04 documentation process and subsequently modified and tested on the fabricated PCB.

My modifications included:

The firmware was uploaded to the XIAO RP2040 through its USB-C connection and verified using the Arduino Serial Monitor.

Source Code

  // ─────────────────────────────────────────────────────────────
  // Fab Academy Week 8 — Electronics Production
  // Board: Seeed Studio XIAO RP2040 (custom milled PCB)
  // Input: Velostat fabric pressure sensor on A0
  // Output: DC coreless vibration motor via AO3400 MOSFET on D2
  // Communication: Bidirectional USB serial at 115200 baud
  // ─────────────────────────────────────────────────────────────
   
  const int buttonPin = A0;  // velostat pressure sensor — analog input
  const int motorPin  = D2;  // MOSFET gate — digital output
   
  // Threshold calibrated from live Serial Monitor testing:
  // At rest:  sensor reads 100–200 (high resistance, no pressure)
  // Pressed:  sensor reads as low as 5 (low resistance, pressure applied)
  // Threshold set to 20 — clean separation, ignores accidental contact
  int threshold = 20;
   
  void setup() {
    Serial.begin(115200);
    pinMode(motorPin, OUTPUT);
    digitalWrite(motorPin, LOW);
    Serial.println("Week 8 ready");
  }
   
  void loop() {
    // Read analog pressure value from velostat sensor
    int pressure = analogRead(buttonPin);
    Serial.println(pressure);  // live telemetry for monitoring and calibration
   
    // Measured analog value decreases when pressure is applied
    // Trigger when value drops below threshold
    if (pressure < threshold) {
      Serial.println("NEXT");   // signal to computer application
      pulseMotor();             // haptic confirmation
      delay(1000); // limit repeated activation frequency
    }
   
    // Listen for incoming serial command from computer
    if (Serial.available()) {
      String cmd = Serial.readStringUntil('\n');
      cmd.trim();
      if (cmd == "MOTOR_ON") {
        pulseMotor();
        Serial.println("MOTOR_DONE");  // confirm completion to computer
      }
    }
   
    delay(50);  // 50ms loop tick
  }
   
  // Motor pulse function — fires motor for 500ms
  void pulseMotor() {
    digitalWrite(motorPin, HIGH);
    delay(500);
    digitalWrite(motorPin, LOW);
  }
  

Firmware Operation

The firmware continuously monitors the analog pressure sensor and compares its measured value against a calibrated threshold of 20.

When the reading falls below the threshold, the board sends NEXT through USB serial communication and activates the vibration motor for 500 milliseconds. A one-second delay limits the frequency of repeated activations.

The firmware also listens for incoming serial commands. When MOTOR_ON is received, the board activates the motor and returns MOTOR_DONE after completing the pulse.

The current firmware successfully demonstrates sensor input, actuator output, and bidirectional communication. A future improvement would be to implement state-change detection so that holding the sensor does not repeatedly trigger the motor.

Pressure Sensor Calibration

To calibrate the handmade Velostat pressure sensor, I opened the Arduino Serial Monitor at 115200 baud and observed the analog readings under different pressure conditions.

As pressure was applied, the resistance of the Velostat decreased, resulting in lower analog readings in my circuit configuration. I used these observations to establish a threshold that distinguished intentional activation from the resting state.

Sensor Condition Analog Reading Observed Result
At rest (no pressure) 100–200 No activation
Firm pressure applied 5–15 NEXT command transmitted and motor activated
Selected threshold 20 Clear separation between resting and pressed states

Based on these results, I selected a threshold of 20. When the measured analog value falls below this threshold, the firmware activates the motor and transmits the NEXT command.

Bidirectional Communication Test

To verify the functionality of the assembled PCB, I tested communication in both directions between the microcontroller and the computer.

Board-to-Computer Communication

When I pressed the Velostat sensor, the microcontroller transmitted NEXT to the Arduino Serial Monitor and activated the vibration motor for 500 milliseconds. Both outputs were successfully confirmed during testing.

Computer-to-Board Communication

I entered MOTOR_ON into the Arduino Serial Monitor and transmitted the command to the microcontroller. The motor activated for 500 milliseconds, after which the microcontroller returned MOTOR_DONE to confirm completion.

During testing, I discovered that the command was case-sensitive. Entering the command in uppercase resolved the communication issue.

Serial Monitor Output

The following excerpt illustrates the sensor readings and serial commands observed during functional testing.


  ─── Arduino Serial Monitor — 115200 baud ────────────────────────
  Week 8 ready
  187
  192
  178
  ...
  5          ← velostat pressed
  NEXT       ← board sends to computer
  ...
             ← MOTOR_ON typed and sent from computer
  MOTOR_DONE ← board confirms motor pulse completed
  

Functional Test Results

Test Result
Analog pressure sensor input Pass
Pressure threshold calibration Pass
MOSFET-controlled motor activation Pass
Board-to-computer communication Pass
Computer-to-board communication Pass

These results confirmed that the fabricated PCB successfully demonstrated sensor input, actuator output, and bidirectional communication, meeting the intended functionality of the wearable prototype.

Final Results

I successfully manufactured, assembled, programmed, and tested my custom XIAO RP2040 development board using the Roland SRM-20. The completed PCB demonstrated analog sensor input, MOSFET-controlled motor activation, and bidirectional USB serial communication.

The fabricated board serves as a functional electronics prototype for the haptic feedback wristband associated with my Fabricademy final project.

Reflection

Reflection

This assignment strengthened my understanding of the relationship between electronics design and physical manufacturing. Although a circuit may appear correct in KiCad, fabrication tolerances, trace widths, component placement, and connection reliability directly influence the performance of the finished board.

One of my most significant lessons was the importance of establishing and applying fabrication design rules before generating toolpaths. The copper bridge encountered during production demonstrated how insufficient clearance can introduce electrical faults that may not be immediately visible.

I also gained confidence in systematic hardware troubleshooting. By checking the MOSFET, independently testing the motor, and inspecting its connection, I was able to isolate the problem without unnecessarily replacing components or modifying the firmware.

Future Improvements

Overall, this assignment allowed me to complete the transition from a digital PCB design to a functional physical electronic system. The experience will inform future PCB development for both my Fab Academy and Fabricademy projects.

Files

File Description
Wearable Wristband — Inkscape Traces IDE Code - Motor controller for SEEED Xiao RP2040