For my ESP32 project I want to use a NCP1117 3.3V LDO and soon the question came, which capacitors are suitable if the LDO is driven either by USB or a 5V power supply while the cable length is about 2 meters.
From what I understand, the output capacitor is more important than the input capacitor (datasheet, p. 9):
External Capacitors
Input bypass capacitor Cin may be required for regulator stability if the device is located more than a few inches from the power source. This capacitor will reduce the circuit’s sensitivity when powered from a complex source impedance and significantly enhance the output transient response. The input bypass capacitor should be mounted with the shortest possible track length directly across the regulator’s input and ground terminals. A 10 F ceramic or tantalum capacitor should be adequate for most applications.
[...]
Frequency compensation for the regulator is provided by capacitor Cout and its use is mandatory to ensure output stability. A minimum capacitance value of 4.7 F with an equivalent series resistance (ESR) that is within the limits of 33 m (typ) to 2.2 is required. See Figures 12 and 13. The capacitor type can be ceramic, tantalum, or aluminum electrolytic as long as it meets the minimum capacitance value and ESR limits over the circuit’s entire operating temperature range. Higher values of output capacitance can be used to enhance loop stability and transient response with the additional benefit of reducing output noise.
As I am working primarily with 0805 sized SMD components, I think it would be better to use an aluminum electrolytic capacitor instead of a ceramic capacitor, as the latter loses capacity due to its so-called DC Bias. A tantalum one would be also possible, but they are - as far as I know - high sensitive for voltage spikes; aluminum electrolytic ones sound more robust for me. However, I think voltage spikes are not expected from the LDO output (?), more from the input.
Since I assumed that the input capacitor is not so critical, I've chosen a simple ceramic capacitor for it, while for the ouput I've chosen a small 10µF SMD aluminum electrolytic capacitor from Panasonic with 10 to 25V (FK 10/25 R). According to the datasheet it has an impedance of 1.35 Ohm which seems to meet the ESR requirement:
with an equivalent series resistance (ESR) that is within the limits of 33 m (typ) to 2.2 is required
My question is, if my assumption is right, that this small aluminum electrolytic capacitor for the output is a good choice since I have the space left, or if I should also use one for the input.
Schematics
PCB