problem in upload a using usb cable

Hello Friends

I installed arduino software to do some robotic stuff,the problem that i am facing is when i upload a program into the arduino board and make the robot work it is working but when i disconnect the cable from the computer the robot doesn't work..I don't know if there is any settings that has to be changed

The link is Activity 3: Navigation with Whiskers | LEARN.PARALLAX.COM.

the arduino board is ATmega8 and i have selected the correct serial port and board.And i would like what should i select in programmer from the Tools tab.

Pls help me to find a solution and Thanks in advance

What's the power supply you are using when not connected to USB?

I use 5 batteries of 1.2 volts each

What kind of batteries? How are they connected together (series / parallel)? Where are you connecting them to the Arduino?

It is AAA size batteries and i a not connecting it to the arduino board I am using it Robot

So where's the Arduino getting its power from?

When connected to your PC with the USB, the Arduino is getting 5v from there. You need to provide a replacement for that power, eg 9v through the barrel connector.

Have a look at the product page for your board, like this one for the Uno to see the connections and what voltage is appropriate.

Yes this is how i have connected

http://learn.parallax.com/node/184

I would like to know which option should i choose in while uploading is it upload using programmer or simple upload

and what is the programmer option from the tools tab what should it be selected by default is it AVR ISP or parallel programmer or anyother

I'm confused....

In one post you say that the batteries are not connected to the Arduino, but then you agree with my post and say yes you have connected power to the Arduino as in that link.

But assuming you do have the batteries connected to Arduino you might be short on volts. The link says use 5x alkalines which will give you 7.5v @ 1.5v each.... you say you have 5 x 1.2 which is only 6v and below the recommended 7v for the barrel jack input.

applerame:
Yes this is how i have connected

4-cell Pack + Boe-Boost Setup | LEARN.PARALLAX.COM

Do not believe everything you read on the internet. That's a great tutorial on how NOT to hook up batteries to the Arduino.

That's a great tutorial on how NOT to hook up batteries to the Arduino

What did I miss James?- I must confess I didn't read every word (had just got home on Friday evening and was trying to chill....) but is there something wrong with it?

(I quite like that doodah they have for adding a 5th cell to a 4-pack... clever (albeit kludgey))

In this case, the 1.2V cells will only yield a nominal 6V. 6V into the regulator with Servos attached is not going to work well.

Even with 1.5V cells, the voltage is going to drop relatively quickly to the point of making the regulator unstable -- especially with a load.

Ah yes, I spotted that one.... thought there was something else.