sketch not working without usb cable

i uploaded a sketch to my arduino mega to control a servo via bluetooth ....

it works fine with usb .... but when i remove usb n use another power supply it stops working .... what should i doo

Use a separate 6V regulated (or battery) supply to power the servos.

While you may get lucky with the USB port, the Arduino (regulator) cannot supply other devices.

thnx for replying ... bt i already did that...

mohitjain9410:
thnx for replying ... bt i already did that...

Are you certain? What Paul is suggesting is using two power supplies - one for the servo and one for the Arduino. If you are doing that can you provide more details on your circuit, or even some photos? The more information you provide the better.

Geoff