Stand Alone Arduino

I'm trying to make a stand alone arduino project, meaning I want to use a 9volt battery to power my arduino board.
Are there any links with pictures on how to wire this up?

Does anyone use a "wall wart" A/C adapter port to plug in a battery pack? Do I need a voltage regulator for either method?

I appreciate any help as I'd like to show off my projects without have to lug around my laptop too. 8)

I assume that you want to use a standard Arduino UNO, and that by standalone you just mean to use it without USB Power ?

If so yes you can power it with a 9v battery plugged into the barrel jack or into the vin and gnd pins on the black headers that surround the board.

The vin pin is routed to the onboard regulator which will convert your 9 volts and deliver 5 volts to your Arduino.

Square 9 volt batteries are not very good at powering lots of external devices, but will be ok for a few leds, buzzers or an LCD.

Duane B

rcarduino.blogspot.com

encryptor:
I'm trying to make a stand alone arduino project, meaning I want to use a 9volt battery to power my arduino board.
Are there any links with pictures on how to wire this up?

The google search engine is your friend. If you type "arduino 9v battery", the first link that comes up is from the playground from this site:
http://www.arduino.cc/playground/Learning/9VBatteryAdapter

However note, that the normal 9v battery used for smoke detectors doesn't have much capacity. Since it is not rechargeable, you will find yourself having to replace it every so often.

encryptor:
Does anyone use a "wall wart" A/C adapter port to plug in a battery pack? Do I need a voltage regulator for either method?

I use this all of the time. Just get a USB cable with normal A plug on one side, and the square-ish B plug on the other side. This cable used to be quite common, as it was often used to hook up printers to the computer in the past. Nowadays the micro USB has become more common, but you can still find it it you look around.

encryptor:
I appreciate any help as I'd like to show off my projects without have to lug around my laptop too. 8)

Beyond the 9v battery and wall wart, you can get cell phone batteries that provide 5 volts of output at 0.5 - 1 amp. I happened to get a EZOPower 5000 maH battery from Amazon for $20 plus s/h. It provides 2 USB ports to power 2 separate devices (5 volt, 1 amp max per port), and it has 5 amp/hours of power. You recharge it via a wall wart or by hooking it up to a computer. FWIW, I ran my Arduino which was running the blink program, and the Arduino lasted 3-4 days before it ran out of juice.

You can also get AA battery holders with a 2.1mm plug that plugs into the Arduino. Typically you want at least 5 rechargeable batteries to deliver 6 volts, with 6 or 8 battery packs being fairly common (6 rechargeable AA's would deliver 7.2 volts, 8 would deliver 9.6 volts).

what if my sensor or actuator requires an external power source? I have a gas sensor that requires me to wire up an external power source to the breadboard. How would I do that with the EZOPower 5000 maH battery when that gets plugged into B-port (square)?? :fearful: Also I was told the following about my servo by IT Support at Pololu:

"The Power HD servo is almost certainly drawing more current than the Arduino can provide. If you provide a separate power supply, you should be able to control it with your Arduino. A rough guideline for servo current draw is to allow 1A per standard size servo."

Does it make a difference with some hardware whether I use the laptop or a battery pack to power circuit?

If using the battery pack I would be pulling 5V thru its own pin, yes?

encryptor:
what if my sensor or actuator requires an external power source? I have a gas sensor that requires me to wire up an external power source to the breadboard. How would I do that with the EZOPower 5000 maH battery when that gets plugged into B-port (square)?? :fearful:

The EZOPower has two 2 USB ports that take the standard A mode male connectors. Each one is spec'ed to provide 5 volts of power at 1 amp. So you would connect one port to the Arduino's USB port, using the B male cable, and you use the other port you would get an adapter to go from the various power plugs that come with the battery to the breadboard. I got a USB breakout cable from my local electronics store that has a USB A male plug on one side, and 5 wires on the other, and I can connect the appropriate power plug to my breadboard. If you have plenty of USB cables to dead devices, a third alternative is to slice open one of the cables. In general, you do want to connect the grounds of each power supply together, and connect the sensor wire to the Arduinio, and the power wire to the other power source.

Here is a howto on how to wire up servos with a secondary power source, written by Duane, one of the regulars in this forum: RCArduino: Servo Problems With Arduino - Part 1.

Note, if you use the standard servo library on an UNO, it disables PWM (AnalogWrite) on pins 9 and 10, even if you don't have servos on those pins. I discovered this when I tried to use my LCD shield along with a servo, as the LCD shield wanted to use PWM on pin 10 to control the backlight.

encryptor:
Also I was told the following about my servo by IT Support at Pololu:

"The Power HD servo is almost certainly drawing more current than the Arduino can provide. If you provide a separate power supply, you should be able to control it with your Arduino. A rough guideline for servo current draw is to allow 1A per standard size servo."

Does it make a difference with some hardware whether I use the laptop or a battery pack to power circuit?

If using the battery pack I would be pulling 5V thru its own pin, yes?

I imagine it makes a difference how much volts and amps you get, and not particularly whether you use a laptop or wall wart. There are other batteries out there, that provide 9 or 12 volts in addition to the 5 volt USB ports. EZOPower for example makes a battery with 10,000maH with 2 USB ports at 2.1 amps for each 5 volt USB port and a 3rd port that is either 9v or 12v at 2 amps. I suspect sooner or later, I will upgrade to those, as I eventually may need to power some 12 volt devices. However, it is also twice the cost ($54 vs. $20).

Does using the attach function enable pin 9? Why would the Knob and Sweep example have me use pin 9 like so:

myservo.attach(9); // attaches the servo on pin 9 to the servo object

Note, if you use the standard servo library on an UNO, it disables PWM (AnalogWrite) on pins 9 and 10, even if you don't have servos on those pins. I discovered this when I tried to use my LCD shield along with a servo, as the LCD shield wanted to use PWM on pin 10 to control the backlight.

encryptor:
Does using the attach function enable pin 9? Why would the Knob and Sweep example have me use pin 9 like so:

myservo.attach(9); // attaches the servo on pin 9 to the servo object

Note, if you use the standard servo library on an UNO, it disables PWM (AnalogWrite) on pins 9 and 10, even if you don't have servos on those pins. I discovered this when I tried to use my LCD shield along with a servo, as the LCD shield wanted to use PWM on pin 10 to control the backlight.

I think you misunderstood what I meant. You can use pins 9 and 10 for a servo. The warning is if you wanted to use pins 9 or 10 for something other than a servo that you won't be able to use those pins for Pulse Width Modulation (PWM - http://www.arduino.cc/en/Tutorial/PWM) which simulates analog write by turning the pin on/off very fast, so the total current is equivalent if the Uno had a digital to analog converter and could output the desired voltage directly. You can still use pins 3, 5, 6, and 11 for PWM, just not pins 9 and 10. You can also use pins 9 and 10 for normal inputs/outputs like turning on a LED or reading a switch.

I would imagine the reason is internally the UNO does PWM by having an interrupt that periodically turns the pin on/off, and the servo library uses this interrupt to control the servos by turning the power on/off at specific times.