Servo not working with Arduino even after connecting to different power supply

Even after connecting to a different power source servo is not working.
New to Arduino please help.

Components Used
Servo MMG996R
Arduino Uno

The Servo is connected to a different power source.
The orange wire from the server is connected to Digital Pin 9 of the Arduino.
The Ground Pin of Arduino is connected to the Ground pin of Servo in the breadboard

Bellow is the code used

#include <Servo.h>
Servo name_servo;

int servo_position = 0;

void setup() {

name_servo.attach (9);

}

void loop() {
name_servo.write(180);
}

That battery is way too feeble to power a servo. Get some AA cells and connect them up to give you 6V or so.

The battery is of 9V , isn't it enough for Servo?
I will try with a couple of AA cells to get 6V cells also.

Here's the OP's pix:

RenukeshDeshpande:
The battery is of 9V , isn't it enough for Servo?

'

It's too much voltage in fact, but even if it was a 9V servo, such a battery can't provide much current.

Current is the issue - rule of thumb for servos like that is that you need one Amp although since you have no load on yours yet you may well get away with less.

I have managed to power servos using a wall wart scavenged from the seemingly infinite supply of them that most of us accumulate. Just be aware that many of them can't provide the required current - check what is written on it.

MG996R is a fairly high power servo. Tiny 9V PP3 battery is only capable of working with VERY low powered devices, not servos or motors.

Steve