HTMAA 2023 > Yohan > Week 11

Interface & Application Programming

Polyphonic Guitar Tuner

So I've decided to shift my project idea from the original to the electric bass guitar I started in week 8. Turns out it's not a very good idea to build a food machine in a leaded-totally-not-food-safe-lab environment.

So this week I want to build an interface for the guitar pickups; for now I'll just display the raw waveform but eventually I'd like to implement a polyphonic tuner (strum all strings at once to tune them) built into the guitar. This would be cool because the tuner is (1) impossible to lose and (2) directly wired to the pickup so it's not actually "hearing" its sound and would be possible to tune even amongst a cacophony.

Let's look at the waveform I'm targeting under an oscilloscope.

So I'd like to connect this to the RP2040's ADC (analog to digital converter) but there are two issues: the signal is took weak (peak-to-peak is ~500mV) and oscillates around 0V. The ADC's range is 0V to 3.3V so half the signal would be clamped and the range would be limited. So I need to create biasing and amplifying circuits.

circuit Circuit of what I made

I did this using the TL082 op-amp in an inverting amplifier configuration, AC coupled and biased by 3.3V/2 from a voltage divider. The gain is proportional to R2 and midway-ish in that range is x6 which is my predicted gain.

Also, the circuit is able to be powered using the +9V battery and/or USB-power using a Schottky diode.

pcb PCB of the design

assemble Small components are soldered using hot air

Then, I tested using a signal generator. The RP2040 is printing its readings to serial which is how it gets to my computer.

That looks like a sine wave (expected) to me, at a good bit-depth. Cool!

Eventually this will be miniaturized and placed directly in my guitar, but for now it's just a web interface that talks to the ESP32 over WebSerial.