← Back to All Weeks
Week08

Week 8: Electronics Production

From a board layout to a working assembly

I prepared the PCB artwork, generated toolpaths, milled the copper board on a CNC 3018 and soldered the components. I then used an LDR-to-LED program to exercise the input and output connections. The circuit design and archived KiCad revisions are described in Electronics Design.

Group assignment: production rules

Our group work concerns the limits of the in-house PCB process and the preparation of files for an external board house. For milling, we relate trace widths and clearances to the cutter and inspect the result for copper bridges and damaged traces. For board-house preparation, we check the fabrication layers and their alignment in the order preview.

The shared workflow is on our group assignment page. Our measured design rules and checked board-house outputs need to remain connected to the actual test board and fabrication revision.

Exporting artwork and generating toolpaths

In KiCad, I plotted Front Copper and Edge.Cuts as SVG. Copper isolation and the board outline are separate operations, so their files and toolpaths need to be identified clearly. In Mods, I selected the G-code Mill 2D PCB workflow, loaded the SVG and used inversion to select the correct area to remove.

I entered a 0.3 mm V-bit tip diameter and four offsets, calculated the paths and inspected the result. With a V-bit, the cutting width also depends on depth, so the tip setting is not a measured isolation width.

Selecting the KiCad plot layers
Selecting the KiCad plot layers
Exporting PCB artwork as SVG
Exporting PCB artwork as SVG
Selecting the Mods PCB-milling workflow
Selecting the Mods PCB-milling workflow
Opening the G-code workflow
Opening the G-code workflow
Importing the SVG artwork
Importing the SVG artwork
Inverting the milling image
Inverting the milling image
Setting the V-bit tip diameter
Setting the V-bit tip diameter
Reviewing the generated paths
Reviewing the generated paths
The isolation-path preview
The isolation-path preview
Inspecting the toolpath view
Inspecting the toolpath view

Milling and soldering

I loaded the generated G-code into Candle and fixed the copper board to the CNC bed with double-sided tape. The board needs to lie flat because a small height change affects the depth and width of isolation cuts. After milling, I soldered the components onto the pads. The photographs show the progression from stock to milled board and assembled circuit.

Applying double-sided tape
Applying double-sided tape
Securing the copper board on the bed
Securing the copper board on the bed
PCB milling in progress
PCB milling in progress
The milled copper board
The milled copper board
Soldering the components
Soldering the components
Soldering the board connections
Soldering the board connections
Continuing the solder assembly
Continuing the solder assembly
The assembled board
The assembled board

LDR and LED test program

The program samples the LDR input on A0 and prints the raw reading at 115200 baud. It compares that reading with a threshold of 20: below the threshold it drives the LED on D1 high; otherwise it drives D1 low. The 300 ms delay spaces the samples. This is a sensor-controlled output rather than a timed blink.

I transcribed the program visible in the original screenshot with Codex assistance, because the older linked download contains a different serial-control sketch. The recovered source preserves the photographed pins, threshold, baud rate and delay.

// Transcribed with Codex assistance from images/week08/codeinarduino.png.
// This recovers the photographed logic; it does not invent sensor measurements.
#include <Arduino.h>
#define LDR_PIN A0
#define LED_PIN D1
int threshold = 20;

void setup() {
  pinMode(LED_PIN, OUTPUT);
  Serial.begin(115200);
}

void loop() {
  int lightValue = analogRead(LDR_PIN);
  Serial.println(lightValue);
  // DARK -> LED ON, as written in the photographed program.
  if (threshold > lightValue) digitalWrite(LED_PIN, HIGH);
  else digitalWrite(LED_PIN, LOW);
  delay(300);
}
The LDR and LED test sketch
The LDR and LED test sketch
Recorded board input/output test
A second recording of the board test

The recordings show the board test. The actual light and dark readings, and the reason for choosing 20, still need to be recorded before that threshold can be treated as a calibrated setting.

Results and source files

The fabrication record connects the artwork, milling, soldering and a program that uses both an input and an output. For a repeat build, I need the exact board revision, tool setup and sensor readings together; a successful LED response alone does not characterize the whole milling process.

The linked G-code is the archived cut file, not a complete set of all isolation and outline operations. The project-settings file is retained here; the matching archived schematic and PCB layout are available in Week 6.

Preparing the next board run

The recovered LDR source builds for the XIAO RP2040 with Arduino-Pico 4.5.3. This is a software check. I still need the actual light and dark readings and a comparison between the schematic, copper and assembled LED polarity. The source-file observations are in my electronics-design record.

Before another milling job I will identify the board revision, check isolation and outline files separately, and record the actual tool depth and origin. With the machine powered down, a continuity check between supply and ground and along each intended net comes before programming. An observed input/output response can then be tied to that exact board and sketch, rather than to an unrelated download.