I want to use Atmega328p controller to handle some very simple signals. I'm using the chip and not the whole arduino board because it is a lot cheaper. The problem is that chip itself doesn't have voltage regulator so I need to think of a rechargeable power source. My idea is to use 3 rechargeable AA batteries (~4.5V). I read that it can handle somewhere from 1.5V to 5.5V but I also read that clock speed is then reduced and a lot other complications. So, finally, the question, If I were to use described power source, what challenges should I be ready to face and how will it impact the performance and is it even possible to pull it off.
From the ATmega328P datasheet:
Within the range 2.7 V – 4.5 V, the maximum frequency is a linear function of Vcc. From this graph, you can compute the minimum value of Vcc required to run the microcontroller at 16 MHz: it's 3.78 V.
If you do want to run at 16 MHz, in order to emulate an Arduino Uno, it may become unreliable once the supply voltage drops below 3.78 V, i.e. 1.26 V per cell. Whether this is a serious issue or not depends on the cell chemistry. For reference, alkalines reach about 1 V at the end of their useful life, and NiCd has about 1.2 V when fully charged. You will have to find the relevant voltage for the chemistry you plan to use.
If you can afford running the microcontroller at 8 MHz, then you will most certainly be safe.
Edit: If you want to run the microcontroller at 8 MHz, and you
are programming it with the Arduino IDE, you have to select a
board/processor combination that runs at 8 MHz. For example,
“Arduino Pro or Pro Mini” / “ATmega328P (3.3V 8MHz)”. This will ensure
that the time-related functions (
delay(), etc.) and the
Serial.begin() provide the correct timings. Other than
that, the drawback of running at a lower clock speed is that the
CPU-bound functions (computations) take twice as long.
They make SEPIC converters that will hold the voltage at 5V for you. The reason for the SEPIC is during charge what happens to the battery voltage and especially if the battery open circuits. If there is no chance for the battery voltage to go to high a boost converter will work just fine. This solution will allow it to run at full speed without degrading performance etc. The new converters are not very expensive and are generally greater than 95% efficient depending on the unit. If you can up the battery voltage things will get a lot more efficient but you would then need to change the boost to a buck, the SEPIC would be fine. I tend to use the China Nanos, they are inexpensive, probably less then your parts and readily available. I have not had problems with them. I like to supply them with about 8 volts via Vin, that gives me the additional filtering of the onboard power supply.