Electronics Design
Group Assignment
- Use the test equipment in your lab to observe the operation of an embedded microcontroller.
Individual Assignment
- Simulate a circuit.
- Use an EDA tool to design an embedded microcontroller system using parts from the inventory, and check its design rules for fabrication.
- Extra Credit: Try another design workflow.
- Extra Credit: Design a case.
You can access the group assignment here.
Group Assignment
This week focused on hands-on use of professional lab equipment to analyze, debug, and understand real microcontroller-based circuits. The goal was to measure electrical parameters, visualize signals, and interpret communication between devices using industry-standard tools.
Lab Equipment Used
Digital Multimeter – ZOYI ZT301
Used to measure voltage, current, resistance, frequency, and continuity. It was essential for verifying PCB traces, checking 5V and 3.3V power rails, testing components, and detecting short circuits before powering boards.
Digital Oscilloscope – OWON TAO3104A (100 MHz, 1 GSa/s, 4-channel)
Used to visualize real-time waveforms and analyze signal behavior. We measured frequency, amplitude, duty cycle, and waveform shape. It helped us understand PWM signals, timing behavior, and signal stability.
Logic Analyzer – Saleae Logic 8 (8 Digital + 1 Analog, up to 100 MHz)
Used to capture and decode digital communication protocols such as UART and I²C. It allowed us to observe real data transmission, analyze timing relationships, and decode serial communication automatically.
Function Generator – GW Instek AFG-2125
Used to generate controlled sine, square, and triangle waveforms across different frequencies and amplitudes. It was tested using a piezoelectric crystal to observe vibration and sound generation at various frequencies.
Programmable Bench Power Supply – 30V / 5A (B&K Precision 912xA Series)
Provided regulated DC power with adjustable voltage and current limiting. It was used to safely power microcontroller boards, measure current consumption, and protect circuits from overcurrent damage.
Practical Experiments
We used a Seeed Studio XIAO RP2040 to generate PWM-based waveforms such as sine, square, triangle, sawtooth, ramp, and pulse. The oscilloscope was used to visualize and verify the signals, while the logic analyzer decoded UART and I²C communication from the board.
We also powered a custom handheld device using the bench supply to monitor real-time current consumption and performed an LED brightness experiment to observe how PWM duty cycle affects current draw.
Key Learning Outcomes
- Confident use of multimeter, oscilloscope, logic analyzer, function generator, and power supply
- Understanding waveform visualization and PWM signal behavior
- Practical debugging of UART and I²C communication
- Safe power management using current limiting
- Real-time measurement of voltage, frequency, duty cycle, and current
This week strengthened our practical electronics and embedded systems debugging skills by connecting theoretical knowledge to real laboratory measurements.
History of Electronics
Introduction
Electronics is the science and technology of controlling electric current to do useful tasks. This includes things like amplifying sound, switching signals, processing information, and controlling machines. Modern electronics is everywhere — in phones, computers, cars, and even household appliances. But it wasn’t always this small and powerful. Let’s start from the beginning.
1. Early Electronics: Vacuum Tubes
In the early 1900s, the main electronic devices were vacuum tubes. These are glass tubes with electrodes inside that can control the flow of electricity. They could:
- Amplify weak signals (make radios louder)
- Act as switches to control electricity
Vacuum tubes made early radios, televisions, and the first computers possible. But they had big problems:
- Very large and heavy
- Generated a lot of heat
- Broke easily and used a lot of power
Because of these issues, engineers wanted a smaller, more reliable alternative.
2. The Birth of the Transistor
In 1947, scientists at Bell Labs invented the transistor. A transistor is a tiny device that can:
- Amplify signals, just like vacuum tubes
- Act as a switch to turn electricity on or off
Transistors are made of semiconductors, usually silicon. They are:
- Much smaller than vacuum tubes
- More reliable and energy-efficient
- Cheaper to produce
Transistors completely changed electronics. Radios, computers, and many other devices became smaller, faster, and more practical. Today, billions of transistors fit on a single tiny chip.
3. Integrated Circuits (ICs)
By the 1960s, engineers realized that connecting lots of transistors together on a circuit board was still bulky and complicated. The solution was the Integrated Circuit (IC):
- Many transistors, resistors, and capacitors built on a single small silicon chip
- Made electronics smaller, faster, and cheaper
ICs are used in almost every electronic device today. For example:
- Microchips in computers and smartphones
- Embedded controllers in washing machines or cars
- Memory chips for storing data
Thanks to ICs, devices that once filled entire rooms could now fit in your pocket.
4. Levels of Integration in Integrated Circuits
As semiconductor fabrication technology improved, engineers were able to place increasing numbers of transistors onto a single silicon chip. The classification of ICs is based on the approximate number of transistors integrated into one chip.
The levels of integration are defined as follows:
SSI – Small Scale Integration
Transistor Count: Fewer than 100 transistors per chip
- Typically 10–100 transistors
- Used for basic logic gates (AND, OR, NOT, NAND, NOR)
- Required many ICs to build complete systems
MSI – Medium Scale Integration
Transistor Count: 100 to 3,000 transistors per chip
- Used for counters, registers, multiplexers, and small arithmetic circuits
- Reduced circuit complexity compared to SSI designs
LSI – Large Scale Integration
Transistor Count: 3,000 to 100,000 transistors per chip
- Enabled early microprocessors and memory chips
- Allowed major functional blocks of a computer on a single chip
VLSI – Very Large Scale Integration
Transistor Count: 100,000 to 10 million transistors per chip
- Enabled full microprocessors on one chip
- Used in personal computers and early smartphones
- Marked the beginning of modern computing power
ULSI – Ultra Large Scale Integration
Transistor Count: More than 10 million transistors per chip
- Modern processors contain billions of transistors
- Used in CPUs, GPUs, AI accelerators, and advanced mobile processors
- Built using nanometer-scale fabrication technology
Each step made electronics smaller, faster, cheaper, and more reliable. Today, electronics are everywhere, from your phone to cars, drones, and smart homes.
Active and Passive Components
Electronic components are classified into active and passive devices based on how they interact with energy within a circuit.
Active Components
Active components are devices that deliver power or energy to a circuit. They are capable of introducing energy in the form of voltage or current, typically by using an external power source.
Characteristics of Active Components
- Energy Role: Act as energy donors within the circuit.
- Power Gain: Capable of power gain (output power can be greater than input signal power).
- External Source Requirement: Require an external power supply to operate.
- Signal Control: Can use a small input signal to control a larger output signal.
Because of their ability to provide amplification and control, active components are essential in signal processing, switching, and communication systems.
Examples of Active Components
- Transistors
- Operational Amplifiers
- Integrated Circuits
- Diodes (in nonlinear control applications)
Passive Components
Passive components are devices that utilize, absorb, store, or dissipate energy supplied by active components. They do not generate energy on their own.
Characteristics of Passive Components
- Energy Role: Act as energy acceptors within the circuit.
- Power Gain: Do not provide power gain.
- External Source Requirement: Do not require an external source to perform their basic function.
- Signal Behavior: Cannot amplify signals; they can only attenuate, store, or dissipate energy.
Examples of Passive Components
- Resistors (dissipate energy as heat)
- Capacitors (store energy in an electric field)
- Inductors (store energy in a magnetic field)
Summary Comparison
| Feature | Active Components | Passive Components |
|---|---|---|
| Energy Role | Energy donors | Energy acceptors |
| Power Gain | Yes | No |
| External Power Required | Yes | No |
| Signal Amplification | Possible | Not possible |
In summary, active components introduce and control energy in a circuit, while passive components manage, store, or dissipate the energy provided by active sources.
Resistors
A resistor is a two-terminal passive electronic component that limits, regulates, or restricts the flow of electric current in a circuit
If too much electricity flows, components can overheat, LEDs can burn out, and circuits can get damaged.
A resistor protects components by limiting current, dividing voltage, and controlling signal levels in a circuit.
Measured in ohms, they convert electrical energy into heat to protect components, divide voltages, and bias active elements.
Very Simple Example
If you connect an LED directly to a battery, it may burn out because too much current flows through it.
But if you add a resistor in series, it reduces the current, keeps the LED safe, and allows it to glow properly.
Property of Resistance
Resistance is the property of a material to oppose the flow of electric current.
Resistance Formula
The resistance (R) of a conductor depends on:
- Length (L) – directly proportional
- Area of cross-section (A) – inversely proportional
- Resistivity (ρ) – material property
The mathematical expression is:
R = ρ (L / A)
Where:
- R = Resistance
- ρ = Resistivity of the material
- L = Length of the conductor
- A = Area of cross-section
Unit of Resistance
Resistance is measured in Ohms (Ω).
Classification of Resistors
Resistors are mainly classified into two types:
- Fixed Resistors
- Variable Resistors
1. Fixed Resistors
Fixed resistors have a constant resistance value that cannot be changed.
Types of Fixed Resistors
- Carbon Composition: Made from a mixture of carbon granules and a binding material.
- Carbon Film: A thin layer of carbon is deposited on an insulating core. The resistance value depends on the thickness of the carbon film.
- Metal Film: Similar to carbon film but uses metal (such as Nichrome). It provides better stability, accuracy, and lower noise.
- Wire-Wound: Constructed by winding a metal wire (usually Manganin or Nichrome) around an insulating core.
2. Variable Resistors
Variable resistors allow the resistance value to be adjusted manually.
Types of Variable Resistors
- Potentiometer: A three-terminal device used as a voltage divider. It uses a sliding contact called a wiper to vary resistance.
- Rheostat: Usually a two-terminal variable resistor used to control current in a circuit.
- Trimmers (Presets): Small variable resistors used for occasional adjustments and calibration on circuit boards.
Embedded Microcontroller Simulation
Embedded microcontroller simulation is the process of testing and running a microcontroller-based system in a virtual environment before building the physical hardware. It allows designers to verify circuit connections, program behavior, and overall system functionality without using real components.
Wokwi
The objective of this task was to simulate and test a microcontroller circuit using an online simulator before building it on physical hardware. Instead of directly connecting components on a real board, I first verified the circuit design and program behavior in a virtual environment to reduce errors and avoid damaging components.
For this purpose, I used the Wokwi Online Simulator.
Creating a New Project
Next, I created a new project in the simulator. I first clicked on the Profile section and navigated to My Projects. From there, I selected the New Project option to start a fresh design. I then chose the Raspberry Pi Pico board from the available hardware options and selected Arduino as the programming environment. This set up a new workspace with the required board and code editor ready for development.
Understanding the Setup
After creating the project, the simulator automatically generated:
- A Raspberry Pi Pico board
- A default Arduino sketch file
- A simulation environment with wiring view
Writing the Code
I modified the default Arduino code to test basic functionality such as blinking an LED.
void setup() {
pinMode(5, OUTPUT); // Built-in LED pin for Raspberry Pi Pico
}
void loop() {
digitalWrite(5, HIGH);
delay(1000);
digitalWrite(5, LOW);
delay(1000);
}
I clicked the Start Simulation button. The built-in LED connected to GPIO 5 started blinking, confirming that the code was working correctly.
Observation
The simulation successfully demonstrated the basic operation of the Raspberry Pi Pico using Arduino code. The LED blinked at a 1000 ms interval, confirming correct pin configuration and program execution.
Learning Outcome
- Understood how to create a new microcontroller project in Wokwi.
- Learned how to simulate Raspberry Pi Pico using Arduino framework.
- Verified code functionality before physical implementation.
- Understood GPIO pin control and timing using delay().
Conclusion
Using Wokwi allowed me to safely test and debug my microcontroller code without requiring physical hardware. This helps reduce errors before implementing the design in a real embedded system.
Pushbutton with OLED
Objective
To interface a pushbutton and an OLED display with a Raspberry Pi Pico and display different messages on the screen depending on the button state.
Components Used
- Raspberry Pi Pico
- Pushbutton
- SSD1306 128x64 I2C OLED display
- Connecting wires
- Wokwi simulator
Working Principle
The pushbutton is configured as a digital input using the INPUT_PULLUP mode. In this configuration:
- The input pin remains HIGH by default.
- When the button is pressed, the pin connects to GND.
- The pin then reads LOW.
The OLED display communicates with the Raspberry Pi Pico using the I2C communication protocol. The program continuously reads the button state. If the button is pressed, a specific message is displayed on the OLED. If the button is not pressed, a different message is displayed.
Circuit Connections
Pushbutton Connections
One terminal of the pushbutton is connected to GPIO 2.
The other terminal is connected to GND.
No external resistor is required because the internal pull-up resistor is enabled in the program.
OLED Display Connections (I2C)
| OLED Pin | Connected To Pico |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SDA | GPIO 4 |
| SCL | GPIO 5 |
Program Code
#include <Arduino.h>
#include <U8g2lib.h>
#include <Wire.h>
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);
const int buttonPin = 2;
void setup() {
pinMode(buttonPin, INPUT_PULLUP);
u8g2.begin();
}
void loop() {
int buttonState = digitalRead(buttonPin);
u8g2.clearBuffer();
u8g2.setFont(u8g2_font_ncenB08_tr);
if (buttonState == LOW) {
u8g2.drawStr(0, 30, "Button Pressed!");
}
else {
u8g2.drawStr(0, 30, "Press the Button");
}
u8g2.sendBuffer();
}
Code Explanation
In the setup function, the button pin is configured as INPUT_PULLUP and the OLED display is initialized using the U8g2 library.
In the loop function, the program reads the button state. The display buffer is cleared before writing new content. If the button is pressed (LOW), the display shows "Button Pressed!". If the button is not pressed (HIGH), the display shows "Press the Button". The buffer is then sent to the display.
Expected Result
When the button is not pressed, the OLED displays:
Press the Button
When the button is pressed, the OLED displays:
Button Pressed!
Electronic Design
KiCad
KiCad is a free and open-source Electronic Design Automation (EDA) software suite used for designing electronic schematics and printed circuit boards (PCBs). It provides a complete workflow for electronic product development — from circuit design and simulation to PCB layout and manufacturing file generation.
The software includes several integrated tools, such as:
Schematic Editor
Create a New Project
- Click File in the top left corner.
- Select New Project.
- Choose the folder where you want to save your project.
- Enter your project name.
- Click Save.
Files Created Automatically
When a new project is created in KiCad, the software automatically generates several important files. Each file serves a specific purpose in the design process.
- .kicad_pro (Project file)
- .kicad_sch (Schematic file)
- .kicad_pcb (PCB layout file)
1. .kicad_pro (Project File)
The .kicad_pro file is the main project file. It stores the overall project settings such as:
- Design rules
- Library references
- Page layout settings
- Net class configurations
- Project-specific preferences
This file acts as the central control file that links the schematic and PCB files together. When you open a KiCad project, this file loads all associated design data.
2. .kicad_sch (Schematic File)
The .kicad_sch file contains the schematic design of the project.
It stores:
- Placed symbols (components)
- Wire connections
- Labels and annotations
- Electrical connections (nets)
This file represents the logical design of the circuit — how components are electrically connected — but not their physical placement.
3. .kicad_pcb (PCB Layout File)
The .kicad_pcb file contains the printed circuit board layout.
It stores:
- Component footprints
- Board outline
- Copper tracks (routing)
- Vias
- Zones (like ground planes)
- Silkscreen and solder mask information
This file represents the physical design of the circuit board that will be manufactured.
Kicad Project Manager
The KiCad Project Manager is the main control window that appears when you open a KiCad project. It acts as the central hub for managing all files and tools related to a specific electronic design project.
From the Project Manager, you can create a new project, open an existing project, and access all major KiCad design tools such as the Schematic Editor, PCB Editor, Symbol Editor, and Footprint Editor. Instead of opening each tool separately, the Project Manager provides organized access in one place.
The left side of the window typically displays the project files, including the .kicad_pro project file, .kicad_sch schematic file, and .kicad_pcb PCB layout file. This allows you to quickly navigate between different parts of your design.
The top menu bar provides options such as File, Edit, View, Tools, Preferences, and Help. Through these menus, you can configure project settings, manage libraries, access the Plugin and Content Manager, and adjust design preferences.
In summary, the KiCad Project Manager serves as the starting point and organizational center of a KiCad project. It connects the schematic design, PCB layout, libraries, and configuration settings into a single structured workflow.
1. Schematic Editor
Used to create and edit the project schematic. This is where circuit diagrams are drawn by placing symbols and connecting them with wires.
2. Symbol Editor
Used to create, modify, and manage schematic symbols. It allows editing of global or project-specific symbol libraries.
3. PCB Editor
Used to design the printed circuit board layout. Components are placed on the board and connected using copper tracks.
4. Footprint Editor
Used to create and edit PCB footprints. Footprints define the physical pad layout of components on the board.
5. Gerber Viewer
Used to open and preview Gerber files. This helps verify manufacturing files before sending them to a PCB fabrication service.
6. Image Converter
Used to convert bitmap images into schematic symbols or PCB footprints. This is helpful for adding logos or custom graphics to a design.
7. Calculator Tools
Provides electrical calculation tools such as resistor value calculators, track width calculators, and other design-related utilities.
8. Drawing Sheet Editor
Used to edit the drawing sheet format, including borders and title blocks, for schematic and PCB documents.
9. Plugin and Content Manager
Used to manage downloadable libraries, plugins, and external content from KiCad and third-party repositories.
In the Project Manager window, locate the Schematic Editor icon, and click it to open the Schematic Editor.
Schematic Design (Eeschema)
To begin designing the circuit, the Schematic Editor must be opened from the KiCad Project Manager.
When you open Eeschema, a new window appears with a blank schematic sheet. You will see options such as Add Components, Place Wire, Net Label, and other tools.
Add Components
- Press A on your keyboard.
- Or click the Add Symbol icon in the right toolbar.
A window called Choose Symbol will open. On the left side, you will see different libraries. On the right side, you will see the available components (symbols) from the selected library.
Use the search bar at the top of the Choose Symbol window.
You can further filter the results by using keywords or by selecting a specific library name.
- Type the component name:
- R → Resistor
- C → Capacitor
- D → Diode
- LED → Light Emitting Diode
- GND → Ground
- Microcontroller name (example: ATtiny, STM32, etc.)
- You can filter by keyword or library name.
Click on a symbol to see its preview. Check the pin count, pin names, and symbol type to ensure it matches your requirement. After verifying the details, click OK to select the symbol.
Move your cursor to the schematic sheet and left click to place the component. You can place multiple copies by clicking again at different locations. Press Esc to stop placing the component.
KiCad Library Management
To streamline the design process and ensure access to common mechanical and electrical components, I utilized the KiCad Plugin and Content Manager.
Installing KiCad FabLib
Make sure you have KiCad 8 or later installed before proceeding with the installation.
Installation Method: From KiCad Plugin Repository
Warning:
This installation method depends on the KiCad team accepting a merge request of the latest stable version. The version available through the Plugin and Content Manager may not always be the most recent release. If you need the absolute latest version, refer to the Install from File method instead.
Follow the steps below to install KiCad FabLib using the official KiCad plugin source:
Go to:
Tools → Plugin and Content Manager
or press:
Ctrl + M
You can also find the Plugin and Content Manager in the KiCad Project Manager window under the Tools menu.
In the Plugin and Content Manager window, click on the Libraries tab.
Look for "KiCad FabLib" in the list of available libraries under the Libraries tab.
Click the Install button next to KiCad FabLib.
After installation, click Apply Pending Changes to complete the process.
Once completed, the KiCad FabLib library will be available for use in your projects.
Libraries in KiCad are used whenever you need electronic components or mechanical elements for your schematic and PCB design. A library contains predefined symbols for schematics and footprints for PCB layouts. Instead of creating components manually every time, libraries allow you to quickly insert standardized, ready-to-use parts into your project.
You use the default KiCad libraries when working with common components such as resistors, capacitors, diodes, connectors, and microcontrollers. These libraries are sufficient for most general electronic designs and follow industry standards.
External libraries, such as KiCad FabLib, are used when you require specific components that are not available in the default libraries. For example, in fabrication laboratory environments, FabLab libraries provide commonly used SMD components, footprints tailored for PCB milling machines, and standardized parts used in academic or prototyping workflows.
Libraries are typically accessed during two main stages of design. The first stage is during schematic design, where you select symbols from a symbol library. The second stage is during PCB layout, where the corresponding footprints from footprint libraries are assigned and placed on the board.
Using properly managed libraries ensures consistency, reduces design errors, saves time, and improves compatibility with manufacturing processes.
So after I imported the needed components from the library,
Rotating and Flipping Before Placement
- Press R to rotate 90°.
- Press X to flip horizontally.
- Press Y to flip vertically.
Editing Component Properties
- Double-click the placed component.
- Edit:
- Reference (Example: R1, C1)
- Value (Example: 10k, 100nF)
- Footprint (Important for PCB design)
- Datasheet link (optional)
What is a Footprint?
A footprint defines the physical layout of a component on the PCB. It includes pad size, pad spacing, drill holes, and overall package shape. The schematic symbol and PCB footprint are separate and must be linked.
Wiring and Electrical Checks
Add Wires
- Press W.
- Click from one pin to another.
- Press Esc to stop wiring.
Run Electrical Rules Check (ERC)
Click on ERC in the top toolbar or go to Inspect → Electrical Rules Checker.
In the ERC window, click Run to analyze the schematic for electrical issues.
Review all reported errors and warnings. Double-click on each issue to locate it in the schematic and correct the problem.
Repeat the process until no unresolved errors or critical warnings remain.
PCB Design
PCB design is the process of converting a schematic circuit diagram into a physical printed circuit board layout. In this stage, electronic components are arranged on a board and electrically connected using copper tracks. While the schematic represents the logical connections between components, the PCB design defines their physical placement, routing, board dimensions, and manufacturing details.
To begin PCB design in KiCad, first complete the schematic and ensure there are no electrical errors by running the Electrical Rules Check (ERC). Once the schematic is verified, open the PCB Editor from the KiCad Project Manager by clicking on PCB Editor.
To transfer the design from the schematic to the PCB layout, return to the Schematic Editor and select Tools → Update PCB from Schematic. In the update window that appears, click Update PCB. This process imports all assigned footprints and electrical connections into the PCB Editor.
After updating, open the PCB Editor. The component footprints will appear in the workspace along with thin connection lines called ratsnest lines. These lines represent the electrical connections that must be routed using copper tracks. The next step is to arrange the components properly on the board and begin routing according to the indicated connections.
Define Board Outline (Edge.Cuts)
- Select Edge.Cuts layer
- Draw board boundary
- Ensure closed shape
Arrange Components
- Move footprints inside board outline
- Place related components close together
- Keep connectors near board edges
PCB Trace (Routing Tracks) in KiCad
What is a PCB Trace?
A PCB trace is a copper path that electrically connects component pads on the PCB. It replaces the wires from your schematic.
Before Routing Traces
- Update PCB from schematic.
- Arrange all component footprints properly.
- Define board outline (Edge.Cuts layer).
- Set proper track width (based on current requirements).
Step 1: Select Route Tool
- Open PCB Editor.
- Press X on your keyboard.
- Or click the Route Tracks icon from the right toolbar.
Step 2: Start Routing
- Click on a pad (start point).
- A trace will attach to your cursor.
- Move towards the destination pad.
- Click to create corners if needed.
- Click on the destination pad to complete connection.
- Follow the white ratsnest line as a guide.
Routing Tips
- Keep traces short and clean.
- Avoid sharp angles (use 45° angles).
- Avoid crossing traces on the same layer.
- Maintain proper spacing between tracks.
Changing Trace Width
- Before routing, select track width from the top toolbar.
- Choose predefined width or create custom width in Board Setup.
Switching Layers (For 2-Layer Boards)
- While routing, press V to add a via.
- The trace will switch to the other copper layer.
Deleting a Trace
- Click on the trace.
- Press Delete.
Dragging or Adjusting Trace
- Hover over the trace.
- Press G to drag while keeping connections.
Check Design Rules
- Click Inspect → Design Rules Checker (DRC).
- Fix any clearance or connection errors.
Good Practice
- Route power traces thicker than signal traces.
- Keep analog and digital signals separated if possible.
- Place decoupling capacitors close to microcontroller power pins.
- Run DRC before exporting Gerber files.
Rectangle and Edge Cut in KiCad PCB Editor
What is Edge.Cuts?
The Edge.Cuts layer defines the physical boundary of the PCB. This outline tells the manufacturer where the board should be cut. The shape must always be a fully closed loop.
Drawing a Rectangle Board Using Edge.Cuts
Step 1: Open PCB Editor
- Open your project.
- Click PCB Editor.
Step 2: Select Edge.Cuts Layer
- Go to the right-side Layers Manager.
- Select Edge.Cuts.
Important: Always confirm the active layer is Edge.Cuts before drawing.
Step 3: Draw Rectangle Using Rectangle Tool
- Click Add Graphic Rectangle (right toolbar).
- Click once to set the first corner.
- Move the cursor to define board size.
- Click again to complete the rectangle.
- This automatically creates a closed rectangular board outline.
Alternative Method: Draw Rectangle Using Lines
- Select Add Graphic Line.
- Click to draw the first edge.
- Draw four lines (top, right, bottom, left).
- Ensure the final line connects exactly to the starting point.
- The shape must be fully closed with no gaps.
Setting Exact Dimensions
- After drawing the rectangle, double-click one edge.
- Edit the coordinates manually if precise dimensions are required.
- You can also enable grid spacing for accurate sizing.
Checking the Edge Cut
- Zoom in to confirm all corners are connected.
- Make sure no extra lines exist.
- Run Inspect → Design Rules Checker (DRC).
Important Rules
- The outline must be a closed loop.
- No overlapping lines.
- No open gaps.
- Keep components slightly inside the board boundary.
Good Practice
- Define board size before routing traces.
- Leave margin between copper traces and board edge.
- Use consistent units (mm recommended).
3D Viewer in KiCad PCB Editor
What is 3D Viewer?
The 3D Viewer allows you to see your PCB in a realistic 3D model. It helps you check component placement, board shape, and overall design appearance before fabrication.
Step 1: Open PCB Editor
- Open your project.
- Click PCB Editor.
Step 2: Open 3D Viewer
- Click View in the top menu.
- Select 3D Viewer.
- Or press Alt + 3 (shortcut).
A new window will open showing your PCB in 3D.
Basic Controls in 3D Viewer
- Left Mouse Button: Rotate the board.
- Middle Mouse Button: Pan (move view).
- Mouse Scroll: Zoom in/out.
- Right Mouse Button: Context options.
Checking in 3D Viewer
- Verify board outline (Edge.Cuts).
- Check component placement.
- Confirm component orientation.
- Inspect connector alignment.
- Ensure no components are outside the board.
If Components Do Not Appear in 3D
- Footprints may not have 3D models assigned.
- Open footprint properties.
- Assign a 3D model file (.step or .wrl).
Render Options
- Toggle solder mask visibility.
- Show or hide silkscreen.
- Change background color.
- Enable realistic lighting.
Good Practice
- Always check 3D Viewer before exporting Gerber files.
- Confirm mechanical clearances.
- Ensure connectors are facing correct direction.
Individual Project
Overview
For the individual assignment, I designed a PCB for the LED blinker circuit I had previously built and simulated during the Electronics week. The goal was to take that design and turn it into a real, fabrication ready PCB layout using KiCad.
Downloading Additional Components
Not all components are available in KiCad's default library. For this project, I needed a S4B-PH-SM4-TB connector, which was not available in KiCad. I downloaded it from SnapMagic, a library of ready-to-use schematic symbols and footprints. This is a useful method whenever a component is missing from KiCad's built-in libraries.
Adding the Component to KiCad
Once downloaded, I imported the component into KiCad by adding it to a local library. The downloaded package includes both the schematic symbol and the PCB footprint, so it can be used directly in the schematic editor and then carried through to the PCB layout.
PCB Layout
With all components placed in the schematic, I opened the PCB Editor and arranged them within the board outline. I kept the layout compact while maintaining enough clearance between parts for reliable fabrication.
Routing Traces
I routed all the copper traces manually, connecting the pads according to the ratsnest (the unconnected net lines from the schematic). I used appropriate trace widths for power and signal lines to ensure the board meets fabrication requirements.
Design Rules Check (DRC)
Once routing was complete, I ran the Design Rules Checker (DRC) to verify the board had no errors — checking for minimum trace widths, clearances, unconnected nets, and board outline integrity. All errors were resolved before moving on.
3D Preview
I used KiCad's 3D Viewer to do a final visual check of the board — confirming component placement, orientation, and the overall footprint of the design before exporting.
Key Learnings
- How to translate a schematic into a PCB layout in KiCad.
- Downloading missing components from SnapMagic and importing them into KiCad.
- Assigning correct footprints to match available components in the fab inventory.
- Manual trace routing and maintaining proper clearances.
- Using DRC to catch and fix design errors before fabrication.
- Verifying the final design with the 3D Viewer.