Skip to main content
Version: FILS English

the protopedal

An STM32 based guitar effects pedal written fully in rust.

info

Author: Andrei-Tudor Tănase
GitHub Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-protodoatt

Description

This project aims to build a (good sounding) guitar effects pedal in Rust using an STM32F767ZI Nucleo board at its core. The idea is to make use of the STM32's really strong SAI peripheral to get guitar audio from a TI PCM1802 module, process it using the STM then push it back to a TI PCM5102 DAC module. Of course, there are a lot of analog components involve to amplify the guitar signal, and other surronding components to interface with the user.

Motivation

I've recently been into embedded audio, I've had a few projects in the summer where I made prototypes for ESP32 internet radios and such, and upon seeing how much better the STM32 boards are equipped for this sort of workload(because of the SAI peripheral and also the really good clock tree), I thought it's worth a shot. I also saw it has a CAN peripheral, and I figured out a sneaky way to tie it into one of my previous projects.

Architecture

Block Diagram

This is the project block diagram. What's red is sort of optional stuff that I will try squeezing in if I have time.

Log

Week 2-3

I started looking into this early. I looked into how filters are written and how I could design the hardware of the pedal.(Huge credits to Phil's Lab on youtube for both of these) I settled on the OPA2134 as the OpAmp for the preamp job(biased at half supply), decided on my DAC and ADC modules and I also decided on the MCP6022 as a little "temporary" OpAmp that I could use while testing the project powered fully by USB(OPA isn't rail to rail and needs higher voltage to work properly in this case).

Week 4-6

Messed around with writing a simple overdrive filter and setup a really basic version of the circuit on the breadboard. At this time I didn't have a guitar available so I used my portable oscilloscope and function generator to test behavior of the first filter structure. I see that my processing loop(with CMSIS-DSP wherever possible) is down to 1200us. I have approximately 21333us available before my audio stutters so this means the MCU is strong enough to do quite a few filters plus an OLED screen and UI, etc.

Week 7-9

I borrow a guitar, see that the circuit does in fact work with a real guitar, but, as expected, noise performance is not optimal. Couple this with time constraints and Mouser orders being thrown around groupchats left and right, I start designing a PCB to mitigate both issues. It takes a while but I manage to finish my schematics in time for my colleague's Mouser order. After doing that, I start laying out the PCB. I finished it in time for it to hopefully arrive and have time to assemble before the hardware deadline. I will continue developing code on the breadboard prototype in the meantime. The daughterboard isn't ready yet but will be in a day or two

Hardware

The core of the hardware is the Nucleo board. It slots into the main PCB, that houses the analogue front-end and slots for the ADC, DAC, bluetooth and all other modules. This PCB then connects using a ribbon cable to a daughter board that houses the main SSD1306 display, 5 potentiometers and a rotary encoder to navigate the menus(this can be replaced with three footswitches for ease of use). The main PCB uses a sig/gnd/gnd/sig 4 layer stackup to improve noise performance. The power is filtered quite a bit and the OpAmp at the core of the analogue frontend has its own separate 9V line provided by a low noise LDO ic. I routed it as carefully as possible to try and avoid unwanted noise caused by coupling and such. I saw the STM has a MicroSD peripheral so I added a slot cause why not.

Board Picture Front Board Picture Back

Schematics

Schematic Page 1 Schematic Page 2

Please excuse the second page as I haven't cleaned it up yet. Daughter board schematic TBA.

Bill of Materials

DeviceUsagePrice
NUCLEO-F767ZIThe "brains"104 RON
OPA2134PAThe main IC in the analogue frontend32 RON
PCM1802 ModuleThe "digitizer" of the sound38 RON
PCM5102A ModuleThe "de-digitizer" of the sound22 RON
SSD1306The display20 RON

There are of course a lot more components on the PCB and daughterboard, but those are in the BOM files of the PCB.

Software

LibraryDescriptionUsage
ssd1306Display driver for SSD1306Used for the display for the pedal
embedded-graphics2D graphics libraryUsed for drawing to the display
cmsis-dsp-pregeneratedBindings to CMSIS DSPUsed to speed up filters and other DSP math
  1. Phil's Lab
  2. Altium 3DPDF(Open in Acrobat) ...