I have an Arduino UNO r3 and powering it up with 9v battery. But arduino run strangely (led 13 won't turn up correctly), how could this be?
\$\begingroup\$ Have you tried with a different, fresh 9 Volt battery? \$\endgroup\$– Anindo GhoshMay 29, 2013 at 10:31
\$\begingroup\$ Where did you connect the 9v battery - to the cigar style socket or to any particular board pins? \$\endgroup\$– Danny StapleMay 29, 2013 at 10:47
\$\begingroup\$ What is the battery voltage when it is connected to the Arduino? \$\endgroup\$– Leon HellerMay 29, 2013 at 11:30
\$\begingroup\$ @AnindoGhosh yes i have, and it's just the same, if I plug USB cable or 5v battery for power source, it runs correctly \$\endgroup\$– oentoroMay 29, 2013 at 12:47
\$\begingroup\$ @DannyStaple I connect positif lead to Vin and negatif lead to Gnd \$\endgroup\$– oentoroMay 29, 2013 at 12:50
Small rectangular 9V batteries are absolutely lousy power sources. They have a very small current load capability. They are specifically designed for low-current long-term draw.
For example, here is a link to an Energizer Datasheet: http://data.energizer.com/PDFs/522.pdf
Notice on the first page that more than 25mA of load significantly reduces the usable life of the battery.
On the second page, graph on the right, you can see that 100mA will drop the life to a couple of hours.
Why is this critical? Because an Arduino board by itself, when powered through Vin, draws on the order of 30-40mA. This is before you connect anything else to it. So the battery is barely usable to power just the board.
Get a better power source.
Assuming your battery is not dead or broken, and your arduino isn't broken either, the problem is most likely that your circuit is drawing too much current for a 9V battery. The current that a 9V battery can supply varies by manufacturer and chemistry, but it's safe to say in all cases the current available from a 9V battery is "not much". This is a consequence of putting so much voltage in such a small package.
To know if this is the problem, measure your battery voltage with it unconnected. It should be more than 9V for a fresh battery. Then, connect it to your circuit and measure the voltage while it's connected. If it's significantly less than 9V, you are drawing too much current. The battery voltage sags as a result, and may no longer be sufficient for your circuit to operate correctly.
If this is the case, either you have a fault in your circuit and its drawing more current than it should, or your circuit by design requires too much current, and you will have to change the circuit or get your 9V from a source capable of supplying more current, like a bigger battery, or a bench supply.
Have you tried running the Arduino by itself, with no external circuitry attached, from the 9V battery? If this doesn't work, then there's something physically wrong with your Arduino. Since you say it runs OK from the USB 5V supply, the on-board regulator may be damaged.
When you attach external circuitry to an Arduino, you are potentially putting additional demands on its on-board regulator, and this regulator is very much a weak link in the overall design. It is very easy to drive the regulator into thermal shutdown, because it is very tiny (SOT-223) and has essentially no heatsink — just a little bit of copper in the PCB itself.
A fresh alkaline 9V battery can supply up to 1A for short periods of time. However, if you draw 100 mA through the regulator, you're forcing it to dissipate 400 mW, and it can't do that for very long at all.
Ed Nisley did an extensive writeup of this in the December 2012 issue of Circuit Cellar, in which he calculated that the regulator was good for no more than about 500 mW, which would be 125 mA from a 9V battery. The Arduino board needs something like 30-40 mA all by itself, so if you're drawing more than 80 mA with your additional circuitry, you're in trouble.