4
\$\begingroup\$

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

enter image description here

PCB

enter image description here enter image description here

\$\endgroup\$
7
  • \$\begingroup\$ Note that tantalum capacitors are also electrolytic. When you compare "tantalum" to "electrolytic", what you are actually talking about is the difference between tantalum electrolytic and aluminum electrolytic capacitors. \$\endgroup\$
    – Hearth
    Commented Jun 16 at 16:30
  • \$\begingroup\$ Just to be sure, why does it have to be NCP1117? Why not use a moderm regulator that can simply take ceramic caps without issues? \$\endgroup\$
    – Justme
    Commented Jun 16 at 16:31
  • \$\begingroup\$ @Hearth Oh! Thanks, I'll update it accordingly. // Justme: I don't know a modern small regulator unfortunately. For me as beginner I research what other people use and many use a AMS/LM/NCP 1117, so that is the only reason so far. \$\endgroup\$ Commented Jun 16 at 16:34
  • \$\begingroup\$ @Tintenfisch I recommend browsing the regulators category of your distributor of choice. The 1117, especially the AMS1117 you mention in your comment, is pretty outdated and not a very good choice. \$\endgroup\$
    – Hearth
    Commented Jun 16 at 16:36
  • 1
    \$\begingroup\$ Also, the input cap may not be important for the regulator, but remember you have long USB cord with inductance and people hotplug it - it may be important for the application. And yes, everyone keeps using 1117 and clones even if much better chips exist and some of 1117 clones are better left unbought. But it's cheap and available, that's the problem with cargo culting, but often you spend a lot of time money and effort just to find suitable caps for the cheapest possible regulator. \$\endgroup\$
    – Justme
    Commented Jun 16 at 16:38

3 Answers 3

8
\$\begingroup\$

ESP32 draws microamps in sleep mode, then current quickly jumps to >500mA when transmitting on wifi.

These large and fast changes in current mean it is important to have both a low ESR capacitor and a fast transient response LDO to keep voltage ripple down.

The common ESP32 modules include a slow "not really low dropout" AMS1117 and a high ESR tantalum cap. On these boards I often experienced crashes related to voltage dipping when coming out of sleep.

Hearth said in the comments: "The 1117, especially the AMS1117 you mention in your comment, is pretty outdated and not a very good choice."

I agree, and on top of that NCP1117 has high idle current of 5-10mA, and high dropout of 1-1.2V which is not what you want with a long USB cable and a diode in series.

Suppose the source 5V is on the low tolerance limit so 4.5V, the LDO is on the high dropout tolerance so 1.2V, we're already at 3V3 with no room to spare for voltage drop in the cable and the diode.

ST makes LDL1117 which carries the name probably because it is pin compatible with the old 1117's. But it's not the same chip at all, it's a modern LDO compatible with ceramic caps, with decent low idle current, fast transient response, much higher performance overall... Also I have inadvertently tested the short circuit protection both on AMS1117 (it burned) and on this one (no issue as expected).

On the ESP32 modules I replace the AMS1117 with this one, then replace the output tantalum cap with 10µF MLCC, and leave the 1µF MLCC on the input. It works absolutely fine, these ESP32's have been running 24/7 for years with zero crashes.

The inconvenient bit about the 1117 pinout is the tab, which is used for conducting heat out of the chip, is also the output pin so you can't use the ground plane as a heat sink. You need either a bit of copper pour connected to the output voltage, or a power plane. So it's not ideal if you want a tiny board, SOT223 is also quite large. But if you don't mind the square centimeter of board space, it's fine.

\$\endgroup\$
5
  • \$\begingroup\$ Very interesting. Unfortunately the LDL1117 is not easily available for me, do you think the MCP1825S would be a good choice? When I understand the datasheet correct, it has only 0.21V dropout on 500mA: cdn-reichelt.de/documents/datenblatt/A200/MCP1825-FAM.pdf \$\endgroup\$ Commented Jun 16 at 22:04
  • 1
    \$\begingroup\$ Yes it's a good choice, and the tab is ground which is better for cooling, just add a few vias to the ground plane to conduct heat. 10µF MLCC on the output should be fine. For the input you can use 1µF MLCC and/or a 22-100µF aluminium cap which will avoid the hotplug voltage spike talked about in the comments. \$\endgroup\$
    – bobflux
    Commented Jun 16 at 22:12
  • 1
    \$\begingroup\$ Oh, just noticed it that the tab is actually GND for the MCP1825S. Indeed great, because when designing the PCB I was already thinking what to do with that. According to the hotplug voltage spike, is that caused by the 10µF MLCC on the output as it would cause inrush current? I didn't yet understand that issue. \$\endgroup\$ Commented Jun 16 at 22:17
  • 1
    \$\begingroup\$ It's the LC resonant circuit formed by wire inductance and low ESR capacitor like MLCC at the input of the LDO (not output). To avoid a spike it needs to be damped by resistance, a good method is to use a capacitor with high-ish ESR like "general purpose aluminium" at the input. For example you can use 100µV 16V and 1µF or 100nF MLCC in parallel. \$\endgroup\$
    – bobflux
    Commented Jun 17 at 6:47
  • 2
    \$\begingroup\$ To add to your note about the tab not being ground: it's worth knowing that thermal jumpers exist. These are just blocks of aluminum nitride (a highly thermally-conductive ceramic) with surface-mount terminals, that can be soldered between two copper planes to conduct heat but not electricity between them. They're not too cheap, so usually not worth it, but they do exist. \$\endgroup\$
    – Hearth
    Commented Jun 17 at 13:47
4
\$\begingroup\$

You can use a ceramic capacitor but put a 1Ω or so resistor in series with the output capacitor to get the ESR under control, and make the nominal value higher to compensate for loss of capacitance with voltage.

For example, the Murata GRM219R60J106KE19 0805 10uF/6.3V X5R capacitor has a capacitance loss of only about 1/3 at 3.3V (image generated by Murata's online program):

enter image description here

Even with additional loss from temperature etc., you'll be safely in the 4.7uF range. Some caps can be left with <20% (>80% loss) of capacitance just from voltage bias alone, so best to check the actual specifications.

That would also be suitable for the input capacitor so you could reduce the PCB area and BOM items.

There's not much out there that can compete price-wise with the AMS1117 parts if you want high input voltage, SOT89 or SOT223 package and high output current capability, are okay with the dropout voltage and don't care too much about Iq. USB-powered 3.3V applications fit this bill (the high input voltage is not required but nice to have).

OTOH, if you only need a low current, there are boatloads of SOT23 LDOs that are possible alternatives.

Note that some parts which are stable with 1uF ceramic output capacitors may not be stable with small electrolytic caps, eg. MCP1824, which requires ESR < 1Ω. ESR of aluminum electrolytic capacitors tends to increase as they age, and sensitivity to ESR is different depending on conditions such as output current so there's a possibility of interesting failure modes.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks 🤗 I will also have a look to the MCP1825, I think I can get it relatively cheap, seems quite modern, right? \$\endgroup\$ Commented Jun 16 at 21:30
0
\$\begingroup\$

If you use 0805 ceramic capacitors and up-size them (in capacity) a bit to compensate for the expected DC bias effect and the tolerance, then you could probably use a ceramic capacitor successfully. The last time I used this regulator, I recall putting a tantalum cap on the output. I do echo everyone else on using a more modern regulator however.

Since you are using a relatively long cable to provide input power, the electrolytic capacitor would be of more use on the input in parallel with the existing ceramic capacitor to suppress input overshoot as described in this app note.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Using a larger voltage and larger capacitance ceramic on output will compensate for the capacitance drop under DC bias, but it won't compensate for the much lower ESR of the capacitor what the regulator needs for stability. \$\endgroup\$
    – Justme
    Commented Jun 16 at 19:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.