Question about ultrasonic sensor

I'm new in arduino community and not very familiar with arduino projects. I'd like to ask for help about a problem with my ultrasonic sensor. I download a program like this Arduino Blog - Ardumotive Arduino Greek Playground
but when i remove the usb cable it stops working.
What i have to do? I thing that it is probably uses the cable for echo or trig or something.

If you unplug the USB cable, how are you providing power?

My project is based on autonomus move of a vehicle using ultraslonic sensor, so i am using sparkfun's magician chassis with 4AA batteries for supply.