Battery power

Hello - I have an ATmega328 on a breadboard that runs some stopwatch code (displayed on 16X2 LCD). I'd like for this to run on batteries. I'm pretty new to this so, I'm looking for some advice and tutoring. As I understand it, I have a couple of options:

  1. Plug in a 9V battery and use a LM7805 to reduce the input from 9v to 5v. I actually did this and it works. But, a 9v battery won't fit in the enclosure I plan to use.

  2. Use 4 X AAA batteries (total of 6v) and use a low-dropout (aka "step-down" or "buck") voltage regulator like a MCP1702 to reduce the input voltage from 6V to an acceptable voltage limit. 4 x AAA batteries will fit in my enclosure.

  3. Use 2 X AA batteries (total of 3v) and use a step-up voltage regulator like Pololu NCP1402, which will convert anything above .8v to 5v.

Which strategy is better? Start off with more batteries and drop the voltage down to an acceptable level -- or start with fewer batteries and boost the voltage to an acceptable level? Using I've read lots of things about using special batteries (NiMH, rechargeables) and not worrying about regulation. However, I can't guarantee that the users of the stopwatch will replace the batteries with specific batteries -- they might use NiMH or alkaline or whatever is available.

Thank you for the help!

The ATmega328 doesn't need exactly 5V. It will run perfectly on less than that. eg. 3xAA will work fine for the CPU.

What clock speed are you using? At 4MHz or less a Mega328 can work right down to 1.8V, eg. 2xAA batteries. See datasheet for graph of voltage vs. clock speed.

The deciding factor is whatever else you have connected to the chip.

You may be able to get away with just a diode (1N4001) between a 6V pack and Vcc to drop the voltage to a safe level for the 328 and peripherals. Check data sheets.

What is "best"?
You can either use a linear product and dissipate the extra energy (dropped voltage*needed current) as heat using a 7805 or alike or you can use a switching regulator which would have an efficiency approaching 1 and hence will give you longer battery life an will prevent extra heating of mother earth :slight_smile: BTW there are 5V switching regulators on eBay for less than $2

how many volts does the screen really need?

Or, just run directly from 3 AA's, that would be 4.5 V which should be enough. It can't hurt to try it.

Thank you all for the replies. Regarding some of the questions in the previous posts:

  1. What else is hooked-up to the chip? I have a 16x2 LCD (model 1602) and it says it needs 5v. There is a foot pedal/switch that is used for stop/start functionality (which is why I built this in the first place... couldn't find a foot switch operated stopwatch already on the market). There's a 3mm LED for the power indicator and a 3mm LED to indicate when the stopwatch is running vs not running. I could eliminate both of the LEDs as I understand now that they use a lot of power. I really only had these on the board as a proof-of-concept visual indicator.

  2. Clock speed: I have a 20 MHz crystal clock. This is probably overkill, but I was concerned about timing accuracy.

  3. When prototyping, I used a 9v battery running through a 7805 regulator (mainly because I was able to find some instructions on YouTube that showed how to do this). Input was about 9V, output was 5V.

  4. After I got everything working, I decided to put this into a case. I swapped the 9V battery for 4 AAA batteries in series. This is running through the same 7805 regulator I was using for the 9v battery. I later learned that the 7805 wasn't designed for this and I was wasting energy and my batteries would drain quickly, etc. Input is 5.8v and output is 4.47v. Everything seems to work OK, but I'm concerned that (a) I'm going to have shortened battery life and (b) I'm doing something stupid.

Here are a couple follow-up questions:

What will happen when my battery pack (of 4 AAA) drains to a point where it can't push the chip and LCD? I assume it will just stop working and the batteries will be "dead" (even though some juice may be left in the batteries). Would a step-up regulator like this one SparkFun 5V Step-Up Breakout - NCP1402 - PRT-10968 - SparkFun Electronics better utilize all of the collective battery power (thus giving me longer battery life)? That step-up regulator says it can work boost 1v to 5v. To me, that means that even when the battery pack gets really low, the stopwatch will still work and when it finally dies, the batteries are nearly depleted. Am I interpreting that correctly?

Thank you again for the help.

Something like this would be better with 4xAA (which will start out at 6V and go down to about 4V):

Brilliant! I think that is exactly what I need!