I made an arduino nano IR sensor based auto liquid dispenser. Currently it is being powered by a 12V 2 amps adapter. The 12v adapter is connected to a LM2596 DC to DC buck converter which converts the 12V to 5V and powers the arduino, IR sensor and a regular green LED. Also I am using a RO valve solenoid (rated upto 24V DC) which is being powered by the 12V adapter. So whenever the IR sensor is triggered, the DC motor (5V 200mA) and solenoid (12V 300-500mA) are turned on for 3 seconds.

Now, I intend to power this system via batteries. I am considering the following 3 options.

a.) Lithium batteries in series (4 of 3.7V batteries). But again here I believe things would be complex as I have to make a BMS and charger for this. Is anything available off the shelf so that I can directly integrate the battery and charger with my existing system ?

b.) Connect 8 AAA batteries in series to get 12V. But how long would these batteries last for my application ?

c.) Connect 2 9V batteries in series. Again, can you guys please tell me how long these may last in the system.

Arduino nano I believe consumes 20mA and the IR sensor probably around another 10- 20mA. If it wasnt for the solenoid, I was considering connecting a mobile power bank to power the system.

  • You should check out radio controlled model suppliers. They have the best offerings for batteries and chargers.
    – Majenko
    Jun 14, 2020 at 8:10
  • 2
    The 9V block batteries are out here. They cannot provide enough current to power the solenoid
    – chrisl
    Jun 14, 2020 at 8:58
  • Using AA would give you about 5 days of runtime, assuming it's activated once an hour (24 times a day) and the LM2596 running at 80% efficiency. With AAA you'd only get 2.5 days. Most of the power is used by the Arduino + IR sensor. So putting the Arduino in sleep mode most of the time, would give you a lot longer runtime.
    – Gerben
    Jun 14, 2020 at 14:21

2 Answers 2


I think you should go with 3 lithium batteries in series and for proper balance charging of batteries, you can use an off the shell 3s lithium charging circuit like this here.So you will get 4.2*3 = 12.6V on full charge and on full discharge you will get 3.7*3=11.1v out of the battery.

So still I think your pump motor would work on 11v and ther are chances that your solanoid also work on 11v it will just draw more current then usual.

  • Thank you. As per datasheet (aws.robu.in/wp-content/uploads/2017/09/DATASHEET_ROBU.IN_.pdf), I believe I need to connect 3S1P to get 12.6V. Also, can I charge the batteries simultaneously with a 12V 2A adapter while powering the load ? Also, how do I know when I should connect the charger? How long would my system last with 3s1p combination of 3 18650 batteries. Jun 14, 2020 at 9:22
  • 1
    You should not run a device from batteries whilst at the same time charging the batteries. The charger will have a hard job knowing when the batteries are charged (dv/dt won't work right) and you risk overcharging. For 3S batteries you need a balancing charger otherwise you can end up with a reverse charged cell as the cells discharge unevenly. That will kill your battery. You need an intelligent "In-place" charger that disconnects the battery while it's being charged and powers the device directly from the incoming power.
    – Majenko
    Jun 14, 2020 at 9:39
  • @Majenko As per the datasheet page 3 (aws.robu.in/wp-content/uploads/2017/09/DATASHEET_ROBU.IN_.pdf), I believe this has the power multiplexing mechanism in place as they have connected charger supply and load together. Jun 14, 2020 at 9:49
  • Looks good to me, though that's not a charger, just protection. It should protect the batteries from over/under charge with a dumb charger, which is good.
    – Majenko
    Jun 14, 2020 at 9:51
  • 1
    The protection circuit will disconnect the battery when it's charged.
    – Majenko
    Jun 14, 2020 at 10:14

Consider using a 12V sealed cell lead-acid battery. Those are fairly cheap and easy to find in a wide variety of capacities, and chargers are also simple and easy to find.

A car battery would power your system approximately forever, since they have such huge capacity.

Figuring out how long a given type of battery will last is a simple question of math. Figure out the average current draw of your entire project, in milliamps. (You need to include the power consumed by your voltage regulator. The linear regulators built into Arduinos are quite inefficient, and work by dissipating excess voltage as heat.)

The total power of a battery is expressed in milliamp/hours. (where 1 milliamp/hour is a milliamp of power drawn for a full hour.) If you your system draws 2 amps, or 2000 milliamps average current, and your battery is rated for 2000 mAh, or 2 amp/hours, the battery will last 1 hour.

For battery-powered systems you should think about skipping the built-in linear regulator in your Arduino and instead using a switching regulator and providing regulated 5V directly to the board. Switching regulators can run at 90%+ efficiency, compared to something like 40% - 50% efficiency for linear regulators (I don't have a specific efficiency figure for linear regulators on hand, and it depends on input voltage compared to output voltage. The 40% - 50% number is an educated guess.)

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.