0
\$\begingroup\$

I´m designing a PCB based on an ATtiny85 and an I2C sensor with an LDO. I´m using a Digispark board for testing the code.

The schematics below of the Digispark PCB has decoupling capacitors (C1 and C2), that have to be put as close as possible to the +5 V and GND of the MCU, and it´s really well explained in this post: Digispark capacitors and diodes, but there are no capacitors on the input and output of the 7805 LDO (circled in blue).

Digispark Schematics

Do those two decoupling capacitors in the schematics (C1 and C2) "replace" the one needed on the LDO´s output? Why then is there no capacitor on the input of the LDO?

I´ll use a 7.4 V Lithium battery to power the ATtiny through an LDO. Should I add two capacitors (input and output) on the LDO besides the two already in the Digispark schematics?

I´ll probably use no more than 50-100 mA current draw, and I won´t use the USB diodes and stuff. I´ll program using ISP.

Edit: The LDO I´ll use is an AMS1117 5V, not the 7805.

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

The 78M05 shown in that schematic is not an LDO (low-dropout regulator). It has a dropout voltage of at least 2V and will therefore be unable to provide 5V when powered from a 2S lithium-ion battery. (The 78M05 needs at least 7V, while the battery will go below 6V depending on state of charge)

You will need to use a different voltage regulator - an actual LDO.

The 78(M)05 is a bit special; it's extremely stable under most conditions and can operate without any bypass capacitors at all. This is likely why they've been omitted - the 78M05 simply doesn't need any.

When you choose an LDO, pay close attention to the size, type, and ESR of the output capacitor that it requires. LDOs are much more sensitive than 78xx regulators and will quickly start to oscillate if the output capacitor is wrong. You'll also need a low ESR input capacitor to ensure stability (combination of ceramic and low ESR aluminium polymer, for example). Note also that there is a minimum ESR requirement for the output capacitor on some LDOs, as well as a maximum. Tantalum polymer capacitors are often a good bet.

Edit: Now that you mentioned which regulator you're using, I can give some better recommendations.

First thing: Don't use the AMS1117. This regulator is a clone of the LM1117, and its datasheet does not give the necessary characteristic data to ensure proper operation. In particular, it doesn't specify the capacitance and ESR requirements of the output capacitor. If you add the wrong type or wrong value of output capacitor, it'll just start oscillating... And the manufacturer doesn't tell you what capacitor you need. Stay clear of that thing.

Instead, I'd recommend you to use the LM1117. Unlike the manufacturer of the AMS1117, Texas Instruments does tell you what kind of output capacitor you need to stabilize the LM1117: You need a 22µF manganese dioxide tantalum capacitor (or bigger). Its ESR should ideally be between 0.5 Ohms and 2 Ohms. The ESR must not be lower than 0.3 Ohms. A tantalum polymer or aluminium electrolytic capacitor will not work at the output of the regulator. These kinds of capacitors have unsuitable ESR characteristics.

The input capacitor should be a low-ESR aluminium or tantalum polymer type, ideally in parallel to a 1µF X7R ceramic cap. (Unlike the output cap, the input cap's ESR should be as low as possible.)

\$\endgroup\$
5
  • 1
    \$\begingroup\$ I forgot to add that I´m using an AMS1117 5V LDO regulator, that can handle lower than 7V as Vin. Could this one be used? I´ll need to add the Vin/Vout capacitors then, right? \$\endgroup\$
    – Rodrigo
    Commented Jan 5, 2023 at 3:36
  • 2
    \$\begingroup\$ This is important, so add it to the question and also read the datasheet for the AMS1117, particularly the bit that says "The circuit design used in the AMS1117 series requires the use of an output capacitor as part of the device frequency compensation.". \$\endgroup\$
    – Tesla23
    Commented Jan 5, 2023 at 7:15
  • 1
    \$\begingroup\$ Good points about the AMS1117 and cap ESR range. It is true that LDOs of that era are basically meant to compatible with tantalum caps. However common techniques to allow usage of modern ceramic caps include putting them slightly away from the output or just adding a suitable series resistor to bring ESR up. \$\endgroup\$
    – Justme
    Commented Jan 5, 2023 at 18:09
  • \$\begingroup\$ Just to clarify some things for me: The manganese tantalum is the same as a solid tantalum capacitor? In the input, which value of the tantalum polymer would be good to put in parallel with a 1uF X7R ceramic cap? Also, those two caps (in the Digispark diagram - C1 and C2) are still needed, with these 3 caps? (Tantalum in the input, tantalum polymer and ceramic in the output) ? \$\endgroup\$
    – Rodrigo
    Commented Jan 5, 2023 at 21:19
  • \$\begingroup\$ There are many types of solid tantalum capacitors, you specifically need a manganese dioxide (MnO2) type. C2 from the original circuit diagram is no longer needed, it gets replaced with the MnO2 tantalum cap. C1 remains, it's the microcontroller's bypass cap. To summarize... Input: 22µF tantalum polymer + 1µF ceramic. Output: 22µF MnO2 tantalum (not polymer!) + 100nF ceramic at the microcontroller (C1). \$\endgroup\$ Commented Jan 6, 2023 at 19:49
3
\$\begingroup\$

In short, there is no cap to cut parts and cost, because mostly the board can work without it.

It slightly depends on which exact 78M05 that is and which manufacturer datasheet you are reading.

Even if the 78M05 is a bit special and is said to work without any bypass caps, it means only when conditions are right. Datasheets say that the device is stable without bypass caps, but it literally means nothing if the environment is uncontrolled.

The datasheets still say the input bypass capacitor is recommended or even mandatory, if there is no other capacitance at all, or if there is a long wiring from regulator to the next capacitor, and that "long" basically is said to be 4 inches, which is not that long.

The datasheets do say the output cap can be omitted, but even that requires that the load has no large changes in current.

Well, the MCU is a changing load. It virtually draws no DC current and if MCU runs on a 8 MHz clock then it draws current in 8 MHz spikes, so obviously even per the datasheet the output cap cannot be omitted in this case.

So fortunately the LDO has output bypass caps. And your LD1117 design should have both input and output caps. A capacitor can be omitted if some other capacitors are nearby and can be shared.

So this DesignSpark board is just copying a design that has bare minimum of components for making it work.

But please note that the design is rather dangerous in many ways. If you provide it with external 7V supply and let the regulator provide 5V to the MCU, please note that the board must not be connected with PC through the USB connector.

The board will feed supply current into PC via USB, the diode is drawn the wrong way. If the PC is turned off, it tries to force feed 5V supply into PC, and it might fry a fuse or something else in the PC.

Same thing with the 5V MCU communicating with 3.3V USB data lines protected only by zeners and series resistors. That is living dangerously, one slight mishap and you risk shorting 5V to USB data pins.

But such are hobbyist circuits, bad designs become popular and copied around with no criticism, and users have no clue how careful they should be with a design. I mean, same carefulness should be used if you found an USB stick from a parking lot, you must consider if you trust it so much you will plug it into your PC.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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