Electronics Production

Week 08

PCB Milling, Soldering & Programming

Group Assignment

Characterize the PCB production process at our lab.

Group Page

PCB Redesign

I had to redesign the PCB practically from scratch. The entire process and its documentation can be found in Week 06 of Electronics Design.

Daniela Barranco - Week 06

Ways to make a PCB:

  1. With the "Mono Fab" machine
  2. X Tool machine: It is mainly used for laser engraving, but it is possible to engrave with it; however, it is more complicated.
  3. Vinyl cutting: Using copper tape to trace the routes.

Note: Do not place on a metal base as it will cause a short circuit.

Software to use

Note: To access the links, click on the file type in the third column.

Software Use File Type
Gerber2PNG
  • Converts our files saved in Gerber format (downloaded from KiCad) and converts them to PNG layer by layer.
  • Tells the machine the purpose of each layer — whether it is for cutting, engraving, or drilling holes.
Website (Gerber2Png | Fablab Kerala)
Modsproject.org
  • Configure the machine's component parameters.
Website (mods CE)
VPanel for SRM-20
  • Set the origin for the "X", "Y" and "Z" axes.
Website (mods CE) Download link
Note: Licensed software that comes with the machine.
Arduino IDE 2
  • Application for programming the board.
Microsoft Store Link

1. In KiCad

Process in KiCad

Save board document

1. Save the board document

First, the board must be saved as follows: Save > Fabrication Outputs > Gerbers (.gbr)

Convert to Gerber

2. Convert to Gerber

Plot format: Gerber > Select the important layers (F. Cu and Edge. Cuts) > Select the correct folder > Plot > Save.

2. Gerber 2 PNG

Process in Gerber2PNG

1. Load the files

Select all the files you downloaded from KiCad and drag them onto the Gerber page.

2. Generate "Top Trace"

  1. Click the "Quick Setup" button and look for the "Top Trace" option, which will be used to engrave the tracks.
  2. Click "Generate PNG".
  3. Do not save yet, since other documents still need to be generated as PNG.

3. Generate "Top Cut"

  1. Repeat the steps from "Top Trace".
  2. Click on "Download all".

The following video shows the complete process carried out in Gerber2PNG:

Complete process carried out in Gerber2PNG

3. Modsproject.org

Process in Modsproject.org

a) Find a compatible machine

Click on the "Programs" section and search for our machine. In my case, under "SRM-20 Mill" select "Mill 2D PCB".

For generic machines: Mill 2D PCB

Note: The page accepts .svg or .png files.

Modsproject machine

b) Load PNG files

In the "red png" section, load our PNG files one by one.

Operation configuration

c) Configure the operation

This is not shown in the video because I forgot, but it is important to set the following values depending on the operation to be performed.

d) In the Mill raster 2D section

Operation Cut Trace
Tool diameter 1.3 mm (I used this instead of 2 mm because it wasn't cutting completely, but since I left a lot of space around my tracks, it didn't affect the result). 0.4
Offset number (how thin our tracks will be <fill) 1 4
Roland SRM-20 origins

e) Roland SRM-20 milling machine

In the "Roland SRM-20 milling machine" section, set all origins to zero.

Activate on/off

f) Activate the on/off section

Enable the on/off toggle below.

g) Calculate and download

In the "mill raster 2D" section, click the calculate button to preview the simulation and download the file.

Note: The same process is repeated for each layer — only the tool used changes.

The following video shows the process followed for the trace section. Be careful though, as some steps were skipped in the video — they are all covered in the carousel above.

Trace process in Modsproject

The following video shows the process for the Cut. However, I forgot to set all origins to zero — that is shown in the video after this one.

Cut process in Modsproject

Setting the origins in Modsproject

Cut

Preparing the copper board

  1. First, apply double-sided tape to the back of the copper board.
    Note: It must cover the entire board perfectly so it does not come loose while cutting.
Double-sided tape on the board
  1. Stick the board onto the sacrificial bed.

Mistake I made: Add extra tape on the sides where you are sure the board will not be cut, to prevent it from lifting. Halfway through the cut my board lifted and I had to pause. The board must be completely stuck to the sacrificial bed.

Sticking board to the sacrificial bed
  1. Screw the sacrificial bed into its mounting holes.
Screwing the sacrificial bed
  1. Insert the bit into the collet. Depending on what you want to do, you must use the corresponding collet and tighten it with an Allen key.

Tool order:

  • Drill
  • Trace
  • Cut
Insert bit into collet
  • Make sure the tool has enough sharpness.
  • Do not insert the tool too deep.
  • To loosen with the Allen key, turn counterclockwise; to tighten, turn clockwise.

4. V Panel SRM-20

a) Download the software

From the link in the Software table at the top of this page, download the corresponding folder for your device. In my case, since I have Windows 11, I downloaded the first folder "WIN10X64".

Download VPanel

Run the file called "SETUP64.exe"

Run SETUP64

c) Configure the "X" and "Y" axes

Using the arrow keys, move to the bottom-left corner of the board. Once there, press the Origin button "XY".

Note: With Cursor Step you can tell the tool to move faster (the "Continue" option) or slower (the "x1" option).

d) Activate the Spindle and configure the Z axis

Using the tool in the bottom-left section of V Panel, under "Spindle", press the "ON" button so the tool starts spinning. This way, when it comes down to the board, it will not lose its edge.

Once satisfied with the Z axis position, lock the origin with "Set origin point" on the Z button. Then use the arrow keys to lift the tool up along Z and stop the rotation.

How do you know the Z axis is set correctly? It should be slightly deeper than the board surface, just enough to produce a small amount of dust, but not too much.

e) Cut

Using the cut button, find the file that corresponds to the tool being used and then select "Output".

In case of emergency: If something goes wrong, press "Pause". If it can be fixed, correct the issue and resume. If not, press "Cancel".

Mistake I made: At one point the computer went into "Sleep" mode, and when I woke it back up a notification appeared. I clicked "Cancel" instead of "Retry", which closed the program along with my progress. The good news is that the program saves the previous origins, so I only had to restart the cut from where it left off.

Sleep mode error

Complete process in V Panel

f) Vacuum the dust

After each type of cut is finished, use a vacuum to remove the excess dust.

Vacuuming the dust

g) Remove the board

Then remove the board and sand the burrs on the edges so the board is left clean.

Remove and sand the board

Solder and Program

Components

Component Description / Notes KiCad Name
XIAO RP2040 Main Controller (The Brain). 3.3V logic, sufficient GPIOs for the entire project. Includes internal regulator. xiao
NEMA 17 Bipolar Stepper Motors. Typically 12–24V, 1.5–2A per coil. Requires H-bridge driver with microstepping. Pines de 4
H-Bridge TB6612 Motor Drivers. Allows DC motors to rotate in both directions and functions as a brake. Tb 67
LED Red/Green Indicators. Provides visual signals for power status and H-bridge operational state. 1206
LED Resistor Current Limiting. Prevents the LEDs from burning out. Value: 1kΩ. 1206
Buttons User Input. Tactile switches used to activate the H-bridges and control stepper motors. Tac / Switch_Tactile_CnK
Pull-up Resistor Logic Stability. 10kΩ pull-up resistor for the button inputs. 1206
Motor Connector Output Port. 4-pin connection point for the stepper motors. Pines 4
Power Connector Main Input. 2-pin entry point for Voltage and Ground power supply. Pines 2
Decoupling Cap (Driver) Noise Reduction. Absorbs electrical noise to stabilize high-frequency signals. Value: 100nF. 1206
Bulk Cap (Driver) Voltage Stabilization. Prevents voltage drops during motor startup. Value: 47–100µF. Electrolytic
Decoupling Cap (XIAO) Frequency Filtering. Prevents microcontroller resets due to electrical interference. Value: 100nF. 1206

Soldering

To solder, I first turned on the machine to a temperature between 360°–370° (which is the ideal range).

Soldering iron temperature

I then started by soldering the smallest components, which in my case were the resistors, LEDs, and the capacitor.

Soldering small components

How to solder?

I found it much easier to place the soldering iron on the component and the board for about three seconds, then bring the solder with flux (the substance inside that melts) as close as possible to the tip of the iron, so the solder does not stick to the iron's tip instead of where I want it.

I then soldered the XIAO RP2350, as it was the next largest and most cumbersome component. Finally, I added the pin headers, since they were the largest and therefore the most obstructive. The board then looked like this.

Final soldered board

In the following video, I show how I tested the board to ensure it was properly connected and that there were no potential short circuits.


The method I used was: when touching both multimeter probes together, it beeps, indicating that the parts are connected; if it doesn't beep, there is no connection (continuity).

Testing the board

This is how the multimeter should look:


Solid Works photo 1

Installing the XIAO RP2350 in Arduino IDE

To get Arduino IDE to recognize the XIAO RP2350, I asked Claude AI for help with the procedure to install the corresponding "Boards Manager".

The prompt I gave to Claude was the following:

Prompt: "I'm about to upload the code, but first I want you to help me understand how to send code to my XIAO RP2350 from the Arduino IDE interface. The board is connected to my computer via a USB-C cable."

The code it provided, which is shown in the video, is the following:

https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

All the steps I followed are shown in the video below:

Programming

To get the code for the board, I uploaded a photo of my board in the KiCad Editor to Claude and gave it the following prompt explaining my problem.

Prompt: "Hi! The photo I'm attaching is of a PCB I'm making with a XIAO RP2040. I want you to help me write the code so that one of the buttons turns on one of the LEDs, and the other button turns on the other LED when pressed.

Please make the LEDs stay on once you press the button, and turn off when you press the button again — not just stay on while the button is held down."

The code it gave me was:

// ================================
//  PCB Ochurus - XIAO RP2350
//  Toggle + Parpadeo de LEDs
// ================================

// --- Pines ---
const int LED = D8;
const int BTN = D7;

// --- Variables de estado ---
bool ledActive    = false;
bool lastBtnState = LOW;   // ← Cambiado a LOW (pull-down = LOW en reposo)

// --- Temporización del parpadeo ---
unsigned long lastBlink     = 0;
const int     blinkInterval = 500;
bool          blinkState    = false;

void setup() {
  pinMode(LED, OUTPUT);
  pinMode(BTN, INPUT_PULLDOWN);  // ← Cambiado a PULLDOWN
  digitalWrite(LED, LOW);
}

void loop() {
  bool currentBtnState = digitalRead(BTN);

  // Detecta flanco de subida (cuando se PRESIONA con pull-down)
  if (lastBtnState == LOW && currentBtnState == HIGH) {  // ← Invertido
    ledActive = !ledActive;
    if (!ledActive) {
      digitalWrite(LED, LOW);
    }
    delay(50); // Debounce
  }

  lastBtnState = currentBtnState;

  // Parpadeo sin usar delay()
  if (ledActive) {
    unsigned long now = millis();
    if (now - lastBlink >= blinkInterval) {
      blinkState = !blinkState;
      digitalWrite(LED, blinkState);
      lastBlink = now;
    }
  }
}

Once I had the code, I connected the XIAO to my computer with a USB-C cable, then:

  1. Select the correct port.
  2. Once I had the code, I connected the XIAO to my computer with a USB-C cable.
  3. I clicked "Verify".
  4. Select "Upload".
Upload code in Arduino IDE

This is how the board looks in the end:

If you're Gen Z, you know the OCHURUS reference! 🐭

Files I used this week

01_KICAD_FILES.ZIP

KiCad Project Files

Files:

  • fp-info-cache
  • PLACA MODIFICADA.kicad_pcb
  • PLACA MODIFICADA.kicad_prl
  • PLACA MODIFICADA.kicad_pro
  • PLACA MODIFICADA.kicad_sch
  • PLACA MODIFICADA_Step
Download

02_GERBER.ZIP

Gerber Manufacturing Files

Files:

  • PLACA MODIFICADA-Edge_Cuts.gbr
  • PLACA MODIFICADA-F_Cu.gbr
  • PLACA MODIFICADA-job.gbrjob
  • PLACA MODIFICADA-NPTH.drl
  • PLACA MODIFICADA-NPTH-drl_map
  • PLACA MODIFICADA-PTH.drl
  • PLACA MODIFICADA-PTH-drl_map
Download

03_MODSPROJECTS.ZIP

Mods Production Files (RML)

Files:

  • outline_top_layer_1.png (3).rml
  • traces_top_layer_0.png.rml
Download

04_PROGRAMATION_ARDUINO_IDE.ZIP

Arduino Source Code

Files:

  • Programation_ARDUINO_IDE.ino
Download