As my first AVR project, I am building a nightlight. The schematic is simple: the MCU (I use an ATTiny85) consults a DS3231 (real-time clock on I²C bus), and depending on the answer, lights up either zero or one of two LEDs on the board (a white one or a yellow one). (I already have a working prototype for this). Ideally, the transition from one LED to the other should be doone smoothly (via PWM).
However I intend to build this as a battery-powered project (Li-Po battery; 3.7 V) and so I would want to minimize power as much as possible.
For minimizing the power consumption of the MCU itself, in addition to the standard tricks (e.g. those listed on www.gammon.au/power) I understand that I could put it in POWER_DOWN sleep mode and rely on the DS3231's alarm to wake it up, via the RESET pin, the next time it has to do anything.
For the LEDs, instead of limiting the current with a resistor I plan to use some variant of a buck converter to step the voltage down to about 1.8-2V. I see three possibilities for this:
(a) I could try plugging directly the LED to an output pin set to PWM (say, in series with an inductor to smooth the current). This uses the fewest parts (and is therefore probably quite efficient power-wise), is slightly risky (but not too much, and LEDs are cheap enough that I can test for the right PWM setting). This prevents me from using POWER_DOWN on the MCU, however.
(b) A “cleaner” variant would use the PWM output to do a proper synchronous buck converter. This uses more parts than (a), and is safer, but could end up more inefficient as well.
(c) Finally, I could also use an independent (asynchronous) buck converter (I hear that there exists some chips that do it), and simply use the output pin to drive the LED via a MOSFET. I would have more losses in the converter, but the MCU would not need to be active and could use a sleep mode.
As a final point, white and yellow LEDs don't have the same V-I characteristic: I probably need to drive the yellow one at about 1.8V and the white one at about 2.4V.
Is there anything obvious I missed?