I am building a sunrise alarm clock. The LED is supposed to get brighter over the course of 30 minutes, then remain fully lit for another 30 minutes, then switch off. I am using a digital pin on an Arduino Pro Mini 3,3V to feed a transistor. The Arduino board will sleep for the rest of the time, saving energy. The device is going to be powered by a single 18650 Li-ion battery, with an additional solar panel to charge the battery during the day (using a TP4056 with additional protection circuit).

This is the rest of the circuit. To protect the LED, I am using an MCP1825 LDO to regulate voltage input. I reason that with this small difference between Vin and Vout, it is efficient enough. I chose the MCP1825 for its low quiescent current and fairly low dropout voltage. (If I am lucky, I might obtain the version with shutdown mode). I might have to replace R1 which I have chosen based on an hfe of 30.

So far I have only tested this circuit without the LDO and battery with a stable 3,3V source (I don't have the other parts yet). It works.

schematic diagram

I have these questions:

  1. Given I am using a battery, I figured there is no input capacitor necessary for the LDO. Is that correct?
  2. If I understand it correctly, an LDO fundamentally acts like a kind of resistor. Does this mean it does not produce any noise and can I therefore do without an output capacitor?
  3. Would the TP4056 (and/or solar panel) introduce noise anyway, which I would have to filter out with capacitors (input AND output)?
  4. Will the caps leak current all the time, wasting energy?
  5. Do you see a way of forgoing voltage regulation or to save energy in any other way in this circuit?

I am trying to understand every single piece of this circuit, but I am still only a beginner. Please let me know of any major flaws in my design and also in the posting of this problem. Thank you.

(I did read the datasheet of the MCP1825 recommending usage of an input capacitor. That does not sound like a necessity though.)

  • \$\begingroup\$ Using any sort of linear regulator is almost certainly wasting energy. I suggest you consider using your Arduino's PWM output to control a switching regulator instead. You'll also get more consistent control over your LED as the battery discharges if you do it right. \$\endgroup\$
    – brhans
    Oct 13, 2018 at 15:53
  • \$\begingroup\$ You may want to take a look at this: onsemi.com/pub/Collateral/NCP5030-D.PDF \$\endgroup\$ Oct 15, 2018 at 2:12
  • \$\begingroup\$ @Misunderstood Thanks a lot, that seems like a handy unit to know about. Unfortunately I can't seem to find a vendor among my usual suspects. But I'll keep the datasheet ready. \$\endgroup\$
    – fertchen
    Oct 15, 2018 at 6:47
  • \$\begingroup\$ I would not be so quick to call this an elegant design. And correct me if I'm wrong, but given what your trying to do, would it not be easier to use your Arduinos PWM to regulate the voltage on an output capacitor which feeds your LED? As the voltage across the LED is will somewhat held, regulating the output voltage will regulate the current through your LED e.g the brightness. \$\endgroup\$ Oct 15, 2018 at 9:51
  • \$\begingroup\$ @sidA30 As I mentioned before I have found an even better solution (electronics.stackexchange.com/a/401164/201113 ). The capacitor idea certainly sounds intriguing, though, and I will think about it and hoepfully learn even more. \$\endgroup\$
    – fertchen
    Oct 15, 2018 at 12:43

3 Answers 3


Answering your questions in order:

  1. and 2. Given I am using a battery, I figured there is no input capacitor necessary for the LDO. Is that correct?

NO, that is not correct. You need both input and output capacitors for the regulator since it is an active device with loop gain. It is not like a resistor at all.

  1. Would the TP4056 (and/or solar panel) introduce noise anyway, which I would have to filter out with capacitors (input AND output)?

It is unlikely to have appreciable noise from a solar panel, but the TP4056 IS an active device and specifies the use of input and output capacitors to control stability.

  1. Will the caps leak current all the time, wasting energy?

YES, caps do leak, but for the values of ceramic caps you need we are talking pA. The self discharge rate of the battery you use is much much larger than the leakage current of the capacitors.

  1. Do you see a way of forgoing voltage regulation or to save energy in any other way in this circuit?

A voltage regulator which tries to hold the voltage at a fixed level IS NOT the way to drive a high current LED. Given you are using a 350mA LED device, it is possible you will be using the short circuit limit in the regulator to drop the output voltage, especially when the LED gets hot.


  1. Use a constant current driver to drive the LED directly from your battery. This will work even though you are using PWM to drive the LED for brightness control. You may be able to get by with just a series limiting resistor for the LED (especially if you are not approaching the 350mA LED limit), but the current will vary as the temperature of the LED increases.

  2. Change the 2N2222 to a FET, it will have a lower on voltage than the VCE(sat) of the transistor at 350mA. Right now the VCE(sat) of the 2N2222 is probably providing the current limitation of your circuit.

enter image description here

Try to understand the datasheet for the devices you use, clearly as shown above, VCE(sat) is the dominating concern at 350mA.

  1. Don't second guess the datasheets. If they specify input an output capacitors, use them. If you are as you say new to electronics, the decisions you make may be poor and you simply don't understand the implications. In this case your understanding of the leakage of ceramic capacitors as a significant problem is a clear indication of your understanding level. You could start by reading this document from Murata.

The worst capacitors for leakage are Aluminum Electrolytic, and here leakage current may be in the uA range, but still not significant for your application.

  • \$\begingroup\$ 1. Thanks. I just learned more about Vce(sat). 2. I read in several places that LDOs are similar to resistors & thought it smelled fishy - but at some point I gave in. My copy of The Art of Electronics is on its way. You have a top book recommendation? 3. I chose the 2N2222 for a specific reason - which I forgot. Yes, I have since started to take notes. 4. I'll have a look at FETs - BS170 seems ok but I'll study first. 5. CC driver seems expensive. I'll tweak the circuit & do some measurements to fit in a resistor instead. It did work so far ... Thanks again, really appreciate your input \$\endgroup\$
    – fertchen
    Oct 13, 2018 at 18:36

To be honest I am curious about why you wanted to use capacitor-less and power saving solution. Low power makes sense on a battery operated circuit but I guess you are going for a green design as well? If you let us know your goals in this regard we can assist you better and maybe recommend alternatives.

First I am excited to tell you that there are legit capacitor-less LDOs. But the best option in this case is to omit the LDO in your diagram and drive the LED through a resistor. You could replace the transistor with a mosfet to save some voltage drops and to utilize your battery better.

To add on capacitor usage, lack of capacitor may cause your LDO to become unstable or oscillate, which will in turn increase the power consumption. Since your load is only an LED, power quality shouldn't be a concern and the LDO will certainly do well in the ballpark.

Solar charging is a whole new matter. The efficacy depends on the physical properties of the solar panel, and other factors. If your solar panel is very small, or is used indoors, you might even need an energy harvester because the voltage output from the panel is so low. If your solar panel is substancial, on the other hand, you need to manage that carefully too.

Also please keep in mind that the extra mile on power savings may not be worth it, as it will be overpowered by your power usage.

  • \$\begingroup\$ My ultimate goal is to understand all of this better - I want to learn. I have been tinkering on and off with electronics for more than 30 yrs but never designed my own circuits. Green is an imprecise term. My reasoning is that every component saved without sacrificing functionality is good. I just want to learn how to design properly. I thought a resistor would be a waste of energy (a bigger one than an LDO and maybe even a potential source of problemes due to heat). As for the extra mile: Consider this move (beyond putting the Arduino to sleep) a valuable exercise. \$\endgroup\$
    – fertchen
    Oct 13, 2018 at 17:42

Thank you for making me do this: Apply first principles thinking.

I need a reasonably bright light to slowly light up. Does it have to be this LED? I took a closer look at the candela/lumen values and it turns out there are plenty of white (and even yellow-orange) LEDs with a rating between 20-30mA which are (on paper) almost half as bright as the superbright one I got. Keeping in mind that even a standard onboard SMD LED on the Arduino Uno is plenty bright (in a dark room) I realized that I never tested my circuit in the dark. So the most elegant solution seems to be to do away with the transistor, save 90% of the energy and power the LED through the Arduino board. It should be able to withstand the stress of one single 25mA LED.

I feel a bit shabby for accepting this, my own answer to my own question. But I suppose it is, for this particular question, the best solution. Thank you all for contributing. I learned something from you and I sincerely appreciate that.


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.