According to this posted answer, Why do many electronics operate on 5 AND 3.3 Volts?, 5v provides better noise immunity than 3.3v so the Arduino Uno with 5v has less problems with a potentiometer in a 5v circuit than the ESP32 with a potentiometer in a 3.3v circuit.
This article from EE Times, Electrical noise and mitigation – Part 1: Noise definition, categories and measurement, has this to say:
The best illustration that can be given of this condition is to
consider where the signal voltage has been and what is happening to it
compared to the noise voltage (see Figure 8.5). In years gone by,
signal voltages may have been 30 V or more but since then have
steadily been decreasing. As long as the signal voltage was high and
the noise voltage was only 1 V, then we had what most instrument
engineers would call a very high signal to noise ratio, 30:1.
Most engineers would say you have no problem distinguishing the signal
as long as you have such a high signal to noise ratio. As the
electronic equipment industry advanced, the signal strength went down
further, below 10 and then below 5. Today we are fighting 1-, 2- and 3
V signals and still finding ourselves with 1, 2 and 3 V of electrical
noise. When this takes place for brief periods of time, the noise
signal may be larger than the actual signal. The sensors within the
sensitive equipment turn and try to run on the noise signal itself as
the predominant voltage.
See this answer Capacitor in circuit for potentiometer?.
From Instructables: Smooth Potentiometer Input
Sometimes, actually in most cases, potentiometers produce a jittery
signal. This can be due to low quality material used to make the
potentiometers. The jittery signal can be very irritating, especially
if you are using the pot to control a sensitive output. That is why
you need to look for a way to make the input smooth.
To smooth out the pot input, you should use a low-pass filter. It
removes all signals that have a frequency that is above the set
cut-off frequency. You determine the cut-off frequency by adjusting
the values of capacitance and resistance in the circuit.
See also Wikipedia topic Low-pass filter
One simple low-pass filter circuit consists of a resistor in series
with a load, and a capacitor in parallel with the load. The capacitor
exhibits reactance, and blocks low-frequency signals, forcing them
through the load instead. At higher frequencies the reactance drops,
and the capacitor effectively functions as a short circuit.
See also De-coupling which notes "Once you get more than a handful of active components together you need to de-couple the power supply. What this is, and why, is described here."
When an otherwise good design works, but is erratic, unreliable or
just goes crazy then nine time out of ten it is the power supply
de-coupling. And you will find that the tenth time, turns out to be
power supply de-coupling as well. So what is it, and why is it needed?
See as well The Ultimate Capacitors Guide: Learn How To Use Them
You can free up GPIO12 so it is just an I/O pin, and not used to determine the flash voltage. This is done by reprogramming the one-time configuration ROM using the espefuse utility, e.g. if the USB link to the ESP32 is on COM4:
espefuse.py --port COM4 set_flash_voltage 3.3V
You can verify the settings using:
espefuse.py --port COM4 summary
I've only done this with GPIO12, but the summary does include a list of parameters that can be changed, which might be useful for your problem.
Best Answer
The linear regulator burns the extra voltage as heat. Example:
ESP32 draws maximum 240mA. Let's use 300mA instead, assuming the ESP32 will draw a bit of extra currents to light LEDs, etc.
At this maximum current, the dropout voltage across the regulator is 5V-3.3V=1.7V, and 300mA is passing through it. P=VI, so this corresponds to 1.7V*0.3A=0.5W dissipated in the regulator.
Note the "3A" in your "5V 3A" power supply is only the maximum current it can provide. This has no influence on the dissipation of your regulator, which depends only on dropout voltage and how much current the load draws.
Of course at lower current it will burn less power.
0.5W means SMD SOT-89 or SOT-223 packages are adequate, with a bit of copper area to cool the tab. In thru-hole, a TO-220 without a heat sink will work fine. A TO-92 regulator burning 0.5W would be quite toasty, and a SOT-23 would smoke.
LM1117 requires an output cap with "ESR between 0.3 Ω to 22 Ω" according to the datasheet, so you have to use an electrolytic cap, say 100µF. The reason for the capacitance is mostly to get an ESR that's low enough to get good transient response. General purpose caps all cost pretty much the same below a few hundred µF anyway.
Usually I use LDL1117, this one works fine with 10µF ceramic surface mount cap, so it makes for a smaller footprint solution. It has a nice fast transient response, and much lower quiescent current than LM1117 too.
You can use a 74HCT logic gate or buffer to translate logic levels from 3V3 to 5V. If you power it from 5V, it will output 5V logic levels, and it will correctly interpret 3V3 logic levels on its inputs. You can check "Vih" in the datasheet, which is the minimum voltage that is guaranteed to register a 1 level on the input, on 74HCT it is around 2V, so no problem to read a 3V3 logic level.
This is not the case for 74HC logic gates, which need 3.5V on the input to reliably register a high logic level when powered from 5V. Usually 74HC will work, because 3.5V is only the limit, so most chips will read 3V3 as a logic high... but it's not guaranteed, and the threshold depends on temperature, so it will probably stop working when it gets too hot or too cold.