About Me Weekly Assignments Final Project
Kevin J Jijo
Week 6

6. Electronics Design

Group Assignment

For the group assignment we explored the test equipment in the lab and used them to observe and analyse a working microcontroller circuit.

Multimeter (ZOYI ZT301) used for checking continuity across traces, measuring voltage on the 3.3V and 5V rails, and verifying resistor values.

Oscilloscope (OWON TAO3104A) used a XIAO RP2040 as a function generator to output different waveforms via PWM and observed them live. Since the RP2040 outputs digital PWM, waveforms like sine and triangle are approximations, zoom out on time/div to see the full envelope.

Logic Analyser (Saleae Logic 8) captured and decoded real communication protocols from the RP2040. UART decoded "hello world!" at 9600 baud, and I²C captured communication to an SSD1306 OLED display.

Bench Power Supply provides clean regulated DC power for testing. Set voltage and current limit before powering up.

Full group docs: https://fabacademy.org/2026/labs/kochi/group_assignmetns/week06/

Individual Assignment

Using Wokwi Extension in VSCode

To set up the .json config file, rename it to .txt, paste in the code from the online Wokwi simulator, then rename it back to .json.

Wokwi json setup

In Arduino IDE, go to File → Preferences and enable "Show verbose output during compile". Select the correct board and compile. Once done, the output terminal will show the path to your build directory — navigate there to find the .uf2 and .elf build files.

Arduino verbose output

The output terminal displays the location of the build files. You can either point the .toml directly to that path, or just copy both files into your Wokwi project root folder.

Output terminal build path

These are the two build files found at the compiled output path.

Build files at output path

If you copy both files into the Wokwi root folder, the relative path in your .toml is just the filename itself.

Wokwi root folder files

Alternatively, you can skip copying and just link the full absolute path to both files directly in the .toml.

Absolute path in toml

ELF (Executable and Linkable Format) is the standard binary file format on Linux/Unix systems. It acts as a container for machine code and metadata, letting the OS load, link, and execute programs. The three formats compared:

  1. BIN — a raw byte-for-byte image of what goes into target memory. No gaps, no extras.
  2. HEX — a text representation of the binary with addresses and checksums, so it can be sparse.
  3. ELF — the full build output, containing the code plus symbol and debug info. BIN and HEX are both generated from the ELF.

With that set up, we can now simulate!

Wokwi simulation running

Electronics Basics

Power = V × I

For example, my laptop charger runs at 170W — input is 220V at 0.7A, and the output is 20V at 8.5A, which is what the laptop actually needs to run.

SMD Resistor — Surface Mount Device. Sits flat on the PCB surface rather than having legs that go through holes.

The Fablab Kerala inventory of components and materials can be found at: https://inventory.fablabkerala.in/

Fablab Kerala inventory

Transistor — three terminals: Base, Emitter, Collector.

MOSFET — three terminals: Gate, Source, Drain. The insulating layer inside is formed from SiO₂ (silicon dioxide), which is what separates it structurally from a standard BJT transistor.

Transistor diagram MOSFET diagram LED load line graph

Crystal Oscillator — a circuit that generates a stable oscillating frequency using a quartz crystal instead of a tuned LC circuit.

Ceramic Resonator — works the same way but uses ceramic as the piezoelectric material instead of quartz. Cheaper and smaller than a crystal oscillator, but slightly less precise.

Voltage Regulator — maintains a stable output voltage regardless of input fluctuations. Uses an internal reference voltage, an error amplifier, and a pass transistor to continuously compare and adjust the output, providing a stable DC voltage from an unregulated source.

Zener Diode — allows current to flow in reverse at a precise breakdown voltage. Used for voltage clamping and regulation.

Buck Converter — a switching regulator that steps voltage down efficiently by rapidly switching current through an inductor, using far less power than a linear regulator.

Buck converter diagram

Boost Converter — a switching regulator that steps voltage up efficiently.

Buck-Boost Converter — can both step voltage up and down depending on the input and load conditions.

Voltage Rail Naming:

PCB design on KiCAD

To add a component symbol in KiCAD, click the diode icon in the right toolbar to open the symbol picker.

KiCAD symbol picker

Once the schematic is complete, switch to the PCB editor to convert it into a physical board layout.

KiCAD schematic to PCB

The blue lines are air wires (ratsnest) — they show logical connections from the schematic that haven't been routed as physical traces yet and still need to be connected.

KiCAD air wires ratsnest

Route the connections using Route → Route Single Track, or just press X as a shortcut.

KiCAD route single track

To set the board boundary, select the Edge.Cuts layer in the Appearance panel and draw a rectangle around your components to define the physical edge of the PCB.

KiCAD Edge.Cuts boundary

Once the board is laid out, you can open it in the 3D viewer to see a rendered preview of the final PCB.

KiCAD 3D viewer

Downloading the KiCAD FabLib Library

Open the Plugin and Content Manager, search for "KiCAD FabLib", then download, install, and apply pending changes.

KiCAD Plugin and Content Manager KiCAD FabLib install

UPDI — Unified Program Debug Interface. The single-wire interface used to program and debug the chip.

FTDI — a company whose serial connectors are widely used for USB-to-Serial communication. Socket is female, header is male.

Designed a simple circuit in the schematic editor.

Simple schematic design Schematic editor view

Used net labels instead of drawing wires between components to keep the schematic clean. Then switched over to the PCB editor to start layout.

PCB editor layout

0.4mm is the standard trace width used at the Fablab.

Go to Board Setup and configure the design constraints to match the PCB etching machine's capabilities — set all values before starting layout so your traces and clearances are within what the machine can physically produce.

Board setup constraints Design constraints settings PCB constraints configured

To select an entire trace, click any part of it then press U to select the full connected path. Keep all traces at 45° angles for clean, reliable etching.

Trace routing 45 degrees

A zero ohm resistor is essentially a wire in resistor form, used to jump over another trace when routing gets tight.

Run DRC (Design Rules Check) to validate the board — got a couple of errors, one for overlapping components and one for a trace too close to the board edge. Fixed both and re-ran until clean.

DRC errors

On a real PCB, the green coating is the solder mask — it insulates and protects the copper traces, only exposing the solder pads where components need to be soldered. The white text and markings on top are called silkscreen, used for labels, component outlines, and pin indicators.

Solder mask and silkscreen

No errors, DRC passed clean!

DRC no errors

Export the Gerber files and upload them to PCBWay to preview the board visually — and if everything looks good, you can go ahead and order prints directly from there.

PCBWay Gerber preview

This is the tool that generates trace images for the in-house PCB milling machine — it takes the Gerber files and produces a PNG that the machine uses to etch away the copper from the blank PCB board.

In-house PCB milling trace generator

Downloading a Component from SnapMagic

Use SnapMagic/SnapEDA to download free symbols, footprints, and 3D models for components not in the default library.

Connector Types and Pitches:

Downloaded zip contents:

Auto Routing — go to Net Classes and set all trace width and clearance values before running. Differential pairs (e.g. USB D+/D-) are two traces that must be kept the same length.

To add parts: Preferences → Manage Symbol Libraries and Manage Footprint Libraries.

Press V to place a via and jump a trace between copper layers.

Head to SnapEDA (snapeda.com) and search for the part you need. In my case I needed a 4-pin right-angle SMD JST header — part number S4B-PH-SM4-TB.

SnapEDA part search

After downloading, the zip contains:

To add them to KiCAD, go to Preferences → Manage Symbol Libraries and Manage Footprint Libraries, and add both by linking their respective file locations.

KiCAD manage symbol libraries KiCAD manage footprint libraries

For the footprint library, the entire folder is added rather than individual files.

To attach the 3D model, double-click the part in the PCB editor, go to the 3D Models tab, and add the path to the .step file — ideally stored in your project folder under libraries/3d models. It almost never positions correctly by default, so use the offset and rotation controls to manually align it onto the footprint using the pin holes as reference.

3D model alignment in KiCAD

Final Board Design

In Inkscape I designed the Monado sword outline from Xenoblade — since it's a simple PCB I wanted it to have some meaning to it. Exported it as an SVG, then imported it into Fusion 360 since KiCAD needs a DXF for custom board outlines. In Fusion, cleaned up the outline to make sure it was a proper closed path so it exports correctly to DXF.

Monado sword Inkscape design

In KiCAD, import the DXF as a graphic via File → Import → Graphics.

KiCAD import DXF graphic

Make sure to import it onto the Front Copper layer so the milling machine knows to cut it out. Since this is a trial PCB, all communication interfaces are broken out to jumper headers so everything is accessible for testing.

UART (Serial)

I²C

I play a lot of Super Smash Bros and one of the characters I main is Shulk from the Xenoblade Chronicles game series.

Shulk from Xenoblade

He has a special sword called the Monado where you can choose certain aspects to boost like speed, power, and defence — the sword changes colour to indicate which mode is active.

Monado sword modes

Since the assignment was to design a PCB with an LED circuit and a switch, I thought I'd make it so the LEDs show which mode you've chosen for Shulk to fight with.

First designed all the circuits in the schematic editor.

Schematic editor full design

Then ran ERC to confirm there were no errors.

ERC no errors

Switched to the PCB editor.

Made all the traces — focused on the communication traces first and kept them short to minimise noise, then connected all GPIO giving them second priority.

PCB traces routed

Tested all connections using DRC — no errors.

DRC passed

The 3D model of the PCB came out looking great.

3D model preview

Exporting the Files

To export the Gerber files, go to File → Fabrication Outputs → Gerbers.

Exporting Gerber files

To export the 3D model, go to File → Export → Step.

Exporting STEP file

Building a Case for the PCB

To mount the PCB inside the case, first add mounting holes in the schematic editor by placing them as components, then route them through to the PCB layout.

Mounting holes in schematic

Now there will be two holes in the final output.

Imported the STEP file of the PCB into Fusion 360 and designed a case around it, leaving holes for the XIAO Seeed RP2040 and the I2C header pins.

PCB case design in Fusion 360

Left a small hole on the top clear acrylic layer so the switch can be clicked.

Project Files

Download here