Voltage regulator for ESP32 guitar tuner

Thread Starter

rpschultz

Joined Nov 23, 2022
836
My partner and I (he does software, I'm hardware) have been developing a guitar tuner based on ESP32. Yesterday he sent me this plot from excel of data he captured at 3 diffferent frequencies. Y axis is digital 12-bit (4096). The voltage range is software set, it's somewhere between 1.0 and 3.1v, not sure yet. Wherever it is, the lower part appears to get clipped at about 1/2 the range. This behavior could be the phase inversion from exceeding the common mode input voltage on a TL072 that @Audioguru again hinted at.

1722426421544.png

Here's another plot, barely clipping at the top of 4096.
1722427277373.png
 

Audioguru again

Joined Oct 21, 2019
6,826
An LM358 dual opamp works with a supply as low as 3V and has inputs that work at very low positive voltages. but its input bias current is 6 times too high for your 2.2M and 1M input bias resistors that should be no higher than 360k and 160k.
 
Last edited:

Thread Starter

rpschultz

Joined Nov 23, 2022
836
I'd like to band-pass filter it before it gets to the esp32.
Bass guitar goes down to 40, guitar goes up to mid-300's, mandolin goes up to 660 Hz.
Below is my attempt:
LPF on the right, C1, R4 give a crossover of 589 Hz
HPF on the left, C2, R3 give a crossover of 34 Hz.
Gain may change, but in this configuration it's 47/3+1 = 16.7
Generic op amp in Eagle, I need to do this in spice with a real LM358.

1722446039574.png1722446259600.png
 

Thread Starter

rpschultz

Joined Nov 23, 2022
836
I was looking at this and realized that C3 and R2 also create a HPF. So I got rid of C2 and R3 (see post #27) thinking I didn't need it (and changed C3 to give me the right crossover. But the output went WAY down. Lost like 100 db. What gives?

1722516715104.png

1722516697861.png
 

Attachments

ericgibbs

Joined Jan 29, 2010
21,463
Hi rp,
On your 2nd Sim check the DC level on the +NI input of the OPA and the DC output voltage of 358, without any AC input
E

It helps if you always post your LTS asc file
 

Thread Starter

rpschultz

Joined Nov 23, 2022
836
On your 2nd Sim check the DC level on the +NI input of the OPA and the DC output voltage of 358, without any AC input
It helps if you always post your LTS asc file
OK you might have to help me on this. I ran a DC operating point analysis. Doesn't matter whether AC = 1 or 0, results at v1, v2, v3 are the same:
v1 = 1.48vdc
v2 = 4vdc
v3 = 0.24 vdc
1722517975097.png

Here's my asc file.
 

Attachments

Thread Starter

rpschultz

Joined Nov 23, 2022
836
I think I need C4, I don't remember why. It does something important to do with AC or DC voltage. And I don't understand the value of C2. I understand all the other values... but not C2 and C4.

1722519064096.png
 

Attachments

crutschow

Joined Mar 14, 2008
38,543
Doesn't matter whether AC = 1 or 0, results at v1, v2, v3 are the same:
The AC voltage value is used only for the AC analysis and has no effect on the DC or transient voltage values.
I don't understand the value of C2. I understand all the other values... but not C2 and C4.
C2 and C4 are there because the amp is powered from a single supply and thus is biased above ground to handle ±AC signals.

C2 blocks the DC voltage at the amp input so the input doesn't affect the bias voltage.
Its value needs to be large enough to not attenuate the lowest frequency signal.

C4 blocks the DC output voltage so the output bias point is not affected, and also needs to be large enough to not attenuate the lowest signal frequency.
 
Last edited:
Top