Week 15: System Integration
Before starting
KINGER is an intelligent assistant. It integrates voice input, audio output and user controls sensing into a single cylindrical device. The system is built around a Raspberry Pi 5 as the main processing unit and a Seeed Studio XIAO ESP32-C6 as a dedicated coprocessor responsible for peripheral control and fast I/O handling.The physical form factor follows a cylindrical body with a rounded base that incorporates a self righting mechanism. All electronics are housed internally, and the device is powered through a combination of USB-C and a battery pack for 5V peripheral distribution.
System Planning
During the planning phase, the following components were selected based on availability, integration complexity, and compatibility with the Fab Lab manufacturing workflow:Raspberry Pi 5
Selected as the main processing unit. Handles audio processing, voice pipeline coordination, and system level logic. Connected via I2S for audio input and output, and UART for communication with the coprocessor.
Seeed Studio XIAO ESP32-C3
Selected as the peripheral coprocessor. Manages NeoPixel LED control, button inputs and low-latency I/O tasks. Communicates with the Raspberry Pi via UART at 115200 bps.
INMP441 I2S Microphone
Digital MEMS microphone selected for its I2S interface, which simplifies integration with the Raspberry Pi's digital audio bus. the unit is configured as a mono (left) for audio capture.
MAX98357A Audio Amplifier
Class D I2S amplifier selected for its direct digital audio input, high efficiency, and compact footprint. Drives a 3W 4Ω speaker directly from the Raspberry Pi's I2S output bus.
Speaker — 3W 4Ω
Downward facing speaker housed at the base of the enclosure. Audio exits through drilled holes in the base plate, projecting sound outward along the surface.
NeoPixel Ring (WS2812B — 16 LEDs)
Provides visual feedback for system state. Controlled by the XIAO ESP32-C6 via a single data line on GPIO2. Powered at 5V from the Raspberry Pi.
Physical Buttons (×4)
Three momentary buttons for Volume Up, Volume Down, action input and a extra button for a future. Wired to the XIAO ESP32-C6 digital inputs with 3.3V pull-up logic.
UART Communication
Serial communication at 115200 bps between Raspberry Pi GPIO14 (TX) → XIAO RX (D7) and Raspberry Pi GPIO15 (RX) → XIAO TX (D6). Enables command and feedback exchange between both processors.
Custom PCBs
Three custom PCBs designed in KiCad and manufactured using the MonoFab SRM-20 milling machine. Designed as a stacked system to minimize internal volume.
PCB Strategy
To minimize internal volume and simplify wiring, the electronic system was organized into three dedicated PCBs designed to be stacked vertically using spacers and screws. This approach centralizes all interconnections and reduces the number of flying wires inside the enclosure.PCB 1 — Raspberry Pi Interface Board
Top board in the stack. Contains the Raspberry Pi connector, I2S signal routing for both microphone input and amplifier output, UART signal lines, and power distribution connectors. Acts as the primary interface between the Raspberry Pi and the rest of the system.
PCB 2 — Common Distribution Board
Middle board. Consolidates all common GND references, distributes the 5V and 3.3V rails to the other boards, and handles interconnection routing between PCB 1 and PCB 3. Eliminates redundant power traces and centralizes ground return paths.
PCB 3 — XIAO Interface Board
Bottom board in the stack. Hosts the XIAO ESP32-C6 module and provides connection points for the NeoPixel data line, and button inputs. Receives power and UART signals from the distribution board above.
Architecture
Communication Architecture
The KINGER system is divided into two processing domains: the Raspberry Pi 5 handles all high level computation, and the XIAO ESP32-C6 manages real time peripheral control. Both devices share a common ground and communicate via UART.Raspberry Pi 5 — Main Processor
Responsible for all high level tasks: audio capture via I2S microphones, audio playback via the MAX98357A amplifier, voice processing pipeline coordination, and system level logic. Controls the MAX98357A directly over the I2S output bus and receives microphone data over the I2S input bus. Issues commands to the XIAO via UART.
XIAO ESP32-C6 — Coprocessor
Handles all peripheral I/O: NeoPixel LED ring control via WS2812B data protocol, and button state reading. Receives commands from the Raspberry Pi and returns peripheral feedback over the shared UART link.
UART Integration
Raspberry Pi TX (GPIO14) → XIAO RX (D7)
Commands and instructions are sent from the Raspberry Pi to the XIAO at 115200 bps. This includes LED control patterns, brightness levels, and other peripheral commands.
Raspberry Pi RX (GPIO15) → XIAO TX (D6)
The XIAO returns button states, and acknowledgment signals to the Raspberry Pi over this line.
Audio Input
The INMP441 digital microphone is connected to the Raspberry Pi's I2S input bus:- Left microphone: L/R pin tied to GND, configuring it as the left channel.
Audio Output
The MAX98357A amplifier receives audio data from the Raspberry Pi over the I2S output bus:- BCLK → GPIO BCLK (shared with microphone input clock)
- LRCLK → GPIO LRCLK
- DIN → GPIO DOUT
- VIN → 5V
- SPK+ and SPK− → 3W 4Ω speaker
User Interface Peripherals
- NeoPixel Ring: DATA line → XIAO GPIO2. Powered at 5V from the Raspberry Pi rail.
- Mute Switch (SPDT): → XIAO GPIO3, 3.3V logic.
- Action Button (Momentary): → XIAO GPIO4, 3.3V logic.
- System Status LED (optional): → XIAO GPIO5, 330Ω series resistor.
- Fan Control (optional): → XIAO GPIO6, via N-channel MOSFET, 5V.
Schematic
The following diagram shows the complete communication and power architecture of the KINGER system, including all connections between the Raspberry Pi 5, XIAO ESP32-C6, audio subsystem, and peripheral devices.
KINGER SYSTEM SCHEMATIC
The schematic above shows the full communication and power architecture. All GND references are common. The Raspberry Pi handles I2S audio input and output. The XIAO ESP32-C6 manages all peripheral I/O. UART links both processors at 115200 bps. Power is distributed from both the USB-C charger (Raspberry Pi) and a 5V and 3A battery pack (5V peripherals).
Electronic Design
Schematic Design
The KINGER schematic was designed in KiCad using the Fab Lab component library. Component selection was driven by interface compatibility: all audio components use I2S to keep the signal path entirely digital from microphone to amplifier. Power integration separates the Raspberry Pi supply (USB-C 5V/5A) from the peripheral battery rail, with a shared GND plane across the entire system.UART routing connects the Raspberry Pi's hardware serial pins (GPIO14/GPIO15) directly to the XIAO's D7/D6 pins. This avoids software serial implementations and ensures reliable communication at 115200 bps. All I2S lines — BCLK, LRCLK, DIN, and DOUT — are routed through PCB 1 to minimize signal path length between the Raspberry Pi header and the audio components.
PCB Layout
Component placement on each board was organized by functional domain. On PCB 1, the Raspberry Pi connector is centered and all I2S and UART signals radiate outward to their respective edge connectors. On PCB 3, the XIAO module is positioned centrally with all peripheral connectors on the perimeter for easy wiring to in enclosure components.Trace width and spacing were set to a minimum of 0.4 mm and 0.8mm across all boards to ensure reliable isolation during MonoFab milling. This value was determined based on previous manufacturing experience where narrower traces caused unintended shorts due to milling tool tolerances. Board dimensions were kept within the MonoFab SRM-20's working area.
Manufacturing Preparation
All three PCBs were manufactured using the MonoFab SRM-20 milling machine at the Fab Lab. Fabrication files were exported from KiCad as SVG files and processed through MODS CE to generate .rml toolpath files for drilling, trace milling, and board outline cutting. The complete KiCad design workflow, MODS toolpath generation, MonoFab operation, and soldering process are documented in the tabbed sections below.Physical Integration
Internal Structure
The internal structure of KINGER is organized as a vertical stack within the cylindrical enclosure. From bottom to top:- Metal sphere: Housed inside the rounded base. Acts as the center of gravity for the self-righting mechanism.
- Speaker (3W 4Ω): Positioned just above the base, facing downward. Audio exits through drilled holes in the base plate, projecting sound outward.
- MAX98357A amplifier: Mounted on the PCB stack directly above the speaker. Receives I2S audio data from the Raspberry Pi and drives the speaker output.
- PCB stack (PCB 1, 2, 3): Stacked vertically using M3 spacers and screws. Contains all signal routing, power distribution, and the XIAO ESP32-C3 module.
- Raspberry Pi 5: Located in the upper section of the cylinder. Provides computational power, manages the audio pipeline, and supplies 5V to the XIAO and NeoPixel ring.
- I2S microphone: Mounted in the top cover, facing upward. Connected to the Raspberry Pi's I2S input bus via the PCB stack.
Enclosure Design
The enclosure consists of two primary components: a cylindrical body and a removable top cover.- Cylindrical body: 3D printed in PLA. Houses all internal electronics. The NeoPixel ring is integrated at a defined height along the cylinder wall or top rim to provide 360° visual feedback visibility.
- Top cover: Removable for maintenance access. Contains the INMP441 microphone positioned with apertures facing upward for unobstructed audio capture.
- Rounded base: Separate 3D printed component forming the self-righting base cavity. Contains the speaker exit holes and the metal sphere chamber.
Packaging and Product Appearance
KINGER is designed to present as a finished consumer product rather than an exposed electronics prototype. The cylindrical form factor, 3D printed shell, and integrated NeoPixel ring create a coherent visual identity that communicates the device's function without exposing internal components.The exterior surface is designed for post-processing: the PLA shell can be sanded, painted, or wrapped in vinyl to achieve a clean, professional finish. The character design derived from a chess piece form gives the device a recognizable and approachable aesthetic suitable for a desktop environment.
Internal organization follows a strict top t bottom hierarchy: microphones at the top, computation in the middle, amplification and speaker at the base. This layout keeps signal paths short, separates audio output from sensitive digital inputs, and concentrates mass at the bottom for mechanical stability.
All ports remain accessible without disassembly:
- USB-C power input is accessible through an opening in the cylindrical body or base.
- GPIO access for development is available by removing the top cover.
- The Raspberry Pi and PCB stack can be fully extracted by lifting the top cover and sliding out the internal assembly.
Integration Challenges
I2S Bus Integration
The KINGER audio subsystem uses I2S for both input (microphone) and output (amplifier), meaning that three separate I2S devices share clock lines on a single bus. The primary challenge is maintaining signal integrity across BCLK and LRCLK when both the microphone pair and the MAX98357A are simultaneously active.Challenge
The INMP441 microphone share the same BCLK and LRCLK lines with the MAX98357A amplifier. Clock skew, capacitive loading, or impedance mismatches on these lines can introduce bit errors or timing failures in the audio stream. Trace length and routing discipline on PCB 1 are critical to preventing these issues.
Internal Space Optimization
The Raspberry Pi 5 occupies a significant portion of the cylinder's cross section. Routing cables from the GPIO header to the PCB stack while keeping the assembly compact requires careful attention to cable length and connector positioning.Challenge
The Raspberry Pi GPIO header sits at one end of the board, while the PCB stack is centered below it. Flat ribbon connectors or short jumper wires must be routed without creating mechanical stress on PCB connectors or obstructing the vertical assembly path.
Port Accessibility
Providing access to the Raspberry Pi USB-C power port and GPIO header without compromising the enclosure's clean exterior finish requires deliberate design decisions:- USB-C access: An opening is cut or printed into the cylindrical body aligned with the Raspberry Pi's USB-C port position. The opening is sized to the USB-C connector footprint to minimize visual impact.
- GPIO access: Available only after removing the top cover. Intended for development and debugging use rather than daily operation.
- Maintenance access: The full internal assembly can be extracted through the top opening of the cylinder after the top cover is removed. No tools are required for normal maintenance operations.
Expected Result
The integrated KINGER system is designed to function as a standalone desktop assistant capable of:- Capturing voice input through digital I2S microphones.
- Processing audio locally on the Raspberry Pi 5.
- Delivering audio responses through the amplified speaker system.
- Providing visual feedback through the NeoPixel ring.
- Accepting user input through physical buttons and the light sensor.
- Operating without external computing infrastructure — all processing occurs on-device.
- Presenting as a finished, self-contained product with a clean exterior and accessible internal architecture.
Integration Summary
KINGER integrates custom PCB electronics, a dual-processor embedded computing system, a fully digital audio pipeline, WS2812B LED feedback, physical user controls, environmental sensing, and a self-righting 3D printed mechanical enclosure into a single cylindrical desktop device. The system architecture, schematic, PCB layouts, and manufacturing workflow were all completed and verified prior to final assembly.
Results
BOARDS