Powering Arduino With a Battery

485,503

355

74

Introduction: Powering Arduino With a Battery

About: I post updates on twitter and instagram: @amandaghassaei

Make your Arduino projects portable by using a battery for power. From the Uno and Mega documentation pages:

"The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts."

I've found that using 9V works well. You can simply connect the + end of your battery to Arduino Vin and the - end to Arduino ground (fig 1). You should see the green light on the Arduino turn on to indicate that it is powered.

It's also a good idea to attach a toggle switch in series with this battery so that you can turn your Arduino off and on. As shown in the images above, solder a toggle switch to the red lead from the 9V battery connector. Connect the black lead from the battery connector to one of the Arduino's ground pins, and connect the lead from the toggle switch to Arduino's Vin pin. Snap a battery to the connector. Now your Arduino will turn on when the switch is closed and turn off when it is open (figs 5 and 6).

Parts List:

(1x) Arduino Uno Amazon

(1x) 9V Battery Amazon

(1x) 9V Battery snap connector Amazon

(1x) toggle switch Amazon (this one is a little different that that pictured, but it will work the same)

Alternatively, you can find these 9V snap connectors with the same n-tye barrel plug as the Arduino and plug into the barrel socket on the Arduino directly:

(1x) 9V battery snap connector to barrel plug Amazon

Electronics Tips and Tricks

Participated in the
Electronics Tips and Tricks

7 People Made This Project!

Recommendations

  • Battery Powered Contest

    Battery Powered Contest
  • Plywood Challenge

    Plywood Challenge
  • Plastic Contest

    Plastic Contest

74 Discussions

0
zstevensonz
zstevensonz

Question 3 months ago

Hi! Lets say that I create and run a thermometer program on my Arduino Uno using a 9V battery as the power source. How do I access the data when I plug the Arduino back into my computer? (I do not have a SD card available) Thanks!

0
TylerM185
TylerM185

Question 2 years ago on Introduction

I'm currently researching and looking at ways to do my college engineering project and this is exactly how I was to go about powering it, kinda. Question though, I'm looking to use a 12V solar panel to charge a 9V battery. Is there anyway I can pull off hooking a solar panel to the battery and use a battery snap connector/DC power plug snap connector?

Just to reference for any answers/replies, I'm not the most adept with electrics, but I'm having to/wanting to learn so I can know it and graduate.

0
alberto7
alberto7

Answer 1 year ago

You're going to need some way to step it down from 12V to 9V.
The better way to do this is to get a charge regulator or voltage regulator for it. That'll convert from 12V down to 9V. Reason why I'm saying charge regulator is that I don't know the type of battery that you're using, and kinda don't want a lipo to go boom somewhere...
A quick and dirtier way to do this is to stick diodes in series. Not recommended, but diodes are dirt cheap, and if anything's going to fail in the system, as long as the voltage doesn't go above 9V, it's likely to be those.


The other way is to get a battery at 12V. The Arduino can take anywhere between 6-20VDC (if we're pushing it to the limits).

0
TylerM185
TylerM185

Reply 1 year ago

I was beginning to wonder if I would've posted a question on an older forum that would've not gotten seen. I see the logic behind using a regulator to lower heat throughout the battery/system (that what I'm thinking at least.) I'm just wanting to make a smaller system, but I was planning to use a battery like:https://www.amazon.com/EBL-Rechargeable-Batteries-... and charging it w/ a solar panel.

I'm approaching this as someone whose challenging myself by not knowing electrics too much. With that said, if I end up using a regulator between a solar panel and the battery to control the voltage, is there one you'd recommend? Maybe any insight on how I may approach putting that between both of them?

Thanks again for the advice, it's given me quite a bit to think about in terms of my design.

0
alberto7
alberto7

Reply 1 year ago

No worries. Happy to help. :)

The purpose of the regulator is to step down the voltage from 12V (from your solar panel) to 9V (what your battery uses). Applying more voltage than the battery supplies permanently damages the battery (you can charge up to the battery voltage, but not exceed it), so it has less to do with thermal efficiency and more to do with making the battery blow up. That's especially the case with Lithium batteries like the one you linked.

So, let's say that you're using the 12V solar panel and the 9V Lithium ion batteries you've linked. You're going to need a way to:
1. Step down (buck) the voltage from 12V to 9V, and
2. Regulate the charge to the battery (so it stops charging when the battery is full - prevents overcharging).

One way around that is to use a solar charge controller for charging lithium batteries:
https://www.ebay.com/itm/Lithium-Battery-Charging-...
But you will need to measure the output voltages first with a multimeter. I don't see any other visual indicators telling you the voltage (the downside of these non-indication devices).

Another way is to break it into two components: one for the stepping down the voltage (https://www.pololu.com/product/2884, or use a 9V solar panel), and a 9V battery charging regulator.

Speaking of a charging regulator, what were you planning on using to charge the 9V batteries (are you just using connectors, or do you have an existing charging device?). Why I'm asking: you could just hook this to your solar panel by hacking the wire going into your car (they both use 12V DC, but make sure you get the wires the right way around though):
https://www.thomasdistributing.com/Maha-Powerex-MH...

0
TylerM185
TylerM185

Reply 1 year ago

Oh wow, that's a lot of information. Um, https://www.amazon.com/dp/B00HV4KFSA/?coliid=I199... comes with something to charge the batteries, I was planning to use a https://www.amazon.com/gp/product/B06WP9WQ3K/ref=o... as the regulator to jump it down from 12V to 9V like you talked about.

My idea was, I was going to use the solar panel, solder some wires (diodes, I believe) to the spots on the back of the panel and wrap them with the +/- of 12V in. From there, I wanted to take the wires from the 9V out (+/-) of the regulator and wrap them around the +/- terminals of the battery, then connect a male DC battery power plug to the 9V battery itself so that it could provide power to the board.

0
alberto7
alberto7

Reply 1 year ago

Tbh the regulator you linked should be able to bring the battery to 9V given the arrangement. (I feel the diode isn't required, as it'll dip the voltage by ~0.6V and I don't see any reason why you would have reverse polarity from a DC output device, but I could be wrong).

My only concern about that arrangement is the battery repeatedly charging/discharging - you might not have any way of stopping charging once the battery is full. However, that's all depending on what device you're putting to the DC jack.

Imo, give that a go and see what happens. Lithium batteries always give me the tingles when I go anywhere near them. I would add tank capacitors to the 9V output of the regulator, and the 12V input of the regulator. This will help limit any weird rippling..

0
oconnell3
oconnell3

3 years ago

So you program your arduino using a computer and then disconnect and run that program off of a battery? correct? I am assuming you can only run one program then ? To switch to another program you would have to start over with a computer?

0
Compu2
Compu2

Reply 2 years ago

Or you can write your program to carry out the different functions you want based on input received from a physical button or something. If you only had a few basic ones it might be worth merging that way.

0
VishalK123
VishalK123

Reply 3 years ago

Yes that has to be necessary, as new code has to be loaded using the loader

0
dimitrakis1992
dimitrakis1992

3 years ago

Hello sir.I have a question.When Arduino is off draw current?Please answer.Thank you

0
sampoulton2004
sampoulton2004

Reply 2 years ago

If you use a switch like on here, then the circuit will become physically disconnected when turned off, so no it won't.

0
GeorgeB133
GeorgeB133

3 years ago

Worked for me with a 4 AA battery pack

0
allanflanco
allanflanco

3 years ago

i want to use a Lipo battery for my RC car project,what should i do and dont?

0
RobertD234
RobertD234

Reply 3 years ago

You should not puncture it

0
Shikashik
Shikashik

3 years ago

mine works only if connected.why is it so?

0
BhavikK2
BhavikK2

4 years ago

i am using 12v 8000mah battery for robowars

can i connect it directly to arduino?