Voltage regulator for ESP32 guitar tuner

Thread Starter

rpschultz

Joined Nov 23, 2022
808
Hi

I’m designing a guitar tuner based on ESP32. It will be powered by an external 9vdc. So I need a 5v regulator. Thinking LM7805/340, probably in a through hole TO220 package, 1A seems plenty.

Couple questions.
1. Is LM340-5 the best choice?
2 for powering a TL072 op amp, should I use the 5V or 9v?
3 during development, if I power the ESP32 through USB instead of 9v, this will back power the regulator. Is that bad?
 

ericgibbs

Joined Jan 29, 2010
21,393
Hi rp,
The ESP32 requires ~320mA, so at 9V input to the 7805, you will have 4V * 0.32A =1.28Watts, so it will run warm, especially if other devices are powered by the 5V.

You could consider fitting a diode in antiparallel with the 7805 in order to limit the reverse voltage when in USB power mode.
E
 
Last edited:

Audioguru again

Joined Oct 21, 2019
6,826
The datasheet for an older TL072 says the minimum recommended supply is +5V and -5V for a total supply of 10V. Then some will not work with a 9V supply from a brand new 9V battery.
The recent and new TL072H has a minimum recommended supply of +2.25V and -2.25V for a total of 4.5V.
 

Thread Starter

rpschultz

Joined Nov 23, 2022
808
I'm thinking of mounting the 7805 on the underside of the board, with the ESP32 headers and all other components on the top. I know the regulator is what gets warm. Any thoughts on this arrangement?

1722107769817.png

1722107841994.png
Green = circuit board
White = ESP32 and headers
Red = integrated OLED
 

Attachments

Last edited:

Thread Starter

rpschultz

Joined Nov 23, 2022
808
The datasheet for an older TL072 says the minimum recommended supply is +5V and -5V for a total supply of 10V. Then some will not work with a 9V supply from a brand new 9V battery.
The recent and new TL072H has a minimum recommended supply of +2.25V and -2.25V for a total of 4.5V.
Yes, thanks. I've powered TL072's with 3.3v off a Arduino nano, not recommended but it works. The ones I've been buying lately are TL072IP, says +/- 2.25 or 4.5v. So either 5 or 9 would work. I would think more is better.
 

Thread Starter

rpschultz

Joined Nov 23, 2022
808
You could consider fitting a diode in antiparallel with the 7805 in order to limit the reverse voltage when in USB power mode.
I'm using a 1N5817 as a polarity protection diode. What kind of diode would I use between the 7805 and the ESP32?
 

Audioguru again

Joined Oct 21, 2019
6,826
The ones I've been buying lately are TL072IP, says +/- 2.25 or 4.5v. So either 5 or 9 would work. I would think more is better.
Texas instruments invented and makes TL072A, TL072B, TL072M or TL072H. Who makes your TL072I? The P is the plastic through-holes package.

With your voltage gain of 24.5 times, the opamp output will frequently be clipping with lots of harmonics. you might tune the guitar to one of the harmonic frequencies.
 

Thread Starter

rpschultz

Joined Nov 23, 2022
808
Yeah still fine tuning the gain. Turns out, clipping is not bad for a tuner. Autocorrelation and zero crossing algorithms are just looking at the period/frequency, not magnitude.
 

Thread Starter

rpschultz

Joined Nov 23, 2022
808
The diode would not be between the 7805 and ESP, it would across the 7805, a 1N400x or equivalent would be suitable.
hmm. Ok so:
1. With 9v supply on, no current flows through that diode.
2. WithOUT 9v, the 5v supply from ESP32 shorts it to the top of voltage regulator through diode.

only caveat is that when I’ve measured 5v pin on ESP32, it’s be less than 5v by a bit. Oh well, should be fine.
 

ericgibbs

Joined Jan 29, 2010
21,393
Hi rp,
In some circuits, adding that diode is to protect the 7805 from high reverse voltages.
Consider a circuit where the 9v is also driving some circuitry and the 7805 output has high value capacitors.
At mains power down, the high output capacitors would try to discharge back through the 7805 and the 9v circuit load.
The diode limits this reverse voltage to approx 0.7V as the 5V output capacitors discharge..

E
 

ericgibbs

Joined Jan 29, 2010
21,393
Hi rp,
Looks OK to me, I would add the usual 100nF on the 7805 input as well as the output, ensures stability of the 7805. Mount the 100nF's close to the 7805 pins.

E
 

Audioguru again

Joined Oct 21, 2019
6,826
A TL072CP is tested with a minimum 10V total supply voltage to work properly within a temperature range of 0 degrees C to 70 degrees C.
A TL072IP is tested with a minimum 10V total supply voltage to work properly within a temperature range of -40 degrees C to 85 degrees C.
The new H version is tested with and works with a minimum 4.5V total supply voltage.
 

Thread Starter

rpschultz

Joined Nov 23, 2022
808
So seems like I have the wrong op amp to be powered 0-5v from a usb. The LM358 might be better at this lower voltage.
 
Top