I am using an Arduino nano along with an ESP8266. The nano is connected to an OLED display and a keypad. The ESP8266 uploads the data entered from the keypad onto a server. I wish to make the device portable; i.e. add a battery to it so that it can last for at least 8 hours.

How can I calculate the rating for the LiPo battery to use? I understand that it is very important to know the current rating of the devices in use.

How can I make an approximate guess?

  • You don’t guess, you measure. Use a multimeter to get a rough indication. Make sure you measure different states of your program. For example, sending data uses more power
    – Gerben
    Commented Aug 19, 2018 at 15:42
  • if you want to save power, get rid of the nano; the esp can run a screen and keypad directly...
    – dandavis
    Commented Aug 19, 2018 at 19:34
  • I do not possess some of the components with me presently so how can I ?
    – Seb
    Commented Aug 19, 2018 at 20:51

2 Answers 2


Yes, you need to know the average current draw over the period of an hour (or over a period that you then extrapolate to an hour). That is the mAh (milliamps per hour) that your circuit draws.

It can be hard to calculate the actual current, though, since it is always changing depending on what is actually happening in your system at the time. So I would suggest picking up a cheap current monitoring USB dongle from eBay / Amazon / Wherever (one with an LCD screen that gives mAh, such as this one and use that to get the total mAh of your system over an hour.

Multiply that mAh by 8 (the number of hours you want it to run for), and that will give you the minimum mAh for your battery. And then add some more as a safety margin, since the capacity of a battery is subject to many things (like temperature, age, etc), and the rated value is only a rough guide.

For instance, if you find your circuit uses on average 387mAh, then a battery of 3600mAh should be adequate.

  • You should probably have them factor in how long they want the project to remain on while using battery power, instead of just multiplying by 8. I’ve had projects that only consumed 120mAh but had a 12000mAh battery because it needed to last a very long time without charging.
    – Bakna
    Commented Aug 19, 2018 at 16:14
  • The "8" is how long the want it to stay on battery. " wish to make the device portable, i.e. add a battery to it so that it can last for at least 8 hours."
    – Majenko
    Commented Aug 19, 2018 at 16:15
  • Your wording in the answer made it seem that 8 was an arbitrary rule-of-thumb, IMHO
    – Bakna
    Commented Aug 19, 2018 at 16:16
  • Does that read better for you?
    – Majenko
    Commented Aug 19, 2018 at 16:17
  • Much better. I know when I was learning omissions like that confused me.
    – Bakna
    Commented Aug 19, 2018 at 16:19

Current consumption is measured in Amperes, battery capacity in specified in Amperes per hour.

  • So if a device is rated 5V/2A then does it mean that it draws 2A in one hour or 2A instantaneously?
    – Seb
    Commented Aug 23, 2018 at 3:14

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.