I am developing an ultra-low power audio player. I did another thread on one aspect of it (waking from keypad), but I though this questions should be in its own topic.
All of my components will happily run on raw battery power (bare '328 and audio IC), but the SD card will need a steady 3.3v.
Having a 3.3v voltage regulator is easy, and only enable it when I need to read the wav file, but is there a better way than a level shifting IC for reading the SD card since the '328 pin voltage will be whatever battery voltage happens to be?
Or maybe I'm just over-thinking things and just use a level shifting IC?
Look carefully at the specifications for what is detected as HIGH and LOW. You can usually go 0.5V above the positive supply rail with no problems. If you're using a boost-buck converter to give 3.3V to the SD card and the controller voltage may be below that voltage then 2.8V might (depending on specification) be a valid HIGH.
As discussed in this thread:
https://forum.arduino.cc/index.php?topic=641009.0
SD card modules are widely sold and used which apply 5V to the card's I/O pins while it is powered by 3.3V. Apparently these modules actually work most of the time, despite violating absolute maximums.
You didn't say what battery, but if it's a LIPO, you might power the SD card from the battery through a diode to drop the voltage a little, then just let the I/O pins be whatever they are, with no level shifter.
Or, you could power everything through a single 3.3V regulator. I'm not sure the current draw from the battery would actually be any greater.
But I suspect the big problem is that the SD card will want to use significant power even when doing nothing. I'm talking probably 10mA at least, and that will depend on the brand of card. So you are probably going to want to shut down power to the card completely unless you're playing something - unless you can find a command that puts the card to sleep (I don't think there's a pin that does that).
Hmm
Perhaps a 3.3v regulator with EN option which powers the level shifter, SD card, and the audio amp may be the proper solution then.
Simply have the '328 enable the regulator, delay a couple ms for everything to startup, play the file, disable the regulator, go back to sleep.
To the user, it should all feel instantaneous.
I was planning on stacking a few LR44 ish sized button cell batteries for the battery source, maybe a 2025 or 2032 x2, not sure yet. LR44s are cheap to buy in bulk, and I need to make a couple dozen of these things.
Pololu sells very efficient step up/step down regulators that deal with a wide range of input voltages. You could, for example, run the setup on one or two AA batteries.
You may need to allow 250mS or longer after powerup to allow the card to initialize. The problem is that you have to allow for any brand of card, and they vary a good bit in the elegance of their internal controllers. The same is the case with idle current. Sandisk cards are supposed to automatically go into sleep mode at 350µA, but other brands may not do that - it's not part of the official SD spec. Anyway, you may want to search for some SD datasheets to get a feel for these parameters.