W6 | Electronics Design
📝 Group Assignment:
- Use the test equipment in your lab to observe the operation of a microcontroller circuit board (as a minimum, you should demonstrate the use of a logic analyzer).
- Document your work on the group work page and reflect what you learned on your individual page.
What We Did
For this group assignment, we used a digital storage oscilloscope to observe and analyze the signals generated by a custom PCB called ESAN XIAO, a board made by Jorge, based on the XIAO RP2040 microcontroller. We tested two types of signals — a digital signal from a push button and an analog signal from a potentiometer. The goal was to understand what these signals look like in real conditions and how to read them using the oscilloscope.
The Equipment
The oscilloscope we used was the GW Instek GDS-1152A-U, a digital storage oscilloscope available in our lab. An oscilloscope is a tool that lets you see electrical signals on a screen — instead of just reading a number like a multimeter would, you can actually see the shape of the signal over time, which makes it much easier to understand what a circuit is doing. The "digital storage" part means it can capture and hold a signal on screen, which is very useful when you want to analyze it carefully.
| Feature | Value |
|---|---|
| Bandwidth | 150 MHz |
| Sampling rate | 1 GSa/s |
| Channels | 2 |
| Memory | 2 Mega points built-in |
These specs define what kind of signals the oscilloscope can measure. The bandwidth tells you how fast a signal can change and still be captured correctly — 150 MHz is more than enough for the signals we worked with. The sampling rate is how many times per second the oscilloscope takes a snapshot of the signal — 1 GSa/s means 1 billion snapshots per second, which gives a very accurate picture of the signal shape. The 2 channels mean we could measure two signals at the same time if needed. And the memory determines how much signal data it can store for analysis.
The screen is divided into a grid of squares called divisions, and two main controls define what you see:
Vertical axis (VOLTS/DIV)
Each square represents a set number of volts. Adjusting this makes the signal appear taller or flatter on screen.
Horizontal axis (TIME/DIV)
Each square represents a set amount of time. Adjusting this zooms in or out on the signal, showing more or fewer pulses at once.
Understanding these two controls is the key to reading any signal correctly on an oscilloscope.
The Circuit
The circuit we tested was a custom-designed red PCB with a XIAO RP2040 microcontroller soldered onto it. The board exposes all pins through headers, making it easy to connect external components and test equipment.
For the tests we connected two components:
🖰 D0— a push button (digital input)🖰 A1— a potentiometer (analog input)
💻 The Code
The following program was running on the XIAO RP2040 during the measurements. It reads both components continuously and prints their values to the Serial Monitor:
#define pinButton D0
#define pinPot A1
bool state;
int valueADC;
void setup() {
Serial.begin(9600);
pinMode(pinButton, INPUT);
}
void loop() {
state = digitalRead(pinButton);
valueADC = analogRead(pinPot);
Serial.print("Button state = ");
Serial.print(state);
Serial.print(" Potentiometer ADC value = ");
Serial.println(valueADC);
}
How We Used the Oscilloscope
Before taking any measurements, we had to learn how to connect the oscilloscope correctly and how to set it up to display the signal. This process was new for all of us, so we went step by step.
-
Connecting the probe
The oscilloscope probe has two parts: a signal tip and a ground clip. The signal tip connects to the pin being measured, and the ground clip attaches to the GND of the circuit. This step is always necessary — the oscilloscope measures voltage differences and needs a reference point to compare against. Without the ground connection, the measurement is meaningless.
-
Using Autoset
Once connected, we pressed the🖰 Autosetbutton. This automatically adjusts both VOLTS/DIV and TIME/DIV to display the signal correctly on screen. It was a good starting point, especially when we did not know what the signal would look like.
-
Fine-tuning the scales
After Autoset, we adjusted the scales manually to get a clearer view:- If the signal looked too tall or too flat → adjust VOLTS/DIV
- If the signal looked too compressed or too stretched → adjust TIME/DIV
-
Reading the measurements
The Measure function automatically calculates values like Vmax, Vrms, frequency, duty cycle, and rise time. We did not have to calculate anything manually — the oscilloscope did it for us and displayed the values on the right side of the screen.
Test 1 — Digital Signal: Push Button
The first test was with the push button on pin 🖰 D0. A digital signal has only two possible states — 0 (LOW, 0V) or 1 (HIGH, 3.3V). There is nothing in between. Every time the button was pressed, the signal jumped instantly from 0V to 3.3V, and when released it dropped back to 0V.
On the oscilloscope screen, this looked like a series of clean square pulses. By adjusting TIME/DIV we could zoom in to see individual presses more clearly, or zoom out to see multiple pulses at once. We also used the trigger function to freeze a specific moment of the signal on screen, which made it easier to analyze.
The automatic measurements gave us the following readings:
| Measurement | Value | What it means |
|---|---|---|
| Vmax | 3.44V | Peak voltage including small noise spikes |
| Vrms | 2.49V | Effective voltage value |
| Frequency | 2.990 Hz | How often the button was pressed per second |
| Duty cycle | 54.91% | Proportion of time the signal was HIGH vs LOW |
| Rise time | 316.1 µs | How long it took the signal to go from 0V to 3.3V |
Looking at these values, a few things stand out. The Vmax of 3.44V is slightly above 3.3V — that small difference comes from tiny noise spikes in the signal, which is completely normal. The frequency of 2.990 Hz tells us the button was being pressed about 3 times per second. The duty cycle of 54.91% means the signal was HIGH slightly more than half the time — which makes sense since we were holding the button down for roughly equal amounts of time as releasing it. The rise time of 316.1 µs shows that even though a digital signal looks like an instant jump on screen, it actually takes a tiny fraction of a second to transition — something you can only see with an oscilloscope.
Something worth noting is that the XIAO RP2040 operates at 3.3V, unlike the Arduino UNO which operates at 5V. The oscilloscope confirmed this directly — the signal topped out at 3.3V as expected. If we had been using an Arduino UNO, the signal would have reached 5V instead.
Test 2 — Analog Signal: Potentiometer
The second test was with the potentiometer on pin 🖰 A1. Unlike the button, the potentiometer generates a continuously varying signal — it can be any value between 0V and 3.3V depending on how far it is rotated.
On screen, this looked completely different from the button. Instead of square pulses, we saw a smooth curve that changed as the potentiometer was turned. Rotating slowly produced a gradual wave, and rotating quickly produced a steeper one. The signal never snapped to a fixed value — it always transitioned smoothly, which is exactly what an analog signal is.
The automatic measurements gave us the following readings:
| Measurement | Value | What it means |
|---|---|---|
| Vrms | 1.71V | Effective voltage of the varying signal |
| Vmax | 2.64V | Maximum voltage reached during rotation |
| Frequency | 1.756 Hz | How fast the potentiometer was being rotated |
| Duty cycle | 55.06% | Proportion of time the signal was above the midpoint |
| Rise time | 179.5 ms | How long it took the signal to rise |
These values tell a different story than the button. The Vmax of 2.64V shows that during this measurement the potentiometer was not rotated all the way to its maximum — if it had been, the signal would have reached the full 3.3V. The Vrms of 1.71V reflects the average effective voltage across the entire rotation, which is lower than the peak because the signal was constantly varying. The duty cycle of 55.06% means the signal spent slightly more than half the time above the midpoint voltage, which reflects how the potentiometer was being turned. The frequency of 1.756 Hz simply reflects how fast the potentiometer was being turned back and forth during the test — not a fixed frequency like a digital signal. And the rise time of 179.5 ms is much longer than the button's 316 µs — which makes sense, because an analog signal changes gradually rather than jumping instantly.
Digital vs Analog — What the Oscilloscope Showed
| Digital (Push Button) | Analog (Potentiometer) | |
|---|---|---|
| Signal shape | Square pulses | Smooth curve |
| Values | Only 0V or 3.3V | Anywhere between 0 and 3.3V |
| Behavior | Instant jumps | Gradual variation |
| Pin used | D0 (digital) | A1 (analog) |
| Code function | digitalRead() | analogRead() |
Putting both signals side by side made the differences very clear. The button always produced a clean square shape — the signal either jumped to 3.3V or dropped to 0V, with nothing in between. The potentiometer produced a smooth curve that could land anywhere between those two values depending on how far it was rotated.
This also showed up in the code. For the button we used digitalRead() — a function that only returns 0 or 1. For the potentiometer we used analogRead() — a function that returns a number between 0 and 4095, representing the full range of the analog signal. The oscilloscope made it easy to see exactly why those two different functions exist.
🧠 What I Learned
This assignment helped me understand the difference between digital and analog signals more clearly. Seeing the signals directly on the oscilloscope made it easier to relate what the code does with what is actually happening in the circuit. I also learned how basic oscilloscope controls such as VOLTS/DIV, TIME/DIV, Trigger, and Autoset affect the visualization of the signal and help obtain more stable and readable measurements. Finally, I understood that the oscilloscope is useful not only for measuring signals, but also for debugging and verifying how a circuit behaves in real time.
📝 Individual Assignment:
- Use an EDA tool to design a development board that uses parts from the inventory to interact and communicate with an embedded microcontroller.
Designing My Microcontroller Development Board
BRAIN BOARD 🧠
Pre-design Stage
For this week, we had to use an EDA tool to design a PCB that communicates with a microcontroller. Jorge and I decided to use this task as an opportunity to design the PCB for the microcontroller that will be used in my final project. So... I began by identifying the core functions that my project will perform and then determining the necessary components that the PCB should have — both inputs and outputs — to make sure the system works as intended.
We started with a fun brainstorming session to decide which inputs and outputs my main board should include. It was exciting to imagine how each component would interact as part of my final project. After several ideas, we decided to include the following components:
🔹 Outputs
Two servo motors (to control the robot's arms), one Digital Output (for an external actuator or similar), a Display connected through RX and TX, an OLED Screen using the SDA and SCL pins (as an alternative if the main display isn't available), and one LED as a visual indicator during the testing phase.
🔸 Inputs
One Digital Sensor (such as a PIR or obstacle sensor), and one Push Button for testing.
And before jumping into the PCB design using the EDA tool, I needed to understand how the microcontroller connects to each part. This meant checking the function of every pin, identifying which ones provide power (VCC), which ones are for ground (GND), and which pins can send or receive data. I also verified the voltage levels that each device uses — some components work with 3.3 volts, while others require 5 volts.
In the following image, you can see the result of this planning process, where I mapped out each connection before starting the PCB design.
⚙️ Setup Stage
For the design stage, I used KiCad EDA, an open-source tool widely used for electronic design. One of its greatest advantages is that it combines schematic capture, PCB layout, and even 3D visualization of the board within the same environment. It's intuitive, flexible, and completely free, which makes it perfect for learning and professional projects alike. You can download the program from the following link according to the type of computer you have.
Setting Up the Fab Academy Libraries in KiCad:
Before starting the PCB design, it was necessary to configure the official Fab Academy libraries in KiCad. These libraries contain all the standardized electronic components used in Fab Labs around the world, ensuring that every PCB we design can be easily reproduced anywhere.
1. Downloading the libraries
The first step was to download the folder 📁 kicad-master from the official repository: Fab Lab - KiCad Repository. This folder includes everything needed for PCB design in KiCad:
📁 fab.kicad_sym— the symbol library📁 fab.pretty— the footprint library📁 fab.3dshapesand📁 fab.3dsource— optional 3D models
2. Adding the Symbol Library
I opened KiCad and went to 🌐 Preferences → Manage Symbol Libraries. In that window, I clicked 🖰 + and added the file 📁 fab.kicad_sym.

📝 Note: This library allows me to access all Fab Academy standardized symbols directly from the Schematic Editor, making it easier to design circuits.
3. Adding the Footprint Library
I went to 🌐 Preferences → Manage Footprint Libraries and added the folder 📁 fab.pretty.

📝 Note: This step connects each schematic symbol with its corresponding physical footprint, so that KiCad knows exactly how each component will appear and be positioned on the PCB.
4. Verifying the configuration
Once both libraries were added, I verified that KiCad correctly listed them in the Global Libraries section. From this point on, I could select and place Fab components both in the schematic and PCB layouts.
📝 Design Stage
Once the Fab libraries were added, I began creating the schematic in KiCad's Schematic Editor. The first step was to place all the necessary components for my project — including the microcontroller, connectors for the servomotors, sensor, display, digital output, OLED, LED, and button. All these components were taken directly from the Fab library, which I had previously added during the setup stage.
To make the schematic more organized and easier to read, I used Global labels instead of connecting wires directly between components. Those symbols allow the same signal name to be shared across different parts of the schematic, which keeps the design cleaner and prevents overlapping lines. For example, power and ground lines such as PWR_5V, PWR_3V3 and PWR_GND were defined once throughout the entire circuit.
📝 Note: While creating the schematic, I used several basic tools and symbols available in KiCad. Here are three of the most important ones and their purpose:
- Place Symbols — used to add symbols from the library to your schematic. It's the tool to insert new components into your design.
- Place Power Symbols — provides different voltage options that help define the electrical connections in your schematic.
- Place Global Labels — allows you to name a connection so that it links automatically to other parts of the schematic, even if the wires are not physically drawn together.
🔌 Schematic Design
After adding all the components to the schematic, I began connecting them using power symbols and global labels to organize everything clearly. Little by little, the circuit started to take shape, and I could see how each part connected to the XIAO ESP32S3. To indicate the power sources, I used the symbols from the Fab library — such as PWR_3V3, PWR_5V and PWR_GND — so it would be easy to recognize which components worked at 3.3V and which ones needed 5V.
Using global labels helped me avoid having too many crossing wires on the screen, keeping the design clean and easy to follow. Once everything was labeled and connected, I reviewed the schematic to make sure that each pin matched its correct signal and power line. Seeing the complete schematic ready was a very satisfying step before moving on to the PCB design stage.

🔌 PCB Editor
After finishing the schematic, I opened the PCB Editor from KiCad's main menu to start designing the physical board. The first step was to update the PCB from the schematic, using the option found in the Tools menu. This automatically loaded all the components and their connections onto the board workspace.
Before starting the routing, I configured some important parameters in the Board Setup menu. I defined the trace widths, setting 0.4 mm for signal lines and 0.8 mm for the ground traces, since they need to handle higher current. I also adjusted the design constraints, setting the clearance to 0.4 mm — this is essential to avoid spacing errors and ensure that the dimensions don't exceed the milling tool's diameter.
1. Bring in the schematic
In PCB Editor go to 🌐 Tools → Update PCB from Schematic.

2. Configure board rules (Board Setup):
Pre-defined Sizes:
In the Board Setup window, under the Design Rules section, I customized the trace settings for my board. I created two custom trace widths:
- 0.40 mm for the signal traces (standard connections)
- 0.8 mm for the power traces, since they carry more current
Constraints:
I configured the Design Constraints to define the spacing and manufacturing limits of my PCB. I set a clearance of 0.40 mm — especially important when milling the board, since the tool's diameter must fit between tracks without removing unwanted material.
3. Starting the Routing Process
Once all the design rules were set, I began the routing process — the stage where every electrical connection from the schematic is physically drawn on the PCB. For this design, I used a trace width of 0.4 mm for all routes, keeping the layout simple and consistent. While routing, I made sure to avoid 90-degree angles in the traces. Instead, I used 45-degree corners, which help the current flow more smoothly and reduce electromagnetic interference.
As I started connecting the components, I noticed that some traces were crossing each other, which made the layout look messy and difficult to route properly. To fix this, I began reassigning pin connections and rearranging component positions until I found a cleaner and more efficient layout.
📝 Note: In the end, the routing looked well-organized, with smooth connections and enough spacing to ensure a functional and visually clear design.
4. Designing the Board Shape (Edge.Cuts)
For this stage, I wanted my PCB to have a more creative and meaningful shape — not just a simple rectangle. Since this board will hold the microcontroller that represents the "brain" of my little robot, I decided to design it in the shape of a brain. 🧠
To start, I measured the approximate size of the board based on the components' arrangement and space needed for connections. Then, I created the 2D outline in CorelDRAW, carefully sketching the curves to give it an organic look while keeping it functional for fabrication. Once the design was ready, I exported it in DXF format, so I could import it directly into KiCad's Edge.Cuts layer. To do this, I followed these steps:
- Opened the file through
🌐 File → Import → Graphics - Adjusted the scale and set the default line width to 0.2 mm
- Made sure to select the correct layer: Edge.Cuts, since this layer defines the actual border of the PCB during manufacturing.
📝 Note: After importing, I checked that the contour fit properly with the components' layout.

5. Checking Design Rules (DRC)
Once the board outline and routing were complete, the next important step was to run the Design Rule Check (DRC). This tool helps detect any electrical or geometric errors that might cause problems during manufacturing — such as unconnected nets, overlapping traces, or components placed too close to the board edges.
In KiCad, I opened the DRC panel from the 🌐 Inspect → Design Rules Checker menu.
📝 Note: After running the check, the software automatically highlighted a few small issues — mostly traces that were too close or slightly misaligned pads. I carefully reviewed and corrected each one until the message "No errors found" finally appeared on the screen ✅.
6. 3D Viewer — Visualizing the Final Board
With the routing completed and all design rules checked, I opened KiCad's 3D Viewer to see how the board would look in its final form. The 3D Viewer is a powerful tool because it allows you to visualize the PCB with all its components in three dimensions, giving a much more realistic idea of spacing, orientation, and assembly.
When the viewer loads, KiCad automatically replaces each footprint with its corresponding 3D model. Most Fab Academy components already include compatible 3D models, but sometimes a specific part may not be available. In those cases, it is possible to add your own:
- Download or create a STEP (.step) 3D model of the component.
- Place the file inside the
📁 fab.3dshapesfolder. - In the footprint editor, link that STEP file to the corresponding footprint.
📝 Note: Once linked, the component will appear correctly in the 3D Viewer as part of your board.

KiCad's 3D Viewer
Final Project PCB Design
This board represents the evolution of the design started earlier in the course. As the robot project became more defined, it became clear that the first version needed to be updated to better match what the robot actually needs — new components, new connections, and better design decisions. The design process followed the same workflow described above: schematic in KiCad, component placement, routing, DRC, and 3D view.
⚙️ Setting Up the Libraries
For this new version, the component libraries were already configured from the previous design, so most of the work could continue without interruption. However, during the process a KiCad update was available along with a newer version of the KiCad FabLib. To make sure everything was compatible and up to date, the library was reinstalled following these steps:
The KiCad FabLib file can be found at the official repository: gitlab.fabcloud.org. To install it from file, the following steps were followed:
- Go to
🌐 Tools → Plugin and Content Manageror press🖰 Ctrl + M - Click
🖰 Install from File... - Look for the
📁 kicad-fablibzip file - Click
🖰 Open
What Changed and Why
This is not a completely new design — it is an evolution of the first version. Both were designed for the same robot, but as the project became clearer, the components and decisions changed to better reflect the robot's final functionality.
| First Version | Final Version | |
|---|---|---|
| Microcontroller | XIAO ESP32S3 | XIAO ESP32S3 |
| Buttons | 1 (for testing) | 3 (happy, sad, angry) |
| LED | 1 individual LED | LED Ring |
| Sensor | Generic sensor | PIR Sensor |
| Sound | None | Buzzer |
| Display | OLED | New display connector |
| Extra output | Digital output | Removed |
| Power traces | 0.5mm | 0.8mm for 5V traces |
The first version was a starting point — it helped establish the KiCad workflow and validate the basic circuit. As the robot's design became more defined, each component was reconsidered. The single test button evolved into three buttons with specific emotional meanings. The indicator LED became a visible LED ring integrated into the robot itself. A PIR sensor was added so the robot can react to nearby presence instead of waiting for manual activation. The buzzer was incorporated to provide small sound cues and feedback, helping reinforce the robot's interactions. In addition, the trace widths were updated to follow better design practices for power distribution — using 0.8 mm traces for the 5V lines to safely support the higher current required by components such as the servomotors and LED ring.
🔌 The Schematic
The schematic was designed in KiCad connecting all components to the XIAO ESP32S3. Each peripheral has its own labeled connector, making it easy to identify, connect, and disconnect components during assembly and testing. Power is distributed through PWR_3V3 for logic components and PWR_5V for higher power components like the servomotors and LED ring.
PCB Layout & Routing
With the schematic complete, the components were arranged on the board keeping power and signal traces as separate as possible. One important decision during routing was using different trace widths depending on the type of signal:
- 0.4–0.5mm for signal traces (3.3V)
- 0.8mm for power traces (5V)
This is standard practice in PCB design — power traces need to be wider because they carry more current. If they were too thin, they could overheat or fail when components like the servomotors draw current.
Problems and Solutions
Designing a compact board where everything fits cleanly was one of the biggest challenges. Two specific problems came up during routing:
🔸 Traces too close together
When trying to keep the board small, some traces ended up too close to each other. This is a problem because traces that are too close can cause short circuits during fabrication. The solution was to rearrange some components and reroute the affected traces until there was enough clearance — the DRC helped identify exactly where the issues were.
🔹 Reordering pins for cleaner routing
Sometimes the logical pin order in the schematic — for example VCC, GND, OUT — created trace crossings on the board that were difficult to route cleanly. In those cases, the pin order in the connector was changed directly in the schematic — for example to OUT, GND, VCC — so that the traces could flow naturally without crossing each other. It required going back and forth between the schematic and the PCB layout, but the result was a much cleaner design.
🌟 Final Result
Once the routing was complete and all design rules passed, the 3D viewer was used to visualize how the final board would look. All connectors are clearly labeled and positioned around the XIAO ESP32S3, making the board easy to assemble.
The board was designed with a simple square shape intentionally. While the first version had a more creative brain-shaped outline, for this final version practicality took priority — a square board is much easier to mount inside the robot's structure. A complex shape would make it harder to fit, align, and secure the board in place, while a square can be positioned and fixed with minimal effort during assembly.
Final Thought
This week I learned how to use the oscilloscope to observe analog and digital signals in real time, which made the behavior of the circuits easier to understand. I also improved my PCB design workflow in KiCad. Compared to my first board, I was able to make decisions faster and with more intention, especially for component placement, routing, and trace widths. The final result was a cleaner PCB design made specifically for the robot, with all design rules passing correctly and a board shape prepared for easier assembly.

