I am new to the electronics world and trying to figure out how to choose the battery for the circuit.

The circuit consists of an ATMega328P-PU, a DS2321 RTC and a PIR motion detector sensor. It needs 5 volts to operate normally.

Initially, when a button is pressed the circuit has access to power input which automatically starts the RTC, sets the time and powers the PIR sensor through a transistor for a specific duration. During which, the sensor is trying to detect motion (with small delay) and lights up an LED for a duration different than the former. After the detection period is over, the controller enters in deep power down state until a trigger from the RTC wakes it up and from there the controller cycles between detection and sleeping state.

By implementing the above, i was able to reduce power consumption as much as i could.

The circuit for the controller already has a 5V voltage regulator which I can use to power the whole circuit, however, my problem is here, as i am not supposed to go below 5V, i have to use a higher voltage as input but as you guys are pointing out: using a voltage regulator will eat up the battery and then the battery size won't even matter. Thank you for pointing it out since i didn't know about regulators, i only compared schematics and decided accordingly.

If i measure the current draw of the circuit and its in the milliAmps range then would it be safe to use voltage regulator with a drop out voltage of 3-6V?

I updated this post to ask help about choosing a regulator without dramatically compromising the circuit's power consumption.

Sorry for the inconvenience.

  • 3
    \$\begingroup\$ I voted this as "too broad" because there is much, much more to consider when making a circuit work on batteries for a long time than simply choosing a battery voltage. Depending on the regulator that regulator itself might draw so much current that your batteries will be empty soon. A regulator might not even be needed. Configure your ATMega in the wrong way and your batteries will not last long. I suggest that you look at other projects where an ATMega runs on batteries and see what is done there, then do the same thing. \$\endgroup\$ Commented Nov 22, 2019 at 8:57
  • \$\begingroup\$ I have checked options like setting controller to sleep when nothing is being done, i am looking into all the possible tweaks that can be done. Also, the PIR sensor has a transistor to switch it On/Off to save energy when it isn't needed. So mainly, the RTC will be drawing most of the energy since it has to run all the time. After taking these steps i thought it would be helpful to learn how to optimize battery selection. The voltage divider used here is a 7805 TO-220 \$\endgroup\$
    – Fadi Hajj
    Commented Nov 22, 2019 at 10:19
  • 1
    \$\begingroup\$ the RTC will be drawing most of the energy since it has to run all the time. That's a conclusion only a newbee would make, I would do a calculation first. The 7805 you suggest is a really bad choice, without even consulting the datasheet I already know that it will consume more power than the RTC. A 5 Euro digital watch also has an RTC, some run 5 years on a small cell. A properly designed RTC consumes very little power. The 7850 will use more than 10x more power. As I said, this is complex, even engineers with experience struggle with these things. \$\endgroup\$ Commented Nov 22, 2019 at 10:33
  • 1
    \$\begingroup\$ The 7805 requires at least 2.5V more on input than output. Your battery therefore must provide at least 7.5V at all times so that the regulator can work properly. \$\endgroup\$
    – JRE
    Commented Nov 22, 2019 at 11:32
  • 1
    \$\begingroup\$ This is pretty broad with a lot of confounding factors, but I suggest "as long as possible" is not a great specification from which to start. Work out how long you NEED the battery to function, and work hard to hit that mark. \$\endgroup\$ Commented Nov 22, 2019 at 14:22

1 Answer 1


You need to work out a power management strategy: Will each circuit be powered all the time? Can the MCU be put in power-save modes and if so, how often? Should you use extra components to power off power-hungry parts completely? For example, you might be able to only power the RTC and wire it up to power up the voltage regulator at the right times, for a very low-power design. For example, Kevin Darrah on Youtube explains his work with extreme power-saving.

In parallel, you need to make a spreadsheet of the power consumption of each component. This depends on the choice of regulator etc. Look up the current consumption of each component in the datasheet and consider how it contributes to the whole power budget. For example, you will find that a reasonable RTC draws very little current (a few microamps or less). You can use a boost regulator to power from a one-cell battery, or a linear or switching regulator to lower a higher-voltage battery. Each regulator comes with a cost and its own efficiency ratio at the level of current draw that you have.

The battery time in hours will simply be capacity in mAh divided by total current draw in mA.

As you start to see the different design options you have, you will gain some insight into the relative work needed for each design and whether the work is worth your time. It's not possible to outline the options here, as they depend on many factors such as how often you need measurements, acceptable work and cost etc.


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.