Electronics Production
Overview This week's focus was on the fabrication of a printed circuit board (PCB) and the soldering of electronic components onto it. The goal was to design, mill, assemble, and test a functional microcontroller-based circuit using tools and techniques commonly applied in rapid prototyping environments.

PCB Design with KiCad

Electronic Components Used
The following components were selected and included in the PCB design:
  1. Seeed XIAO RP2040 – the main microcontroller used in the board.
  2. Resistors × 2 – current-limiting resistors, one for the LED and another for the button input.
  3. LED – indicator that lights up when the button is pressed.
  4. Push Button – used for input control to test functionality.
  5. Pin Headers – for connecting external modules or for programming the microcontroller.


Generating Gerber Files in KiCad
After completing the PCB layout, the next step was to generate the Gerber files required for fabrication. These files define the copper traces and board outline for the milling machine.
Steps to Generate Gerber Files:
  1. Open the PCB layout in KiCad’s PCB Editor.
  2. Go to the menu and click on File → Plot.
  3. Select Gerber as the output format.
  4. Select the necessary layers for a single-sided board:
    • F.Cu – Front copper layer (traces).
    • Edge.Cuts – Board outline (used to cut the PCB to shape).
  5. Click Plot to generate the files.

These Gerber files are typically used for manufacturing PCBs in professional settings, but for this project, they were converted to SVG format for CNC milling.

Generating G-code Files with MODS
To mill the PCB on a desktop CNC machine, the Gerber files were converted into SVG files using the online tool MODS.
Steps to Create G-code Files from Gerber:

Set Tool Parameters:

Milling the Circuit Board
The G-code file was then imported into the OpenBuilds Control CAM software, which interfaces with the CNC milling machine to execute the board fabrication.
Steps to mill
The visualization of the circuit board is to confirm that all traces are well marked before milling.


Final PCB Output
Here are images of the PCB immediately after milling, before and after soldering the components:
Milled PCB (Before Soldering)


Assembled PCB (After Soldering)

Testing the Circuit

To verify the functionality of the board:
The microcontroller was powered via USB.
When the push button was pressed, the LED successfully turned on, indicating proper connectivity and soldering.
The bellow code used to program microcontroller testing:
  #define BUTTON_PIN 12
  #define LED_PIN 13 //the XIAO RP2040 LED pin is connected to Pin 13
  
  void setup() {
    pinMode(BUTTON_PIN, INPUT_PULLUP);
    pinMode(LED_PIN, OUTPUT);
  }
  
  void loop() {
    if (digitalRead(BUTTON_PIN) == LOW) {
      digitalWrite(LED_PIN, HIGH);
    } else {
      digitalWrite(LED_PIN, LOW);
    }
  }



Test Video


Design files
Schematic
PCB
SVG Gerber
PCB Cut F.cu