Battery connection problem

I created an assembly and a programm that control a motor with an infrared controller. Everything's fine when i use it plugged on my computer but as soon as i plug it on a battery and activate the motor it start producing a tic-tic but doesn't move.
here's the programm:

//www.elegoo.com
//2018.12.19
#include <Servo.h>
Servo myservo;
#include <IRremote.h>

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup(){
  Serial.begin(9600);
  myservo.attach(9);
  myservo.write(90);// move servos to center position -> 90°
  irrecv.enableIRIn(); // Start the receiver
  
} 
void loop() {
  if (irrecv.decode(&results) && results.value == 16743045 ) {
    myservo.write(0);
    irrecv.resume();}
  if (irrecv.decode(&results) && (results.value) == 16718055 ) {
    myservo.write(90);
    irrecv.resume();}
  if (irrecv.decode(&results) && (results.value) == 16724175 ){
    myservo.write(180);
    irrecv.resume();
  }
  if (irrecv.decode(&results)){
    Serial.println(results.value);
    irrecv.resume();
  }
}

and a photo of the assembly:

Welcome to the forum

What type of battery are you using ?
Would it be a PP3 9V battery by any chance ?

One like this ?

yes this one

A PP3 battery is designed to power low current devices such as smoke detectors, not motors. It cannot provide the required current for your motors

Consider using 4 AA batteries in series instead

As a matter of interest, how are the motors connected to the Arduino ?

thanks for this piece of advice. The motor are conneced by simple cables

Bob, won't that barrel connector mean that the motor is drawing 5v from the Arduino board's voltage regulator? I seem to recall a concern about overheating that with too much current. Would it be better to directly power the servo from a power source instead of through the Arduino voltage regulator? That in addition to what you've pointed out about the low-current battery.

--HC

That was the point of asking how the motors were connected. I could, perhaps, have been more explicit

Motors and servos should not be powered directly from the Arduino but by an external power supply

I understand. To be completely clear, it was not my intention to needle you about how you presented your information. You know a lot more than I do, I was walking softly adding anything.

--HC

No problem as far as I am concerned. As I said I could have posed my question better