SmartPi Embedded Controller Design

The SmartPi Assistant is an embedded interactive device built around the Raspberry Pi Pico W microcontroller. It integrates a LED matrix panel as the primary visual display, a 3–4 Ω speaker for audio output, and an Adafruit MAX98357 amplifier to drive the speaker with clear sound. The design also accommodates an Adafruit ICS-43434 digital I²S MEMS microphone for capturing voice commands, enabling natural, voice-based interaction. Together, these components form a compact, low-power system capable of displaying dynamic information, responding to spoken inputs, and communicating wirelessly through the Pico W's built-in Wi-Fi—making it a versatile platform for experimenting with edge AI, local sensing, and responsive embedded control.

Why Raspberry Pi Pico W?

The Raspberry Pi Pico W is an ideal choice for the SmartPi Embedded Controller because it combines affordability, performance, and built-in wireless connectivity in a compact form factor. Powered by the RP2040 dual-core ARM Cortex-M0+ processor, it provides sufficient computational power for real-time sensor data acquisition, control logic, and lightweight edge AI tasks, while maintaining low power consumption—critical for continuous operation in field environments. Its Wi-Fi capability enables seamless integration with cloud or local networks for data exchange and remote updates, eliminating the need for external modules. Additionally, the Pico W's rich GPIO interface, extensive community support, and compatibility with MicroPython and C/C++ SDKs make it both versatile and developer-friendly, ensuring rapid prototyping and reliable deployment.

Display Interface: HUB75 LED Matrix Connection

The HUB75 (2×8) connector serves as the standard interface between the Raspberry Pi Pico W and the 64×64 RGB LED matrix panel. It provides a set of 16 data and control lines, including color data inputs (R, G, B), row address lines, latch, clock, and output enable signals, which together allow precise control of the timing and brightness of individual LEDs. The HUB75 interface does not carry any intelligence—it simply maps the Pico's GPIO outputs directly to the LED driver circuitry on the panel. Because the display requires rapid and synchronized data updates to render smooth animations and text, the HUB75 connector offers a convenient and electrically robust way to handle high-speed parallel communication. Using this standardized interface simplifies wiring, ensures compatibility with a wide range of LED panels, and allows the SmartPi Assistant to produce dynamic visual feedback efficiently from the Pico W.

Hardware Implementation: First Prototype

  1. I procured a 6RGB full-color LED matrix panel, with 64x64 pixels and 2mm Pitch from Waveshare.com. These are modular pieces that can be daisy chained together to create larger LED matrices. I liked the idea of modular expandable components.
RGB Matrix P2 64x64 LED panel
RGB Matrix P2 64x64 LED panel from Waveshare
RGB Matrix specifications
RGB Matrix specifications and modular design
  1. I designed a PCB board to interface the LED matrix panel with Raspberry Pi Pico W using the HUB75 standard socket
  2. Created the traces in the layout view
PCB layout traces
PCB layout view showing trace routing and component placement

There were some crossover issues after the manual trace layout, so I dealt with a couple of crossovers using zero ohm resistors as bridges. There were 3 more crossovers to handle. Instead of opting for a 2-sided board (and the more involved milling process), I discussed with Anthony and came up with making 3 holes through which we'd run wires to connect the HUB75 CLK, LAT, and OE pins from the back of the board, using header pins on the Raspberry Pi Pico.

Added a JST connector for power and a switch to turn the device on/off.

PCB Fabrication Process

  1. Created an Eagle 9.x compatible board file (.brd extension) from AutoCAD Fusion
  2. Loaded the .brd file into the Bantam software connected to the OtherMill milling machine
  3. Taped a single-sided board using double-sided tape, ensuring no overlaps (which would mess up the milling if the board is uneven)
  4. Loaded the 1/64" mill bit and started milling the .brd file
PCB milling process
PCB milling process using 1/32" mill bit for larger traces
  1. Clicked "Mill All Visible" with the 1/64" mill bit to mill the finer portions
  2. After fine milling, loaded the 1/32" larger mill bit for fast milling of larger areas
  3. After completing all traces, used the 1/32" mill bit to drill holes and cut the outline
  4. After all this, discovered the board was incomplete—missing the right side Raspberry Pi Pico pins, power points, and the course name text!
Incomplete PCB board
Incomplete PCB board missing right side pins and text
  1. Anthony exported a .gerber file and loaded its constituent parts for the trace, holes, and outline, and restarted the job
  2. This time the milling machine completed the entire board with all pins, traces, holes, outline, and importantly the text with the course and my name on it (except for the JST power pins, which was no big deal)
Completed PCB board
Successfully completed PCB board with all traces, pins, holes, and course text

Assembly and Soldering

  1. Started soldering the Raspberry Pi Pico W onto the newly milled PCB. The Adonstar digital magnifier was super useful for precise placement, ensuring the tiny copper pads were centered correctly.
Digital magnifier for component placement
Digital magnifier setup for precise component placement and inspection
  1. Cleaned my soldering iron with a small amount of solder to get good flow, then put a blob of solder on the bottom left pin. Holding the RP Pico W down, I applied the soldering iron and got one pin securely fastened. After that, it was just a matter of completing the rest.

The digital magnifier was not actually useful for soldering itself—it helped more to inspect the solders and ensure there were no bridges between pins.

Raspberry Pi Pico W soldered to PCB
Raspberry Pi Pico W successfully soldered to custom PCB
  1. Proceeded to solder the zero ohm resistors, which were super tiny and difficult to keep in place. They would move as the soldering iron approached, getting soldered at weird angles. Heating the trace pad again and ever so slightly moving them back into place was challenging. Got all 3 zero-ohm resistors soldered to bridge underlying traces and tested connectivity—all was fine.
  2. Finally soldered the diode from the external 5V Vcc point to VSYS (pin 39), ensuring the tiny (barely visible) arrow mark was in the correct direction. Added the 3 wires needed to avoid trace crossover challenges.
All components soldered
Completed PCB with all components soldered including zero-ohm resistors and diode

Lessons Learned: PCB Design Mistakes

Despite careful planning, several critical mistakes emerged during the PCB fabrication and assembly process. These errors provided valuable learning experiences about PCB design considerations.

1. Inverted HUB75 Connector Placement

Since I didn't have a female HUB75 connector component in the lab, I had to make the HUB75 connector using header pins. Due to the single-sided PCB board, I was forced to solder the header pins on the milled side, with pins sticking out at the bottom. This resulted in wrong (inverted) connections to the display matrix.

2. Missing Power Supply for LED Matrix

The LED matrix needs a 5V power supply with high current capacity. I made no provisions to drive the display board besides powering the Raspberry Pi Pico W itself—a rookie mistake. A 64×64 RGB LED matrix can draw several amps.

3. Poor USB Connector Accessibility

By placing the Raspberry Pi Pico W in the middle of the PCB board, I made it hard to insert the micro USB port. The board should have been designed with the RP Pico at the top edge for easy access.

Key Takeaways

  • Connector orientation matters: Verify that through-hole connectors will mate correctly with their counterpart cables
  • Power budget planning: Calculate maximum current draw early and provision adequate power supply connections
  • Physical accessibility: Place connectors and buttons near board edges
  • Prototype early: These mistakes could have been caught with a cardboard mockup before PCB fabrication

Derisking the Project with Adapter Board

I needed to go to India for 10 days for a meeting and event. I knew the PCB still had power connections and switch to be connected and the HUB75 pins to be tested. It was unlikely all this was going to work in a day. There was also learning the software environment and developing software to test the LED matrix board.

I decided to de-risk the project by using a pre-fabricated RGB Matrix Adapter Board, which I had bought when I ordered the Matrix Board itself. This was a life saver.

Pre-fabricated RGB Matrix Adapter Board
Pre-fabricated RGB Matrix Adapter Board
Adapter board close-up
RGB Matrix Adapter Board close-up
  1. Installed header pins to the Raspberry Pi Pico so it could fit into the adapter board
Raspberry Pi Pico with header pins
Raspberry Pi Pico W with header pins installed
  1. Pushed the RP Pico W with header pins into the adapter board and connected the HUB75 ribbon connector and power supply JST connector
Adapter board connected to RGB matrix
Adapter board connected to RGB matrix with HUB75 ribbon cable and power supply
  1. Connected the adapter card to the RGB Matrix
  2. Connected the micro USB cable to the Raspberry Pi Pico and the other end to my MacBook

Setting up CircuitPython Environment

I decided to use CircuitPython on the RP Pico with the Mu Editor. Setup instructions:

  1. Downloaded the CircuitPython UF2 file
  2. Held down the BOOTSEL button, then plugged the Pico into a USB port
  3. Released the BOOTSEL button after connecting. It installed as "RPI-RP2"
  4. Dragged and dropped the CircuitPython UF2 file onto "RPI-RP2" volume
  5. The Pico rebooted, a new disk drive "CIRCUITPY" appeared—done flashing

Initial Test Program

import board
import displayio
import framebufferio
import rgbmatrix
import time

displayio.release_displays()

# HUB75 + Seengreat Pico adapter pin map
rgb_pins = [board.GP2, board.GP3, board.GP4,
            board.GP5, board.GP8, board.GP9]
addr_pins = [board.GP10, board.GP16, board.GP18, board.GP20, board.GP22]
clock_pin = board.GP11
latch_pin = board.GP12
oe_pin = board.GP13

WIDTH = 64
HEIGHT = 64

matrix = rgbmatrix.RGBMatrix(
    width=WIDTH, height=HEIGHT, bit_depth=5,
    rgb_pins=rgb_pins, addr_pins=addr_pins,
    clock_pin=clock_pin, latch_pin=latch_pin,
    output_enable_pin=oe_pin,
    tile=1, serpentine=False, doublebuffer=True
)

display = framebufferio.FramebufferDisplay(matrix, auto_refresh=True)

palette = displayio.Palette(1)
bitmap = displayio.Bitmap(WIDTH, HEIGHT, 1)
tg = displayio.TileGrid(bitmap, pixel_shader=palette)
group = displayio.Group()
group.append(tg)
display.root_group = group

def fill(rgb_hex):
    palette[0] = rgb_hex
    time.sleep(0.5)

while True:
    fill(0xFF0000)  # red
    fill(0x00FF00)  # green
    fill(0x0000FF)  # blue
    fill(0xFFFFFF)  # white
    fill(0x000000)  # black

The test program worked!

RGB Matrix test program cycling through colors
RGB Matrix displaying HELLO HTMAA
Victory Achieved! The pixels obey my commands!

Adding Voice Interaction Capabilities

Following insights from the MAS.863 classes on input and output devices, I recognized an opportunity to enhance the SmartPi by adding bidirectional audio capabilities. While the initial design focused solely on visual output through the LED matrix, the addition of audio I/O transforms the device into a truly interactive assistant.

This enhancement enables:

I chose to implement a fully digital audio path using the I²S (Inter-IC Sound) protocol. This eliminates the need for external ADC/DAC converters, reduces noise, simplifies PCB routing, and ensures bit-perfect audio transmission.

Audio Output: Adafruit MAX98357 I²S Amplifier

The Adafruit MAX98357 is a digital-to-analog Class-D audio amplifier that converts I²S digital audio into high-quality analog sound capable of driving a speaker directly. The Raspberry Pi Pico W lacks both a DAC and sufficient output power for a low-impedance speaker. The MAX98357 fills this gap by delivering up to 3 watts of power to a 3–4 Ω speaker.

MAX98357 amplifier front view
MAX98357 amplifier front view
MAX98357 amplifier back view
MAX98357 amplifier back view with pin labels

MAX98357 Connection to Raspberry Pi Pico W

MAX98357 Pin Connect to Pico W Notes
VIN VSYS (5V) Power supply 2.5V–5.5V. At 5V can deliver up to 3W into 4Ω speaker (recommended 800mA supply)
GND GND Common ground with Pico
SD GP16 Shutdown/Mode pin. Voltage <0.16V: shutdown; 0.16V–0.77V: stereo average; 0.77V–1.4V: right channel; >1.4V: left channel. Has internal 100K pulldown
GAIN GP17 Sets amplifier gain. Default 9dB (floating). 12dB (GND), 15dB (100K to GND), 6dB (VIN), 3dB (100K to VIN)
DIN GP18 I²S Data In - receives digital audio data for both left and right channels
BCLK GP19 I²S Bit Clock - tells amplifier when to read data on DIN pin
LRCLK GP20 I²S Left/Right Clock (Word Select) - indicates left vs right channel timing. No MCLK required

Audio Input: Adafruit ICS-43434 I²S MEMS Microphone

The Adafruit ICS-43434 is a digital I²S MEMS microphone that captures high-quality audio and outputs it as a clean, noise-free digital signal. Unlike analog microphones requiring external amplification, the ICS-43434 performs analog-to-digital conversion internally and transmits audio data directly to the Pico W over I²S.

ICS-43434 I²S MEMS digital microphone
Adafruit ICS-43434 I²S MEMS Digital Microphone

ICS-43434 Connection to Raspberry Pi Pico W

ICS-43434 Pin Connect to Pico W Pico Pin # Notes
3V3 (VDD) 3V3(OUT) 36 Power supply. Can operate from 1.6V to 3.6V, but logic level must match! Use 3.3V
GND GND 28 Power and data ground
WS (LRCLK) GP22 29 Left/Right Clock (Word Select) - tells mic when to start transmitting. Low = left channel, high = right channel
SCK (BCLK) GP26 31 Bit Clock (data clock) - tells microphone when to transmit data. Should run at 2-4 MHz (can work slightly slower)
SD (DOUT) GP27 32 Data Output from the mic - transmits digital audio data to Pico
SEL GP28 34 Channel select. Default low = transmits on left channel (mono). High = transmits on right channel

PCB Version 2: Integrated Audio Design

Building upon lessons from the initial PCB, I started work on an improved version integrating audio capabilities directly into the board. This second iteration incorporates both the speaker amplifier and microphone interfaces alongside the HUB75 LED matrix connection.

Component Integration

PCB Version 2 schematic
PCB V2 Schematic: Integrated design with audio input/output and LED matrix interface

Two-Sided PCB Design

The routing complexity increased significantly with audio components. A two-sided PCB board was necessary. The final layout uses three vias to route HUB75 connections to the bottom layer.

Design Rules and Improvements

PCB Version 2 layout
PCB V2 Layout: Two-sided design with optimized trace widths and via routing

Milling and Assembling PCB V2

PCB Version 2 milling process

Assembly Process

Fully assembled PCB Version 2
PCB V2 Fully Assembled: All components soldered

PCB Version 3: Addressing Design Issues

After assembling and testing PCB V2, several design issues became apparent during daily use and testing.

Issues Discovered in PCB V2

  1. Fragile Power Connections: Hanging solder wires broke during transport on my bike
  2. Crisscrossing Trace Routes: Forced use of two-sided PCB with complex riveting
  3. Incorrect Microphone Power: Connected to 3V3_EN instead of 3V3(OUT)
  4. Amplifier SD Pin Unconnected: Left hanging, needed GPIO connection for software control
  5. Poor Pico Placement: Middle placement made USB access difficult
  6. Makeshift HUB75 Connector: No keying allowed reverse connection errors

Key Takeaways for PCB V3

PCB V3: Optimized Trace Routing

After carefully analyzing PCB V2 trace routes, I realized that by leveraging physical pin layouts and adjusting component locations strategically, I could achieve much better trace routing that eliminates crisscrossing traces and potentially eliminates the need for a two-sided PCB.

The key insight: PCB routing is about understanding component pin geometry and placing components where their natural pin arrangement aligns with signals.

Hand-drawn PCB V3 trace route redesign
Hand-drawn PCB V3 redesign showing improved trace routing

Complete Pin Mapping: Pico W to HUB75

Pico Pin # Pico GPIO HUB75 Pin # HUB75 Signal Description
2GP115OEOutput Enable
4GP213CLKClock signal
5GP311CAddress line C
6GP49AAddress line A
7GP56B2Blue (lower row)
9GP65R2Red (lower row)
10GP73B1Blue (upper row)
11GP81R1Red (upper row)
12GP92G1Green (upper row)
13GND4GNDGround
14GP107G2Green (lower row)
15GP118EAddress line E
16GP1210BAddress line B
17GP1312DAddress line D
18GND16GNDGround
19GP1414LATLatch / Strobe signal

PCB V3 Milling Process

PCB Version 3 milling process showing improved single-sided routing

Key Improvements in V3 Design

Lessons in PCB Design Philosophy

Placement is more important than routing. Spending time upfront to optimize component placement based on pin geometry and signal flow can eliminate routing problems before they occur. The hand-drawn sketch highlighted how physical prototyping and iteration are essential.

PCB Design Evolution: Learning Through Iteration

The journey from initial concept to final design demonstrates the iterative nature of hardware development. Each PCB version addressed specific issues discovered in the previous iteration, incorporating lessons about power management, component placement, trace routing, and connector design.

Four versions of SmartPi PCB showing design evolution from prototype to final version
Complete PCB Design Evolution: From first prototype to optimized Version 3, showing progressive improvements in layout, routing, and integration

PCB V3: Successfully Assembled and Tested

After addressing all the design issues from previous iterations, PCB V3 was successfully fabricated, assembled, and tested. The improved layout with single-sided routing, proper component placement, and robust power connections proved to be highly reliable.

PCB Version 3 fully assembled with all components soldered
PCB V3 fully assembled: Clean single-sided routing with all audio and display components integrated
PCB V3 successfully driving the LED matrix display with test message
Success! PCB V3 driving the 64×64 LED matrix with clear, stable display output

✅ All Systems Operational: Display, Audio Output, and Wireless Connectivity Working Flawlessly

Key Learnings Across All Iterations

  • V1 (Initial Prototype): Proved concept, exposed fundamental design flaws (inverted connectors, missing power, poor accessibility)
  • V2 (Audio Integration): Added I²S audio capabilities but required two-sided board with complex routing and fragile power connections
  • V3 (Optimized Design): Strategic component placement enabled single-sided routing, proper connectors, and robust power distribution
  • Overall Journey: Demonstrated that thoughtful placement trumps clever routing, mechanical design matters as much as electrical, and real-world testing reveals issues invisible on screen