Choosing capacitors for use with linear voltage regulator AMS1117 - Page 1
Forum section: electronics / beginners

author: matrixofdynamism
author_rank: Regular Contributor
timestamp: June 21, 2023, 06:47:58 pm
content: I am going to design my first CPLD PCB that is only for learning (hobby) purpose. I need some fixed voltage rails. I have decided that AMS1117 series is sufficient and the PCB manufacturer and assembler (JLCPCB) already has it in stock.The question is what capacitors to connect to the voltage regulator. The datasheet can be foundhttp://www.advanced-monolithic.com/pdf/ds1117.pdf.This is given on page 4:"Stability: The circuit design used in the AMS1117 series requires the use of an output capacitor as part of the device frequency compensation. The addition of 22μF solid tantalum on the output will ensure stability for all operating conditions. When the adjustment terminal is bypassed with a capacitor to improve the ripple rejection, the requirement for an output capacitor increases. The value of 22μF tantalum covers all cases of bypassing the adjustment terminal. Without bypassing the adjustment terminal smaller capacitors can be used with equally good results. To further improve stability and transient response of these devices larger values of output capacitor can be used."This means that one should use a 22uF tantalum capacitor. However, there is no mention of any input terminal capacitor anywhere. This brings me to the questions.1. Why is specifically tantalum capacitor specified?2. What if we use electrolytic or ceramic capacitor?3. Is there really no capacitor required on input termal since none is shown in the datasheet?4. How are the capacitor values for input/output terminal of voltage regulator derived?

author: radiolistener
author_rank: Super Contributor
timestamp: June 21, 2023, 09:33:57 pm
content: electrolytic capacitors works bad on high frequency (due to parasitic inductance). Another issue of electrolytic capacitor is that it is polar and doesn't allow incorrect polarity use. Ceramic capacitors works bad on low frequency (due to small capacitance). Tantalum capacitors is something between ceramic and electrolytic, they are more compact than electrolytic and much more reliable.Output capacitor for voltage regulator is according to the linear regulator IC datasheet.Input capacitance depends on the allowed ripple level.

author: matrixofdynamism
author_rank: Regular Contributor
timestamp: June 21, 2023, 09:47:44 pm
content: From what I know, the ceramic capacitors exist for very long capacitance range and electrolytic exist for higher capacitance range. Both of them are made up of different materials which means that the ESR and frequency and temperature response will be different.Now that I am going to use this part, how exactly do I know what actual capacitor value I should put on the PCB?

author: PeteH
author_rank: Unknown
timestamp: June 21, 2023, 10:27:22 pm
content: What's ideal is to put down a ceramic bulk capacitor with a series resistor that aligns well with the regulators required ESR envelope.The AMS1117 isn't a good part to chose for a one off single run hobby board. Spend a few more cents and grab a better LDO from TI/analog(max/Lt), or onsemi/diodes.Tantalums have better ESR stability, electrolytics tend to age worse, have poor low temperature ESR (unless you choose polymer electrolytic).

author: matrixofdynamism
author_rank: Regular Contributor
timestamp: June 21, 2023, 10:46:53 pm
content: The AMS1117 datasheet mentions nothing about ESR for the output voltage pin which is quite unfortunate. What part would you prefer in place of AMS1117? By trying to use AMS1117 maybe I will learn real world experience?I am electronic engineer by the way albiet specializing in FPGA/ASIC designs (RTL and verification) so any experience will benefit in the long run.What alternatie would you recommend? The LM7833?

author: radiolistener
author_rank: Super Contributor
timestamp: June 22, 2023, 03:06:43 am
content: Quote from: matrixofdynamism on June 21, 2023, 10:46:53 pmAlmost any branded linear regulator from branded manufacturer is better than AMS1117. I had some Chinese device with AMS1117, it was burned out due to short circuit, I replaced it with some linear regulator IC from ST in the same package and it works ok, even with long short circuit

author: magic
author_rank: Super Contributor
timestamp: June 22, 2023, 09:29:46 am
content: 1117 regulators are extremely common on Chinese products, which means there is likely a million variants of them being made in China. They may or may not be 100% functionally equivalent, so first of all, ordering from China, make sure you are getting the variant and manufacturer you think you are, for which you have a datasheet.The output capacitor is involved in frequency compensation of many LDOs. It is essentially an AC coupled resistor, which sets desirable phase response and limits voltage gain of the common emitter output stage of the chip, ultimately determining open loop voltage gain and unity gain crossover frequency. Note that output stage voltage gain depends on transconductance too, hence on load current. ESR must be in a particular range for unity gain frequency to be acceptable at all load currents, and this ESR range ought to be documented by the manufacturer. Capacitance must be large enough to present negligible reactance at said unity gain frequency, should be documented too.If the datasheet only says "22μF tantalum" then use such a cap, hope for advice from some actual 1117 regulator experts, or experiment on your own. Be sure to test at all anticipated load currents and temperatures.Sometimes relevant information is buried in "typical characteristics" curves or "applications" section.I have seen several Chinese boards with 1117 regulators and ceramic caps. I don't know what are the conditions for 1117 to work with ceramic caps, and if special 1117 suppliers or special ceramic caps (?) are necessary. Maybe there are consultants in China whose whole life is designing ultimately optimized 1117 voltage regulatorseditNational's LM1117 datasheet says: 0.3~22Ω ESR and 10μF minimum for fixed output regulators, 22μF minimum for the adjustable with ADJ bypass capacitor installed.

author: matrixofdynamism
author_rank: Regular Contributor
timestamp: June 22, 2023, 01:30:50 pm
content: Voltage regulator is not an amplifier right? So what is the meaning of there being a negative feedback like we have with opamps?

author: Vovk_Z
author_rank: Super Contributor
timestamp: June 22, 2023, 01:40:31 pm
content: Quote from: matrixofdynamism on June 22, 2023, 01:30:50 pmVoltage regulator is not an amlifier, but as amplifier it is a device with a negative feedback.

author: matrixofdynamism
author_rank: Regular Contributor
timestamp: June 22, 2023, 01:45:18 pm
content: I have checked the datasheet of the LM1117. I guess I shall go ahead and use this one.In the datasheet it mentions protection diode. This would be required if/when the Vin is shorted to ground in a design which could cause the voltage regulator to get damaged. Why would Vin be shorted to ground? Is this where we are trying to turn off the voltage regulator output? I do not understand. If so, wouldn't the person use the circuit given in the Fig 9-6 instead?

author: magic
author_rank: Super Contributor
timestamp: June 22, 2023, 04:50:31 pm
content: Quote from: matrixofdynamism on June 22, 2023, 01:30:50 pmIC voltage regulators work very much by negative feedback. Output voltage is compared against what it is supposed to be and any deviation from nominal drives the output stage in the opposite direction. We can totally talk about loop gain and things like that.Speaking of opamps, you can imagine that ADJ is IN+, IN- is internally shorted to OUT and there is accurate 1.25V offset voltage.That being said, I was wrong that it's a common emitter output stage. This would be the case in a "real" LDO with 0.4V or so dropout voltage, but 1117 is different.

author: David Hess
author_rank: Super Contributor
timestamp: June 22, 2023, 05:47:44 pm
content: Quote from: matrixofdynamism on June 21, 2023, 06:47:58 pmThe ESR of the tantalum capacitor is high enough to add a zero to the transfer function, which adds phase lead, which increases phase margin, which increases stability.QuoteAn aluminum electrolytic capacitor will also work but will need to be like 4 times larger. A ceramic capacitor will require series resistance to be added to increase ESR.QuoteThe input should have a decoupling capacitor if it is more than a couple inches from the bulk input capacitor.QuoteThe output capacitance is selected as part of the frequency compensation.

author: Jwillis
author_rank: Super Contributor
timestamp: June 22, 2023, 06:10:19 pm
content: Quote from: matrixofdynamism on June 22, 2023, 01:45:18 pmLinear regulators are essentially op amps. Like op amps the input has a high impedance and the output has a low impedance. When a short occurs, the short can have a higher impedance than the output of the regulator. So the capacitor discharges back into the the regulator potentially causing damage. The protection diode has a lower impedance than the regulator output . So the capacitor discharges across the diode instead of through the regulator. This is especially important when the output capacitors value becomes much higher than the minimum 10uf. In the case of the other circuit Fig 9-6 they simply omitted the protection diode. But it still would be a good practice to include the optional protection diode when the output capacitors value is high.

author: David Hess
author_rank: Super Contributor
timestamp: June 22, 2023, 07:28:58 pm
content: Quote from: matrixofdynamism on June 22, 2023, 01:45:18 pmA crowbar circuit would normally be at the input of a voltage regulator so that it can blow a fuse. In this case, that also means shorting the input which will cause large reverse current flow through the regulator destroying it. One or two diodes can be added to protect the regulator in this case.

author: james_s
author_rank: Super Contributor
timestamp: June 22, 2023, 09:05:49 pm
content: Keep in mind that multilayer ceramic capacitors lose a substantial portion of their capacitance when they have a DC voltage across them. This can easily bite you when trying to use one across a power rail.

author: julian1
author_rank: Frequent Contributor
timestamp: June 22, 2023, 09:39:14 pm
content: Depending on the input voltage you're dealing with, TLV761 is < 1USD, and pin-compatible with 1117.It is an ordinary linear regulator (not LDO), so it will have a higher drop-out (1.6V max) but more relaxed around output cap ESR."The TLV761 is pin-to-pin compatible with other fixed SOT-223 regulators.""The device is designed to be stable using low equivalent series resistance (ESR) ceramic capacitors at the input and output."https://www.ti.com/lit/ds/symlink/tlv761.pdf

author: langwadt
author_rank: Super Contributor
timestamp: June 22, 2023, 09:40:18 pm
content: Quote from: magic on June 22, 2023, 04:50:31 pmregular non-ldo linear regulators are emitter follower out, usually with +1V drop from a darlington pair"LDO" like the 1117 are collector output, usually a Sziklai pair. The voltage gain makes it potentially unstable

author: Gyro
author_rank: Super Contributor
timestamp: June 22, 2023, 09:54:39 pm
content: The usage notes on the Chinese UMW AMS1117 on the digikey site indicate that a 22uF Tantalum capacitor is suitable for output decoupling, the same as the original Advanced Monolitic datasheet does. This suggests to me that it is not compatible with low ESR ceramics. Regulators that are stable with ceramic capacitors are still new enough that they tend to linclude it in the feature list on the front page (and inside). I'd be surprised if the LM1117 is either, it's too old.

author: matrixofdynamism
author_rank: Regular Contributor
timestamp: June 22, 2023, 09:59:42 pm
content: For those people that still decide to the use AMS1117, how do they decide the value of the input capacitor?

author: MMMarco
author_rank: Regular Contributor
timestamp: June 22, 2023, 10:07:34 pm
content: Quote from: james_s on June 22, 2023, 09:05:49 pmThere's also an EEVBlog that talks about this if you want to learn more:

author: magic
author_rank: Super Contributor
timestamp: June 23, 2023, 01:13:59 am
content: Quote from: langwadt on June 22, 2023, 09:40:18 pmLM1117 datasheets shows an NPN emitter output, but there is that funky Sziklai driver in front of it.It looks like the output device is essentially a current mirror, which multiplies collector current of the preceding PNP.Anyway, it's not entirely a conventional LDO. And dropout voltage is 1.2V, a little less than two diodes.

author: mariush
author_rank: Super Contributor
timestamp: June 23, 2023, 05:58:40 am
content: So basically, most 1117 regulators require some ESR on the output capacitors.Some versions require ESR between 0.1 ohm and 1 ohm , others recommend between 0.2 ohm and 1 ohm, others are "tweaked" to be stable with ceramic capacitors.For example just a few days ago I pointed this out to someone on reddit.The TLV1117 for example mentions 0.2 ohm to 10 ohm :https://www.ti.com/lit/ds/symlink/tlv1117.pdfQuoting from page 9 : "The TLV1117 is designed to be stable with tantalum and aluminum electrolytic output capacitors having an equivalent series resistance (ESR) between 0.2 Ω and 10 Ω."As an example of regulator that's optimized to work with ceramic capacitors, AZ1117I from Diodes Inc:https://www.diodes.com/assets/Datasheets/AZ1117I.pdfThere's a footprint note on page 2 above "Functional Block Diagram" and brief mention on first page. The note says a minimum of 10uF is recommended, but their datasheet examples show a 22uF ceramic capacitor.Most tantalum capacitors will have around 0.15 ohm or more ESR. Downside is they're expensive, and you have to also be aware of potential of them bursting out in flames on overvoltage.Modern capacitor series can have quite low ESR, but typically electrolytic capacitors in hand picked series (you don't get ultra low impedance series, you can take it down a notch) the 10-100uF range will have ESR above 0.1 ohm. I would use 10uF 35v-50v rated, or 47uF 25-35v rated capacitors if I have to.edit :Oh one more thing... another quirk of 1117 is that the tab is output voltage, which makes it added difficulty to make your circuit board work as a heatsink.*1085 regulators are similar when it comes to this, the tab is also output voltage and they're also sensitive about ESR on output.See for example page 14/27 of this ST LD1085D2M-R DPAK, there's a graph in bottom right corner with stability esr vs capacitance :datasheet (long url)The TI LM1085 datasheet goes into more detail, see page 11 :https://www.ti.com/lit/ds/symlink/lm1085.pdfQuote/ end editThere's so many better linear regulators these days though, it's not worth stressing with 1117 regulators.For example, I've suggestedAP2112 (max 600mA) :https://www.diodes.com/assets/Datasheets/AP2112.pdfNCP176 (max 500mA) :https://www.onsemi.com/pdf/datasheet/ncp176-d.pdfIf you have higher input voltage than 5.5v, it's time for switching regulatorsYou can get regulators like AP62200, AP62300, AP62250 for under 50 cents and they only need an inductor and a bunch of ceramic capacitors and resistors and there's also fixed output voltage versions availablemodel , input min - max , output min-max , current , sw freq , linkap62200 4.2V 18V 0.8V 7V 2A 740kHz :https://www.digikey.com/en/products/detail/diodes-incorporated/AP62200WU-7/10491524ap62300 4.2V 18V 0.763V 7V 3A 750kHz :https://www.digikey.com/en/products/detail/diodes-incorporated/AP62300TWU-7/12702558ap62150 .2V 18V 0.8V 7V 1.5A 1.3MHz :https://www.digikey.com/en/products/detail/diodes-incorporated/AP62150WU-7/13161380ap62250 4.2V 18V 0.8V 7V 2.5A 1.3MHz :https://www.digikey.com/en/products/detail/diodes-incorporated/AP62250WU-7/12349212tps562200 4.5V 17V 0.765V 7V 2A 650kHz :https://www.digikey.com/en/products/detail/texas-instruments/TPS562200DDCR/4733867tps563200 is the 3a version of the above ...fixed output voltageap63205 3.8V 32V 5V - 2A 1.1MHz :https://www.digikey.com/en/products/detail/diodes-incorporated/AP63205WU-7/9858424ap63203 3.8V 32V 3.3V - 2A 1.1MHz :https://www.digikey.com/en/products/detail/diodes-incorporated/AP63203QWU-7/16548045

author: matrixofdynamism
author_rank: Regular Contributor
timestamp: June 23, 2023, 10:46:10 am
content: This is some really great information. I will be watching that presentation from EEVBlog.Regarding the switching mode supplies (and this is going off topic), using them is no as simple as taking a controller IC and stick some components to it since we need to check the control loop stability explicitly using simulation right? This means we can't just take one of these and stick them into our circuit, we need to have a certain skill with SMPS design to use them.Regarding heat sink, it should be straightforward to calculate temperature rise of the IC once we know the power dissipation inside it right?

author: mariush
author_rank: Super Contributor
timestamp: June 23, 2023, 11:15:58 am
content: Quote from: matrixofdynamism on June 23, 2023, 10:46:10 amWith some switching regulator ICs, you do have to use formulas from datasheets to calculate specifications of parts, or compensation networks. With others, like the ones linked above, they're stupid simple to use.The datasheets will give some suggestions on what inductor to use based on input voltage range and output voltage, and the output current, but other than that you don't really need simulating anything.For example, all the chips suggested above are synchronous rectifier switching regulators, which means they don't need a diode to work, only an inductor. Besides the inductor, only ceramic capacitors and a couple resistors are needed to set the output voltage.Because of the high switching frequency (740kHz or 1.3 Mhz) you can use small surface mount inductors which are cheap - if you go with AP62150 or AP62250 which run at 1.3 Mhz you get slightly less efficiency compared to the chips that run at around 740kHz like AP62200 but the ap62200 requires a slightly bigger inductor.You can compare the datasheets :AP62150 :https://www.diodes.com/assets/Datasheets/AP62150.pdf(page 15 for the recommended values)AP62200 :https://www.diodes.com/assets/Datasheets/AP62200_AP62201_AP62200T.pdf(page 17 for the recommended values)TPS562200 :https://www.ti.com/lit/ds/symlink/tps562200.pdf(page 17-18 for the 2A 562200 version, page 22-23 for the 3A 563200 version, only different is inductor valueYou see a 4.7uH inductor is recommended for 5v output in the case of AP62200 , while 3.3uH is considered enough in the case of AP62150 or AP62250The TPS chip's circuit is pretty much the same as the AP* chips, down to the inductor choices - the frequency of 650kHz is close enough to 750kHz that what's written in the TPS datasheet is more or less compatible with the AP* chips.You also have a recommended layout in the datasheets for how to place the chip and the inductor and the capacitors, to keep the loops as small as possible... scroll down to the end of the datasheets and you'll see layout suggestions.

author: matrixofdynamism
author_rank: Regular Contributor
timestamp: June 23, 2023, 12:04:03 pm
content: This is all great info. Your information has certainly helped me since I will be looking into SMPS later this year.For anyone that comes across this post, please look at Texas Instruments Application Report SBVA026F "A Topical Index of TI LDO Application Notes". It contains mentions of other application notes and is a very valuable mine of information.

author: matrixofdynamism
author_rank: Regular Contributor
timestamp: July 01, 2023, 11:18:05 pm
content: I have a new question about linear voltage regulators. A linear voltage regulator will have a certain amount of voltage drop across it. This is necessary for its function. The datasheet will give some typical and maximum value. For the LM1117 is says that for 3.3V output fixed voltage regulator, the Dropout voltage (Vin-Vout) @ Iout = 800mA is maximum of 1.4V. This means that the Vin must be 3.3+1.4=4.7V atleast, for reliable operation. The question then is, what happens if the Vin is actually less than 4.7V, maybe it is just 4.0V. This is still higher than 3.3V atleast but maybe not high for proper operation of the LDO.What happens if the Vin is only slightly larger than Vout or atleast smaller than the typical Vin-Vout given in the datasheet?

author: David Hess
author_rank: Super Contributor
timestamp: July 02, 2023, 12:55:05 am
content: As the voltage across the regulator decreases, it will eventually stop regulating and the output will follow the input.

author: ArdWar
author_rank: Frequent Contributor
timestamp: July 02, 2023, 01:13:16 am
content: Quote from: matrixofdynamism on July 01, 2023, 11:18:05 pmThey usually gradually losing control of the regulation as input voltage draws closer to output. Things like PSRR getting worse, load regulation decreasing (effective output impedance increases). They eventually behave like a resistor, tracking input voltage directly with some drop voltage and series resistance when Vin < Vref.Some "LDO" even loses control of their pass transistor completely (there's a subset of LDO that requires their control circuitry to be supplied by separate higher bias voltage if they're to be operated at very low [~200mV] dropout mode)

author: magic
author_rank: Super Contributor
timestamp: July 02, 2023, 08:32:33 am
content: With 1117 the output will simply be the input minus maybe a volt or a little more, the exact value of "a volt or a little more" depending on load current and temperature.It will continue working and trying to do its best.If the difference decreases below the dropout voltage under given conditions, it will simply stop conducting. Then the output will presumably decrease due to load (unless other regulators are feeding it) and when the difference is sufficient it will start conducting again.If the input voltage goes below the output voltage, an internal parasitic diode becomes forward biased and passes current from the output to the input.

author: paulca
author_rank: Super Contributor
timestamp: July 02, 2023, 08:56:04 am
content: Don't make the mistake I made and put far too much capacitance on the powered circuit.I wanted to "use up" some 6V 220uF caps. So I peppered the circuit power rails with same.Bad idea. With no in-rush limiter the 1117 ... well it did valiantly for about a week running on a current limited PSU that would clickity click when it powered on. Never thought much about it. Connected it to a unlimited, more beefy supply and .... smoke was released as the 1117 tried to charge about 1 mF of capacitance "short".

author: Siwastaja
author_rank: Super Contributor
timestamp: July 02, 2023, 09:13:47 am
content: Quote from: paulca on July 02, 2023, 08:56:04 amWas probably a fake. 1117 has output current limiting and short circuit protection like nearly all linear regulator ICs.

author: langwadt
author_rank: Super Contributor
timestamp: July 02, 2023, 10:17:34 am
content: Quote from: Siwastaja on July 02, 2023, 09:13:47 amor it was damaged by discharging the caps in reverse every time the input was turned off

author: Siwastaja
author_rank: Super Contributor
timestamp: July 02, 2023, 10:22:21 am
content: Yes. Input short / load on input is an issue. Other possibilities include too low ESR and hot-plug ringing causing voltage overshoots.

author: matrixofdynamism
author_rank: Regular Contributor
timestamp: July 02, 2023, 12:09:45 pm
content: Thanks.Now I hope we are reaching end of this discussion now.I want to connect a schottky diode on the input terminal of the LM1117 to protect against reverse polarity. I believe this is the simplest method there is for this purpose. An alternative is a bridge rectifier using 4 schottky diodes that will correct the polarity going into the voltage regulator regardless of the polarity of the input.Lets assume that I select this part: 1N5819WS "40V 600mV@1A 1A SOD-323 Schottky Barrier Diodes (SBD) ROHS" in SOD-323 package from Guangdong Hottech. Thus, one diode drop is 0.6V and two diode drop is 1.2V. Now, the regulator that outputs 3.3V needs atleast 3.3+1.4=4.7V across it. Now, using 1 diode for reverse polarity protection, the input voltage must be atleast 4.7+0.6=5.3V. If I decide to use a bridge rectifier so the input polarity can be in any order, then I need 4.7+0.6*2=5.9V atleast at the input to the PCB.Is my understanding correct?

author: paulca
author_rank: Super Contributor
timestamp: July 03, 2023, 10:28:31 am
content: Quote from: Siwastaja on July 02, 2023, 09:13:47 amThis is quite likely as it was desoldered off a Chinese regulator module I bought 10 of for £4 on amazon!Anyway, it turned out not to be a good match for the circuit anyway. 350-500mA is within the 1117's spec, but it ran very, very toasty. I replaced it with a 3A buck module. Even it overheated, but that was because it was covered with black heatshrink and was sitting in the mid-day sun on the desk! Thought I'd blown it. But it recovered as soon as the "black" heat absorbing cover was removed and it cooled a bit.