Fire Fighter robot water pump issues

hello everyone, I am new to all of this and have been creating a fire-fighting robot for my first-semester college expo project. I have been able to get the flame sensor to correspond with the wheel motors but have been having issues with the water pump. My professor had recommended using the servo1 port for the water pump but since the pump only has a live and ground wire I have no way of connecting it to pin 10 (which is the pin for servo1). Does anyone know how to fix this issue? I'm using the Arduino Uno R3 with the Eelegoo smartcar-shield-V1.1 on top of that. I also have an Ultrasonic sensor attached to it to help the robot detect its surroundings, I started adding code for that but didn't finish it so if anyone understands that portion as well that would be super helpful.

Thanks - Drew

this is my code

`#include <arduino.h>

#define IR 11 //forward sensor

int pos = 0;
boolean fire = false;
int Obstacle;

#define PIN_Motor_STBY 3
#define PIN_Motor_PWMA 5
#define PIN_Motor_PWMB 6
#define PIN_Motor_AIN_1 7
#define PIN_Motor_BIN_1 8
#define pump 10

// Motor Speed Presets
// PWM setting can be from 0 to 255
;int speed_Zero = 0; // PWM = 0% Duty Cycle
int speed_Min = 64; // PWM = 25% Duty Cycle
int speed_MidL = 127; // PWM = 50% Duty Cycle
int speed_MidH = 191; // PWM = 75% Duty Cycle
int speed_Max = 255; // PWM = 100% Duty Cycle

void setup() {
// put your setup code here, to run once:
pinMode(IR, INPUT);
Serial.begin(9600);
pinMode(pump, OUTPUT);
pinMode(PIN_Motor_PWMA,OUTPUT); // before using io pin, pin mode must be set first
pinMode(PIN_Motor_AIN_1,OUTPUT);
pinMode(PIN_Motor_PWMB,OUTPUT);
pinMode(PIN_Motor_BIN_1,OUTPUT);
pinMode(PIN_Motor_STBY,OUTPUT);

}

void put_off_fire(){

delay (500);

digitalWrite(PIN_Motor_STBY,HIGH);
digitalWrite(PIN_Motor_AIN_1,HIGH);
digitalWrite(PIN_Motor_BIN_1,HIGH);
digitalWrite(PIN_Motor_PWMA, HIGH);
digitalWrite(PIN_Motor_PWMB, HIGH);
digitalWrite(pump, HIGH);
delay(500);
}

void loop() {
// put your main code here, to run repeatedly:
//Do not move the robot

Obstacle = digitalRead(IR);
if(Obstacle == LOW) {
fire = false;
Serial.println("no fire");
Serial.println("pump off");
}
else {
fire = true;
Serial.println("fire");
Serial.println("pump on");
digitalWrite(pump, true );
}
if (fire==false) //If Fire not detected keep moving
{
digitalWrite(pump, LOW);
digitalWrite(PIN_Motor_STBY,HIGH); // Turn ON
digitalWrite(PIN_Motor_AIN_1,HIGH); //Motor A ON
digitalWrite(PIN_Motor_BIN_1,HIGH); //Motor B ON

// Motor A and B have same speed setting
// A = right wheels; B = left wheels
// speed_Min = 64; // PWM = 25% Duty Cycle
analogWrite(PIN_Motor_PWMA,speed_Min); //Speed Motor A
analogWrite(PIN_Motor_PWMB,speed_Min); //Speed Motor B

delay (500); // delay 2000 milli seconds
analogWrite(PIN_Motor_PWMA,0); //Speed Motor A
analogWrite(PIN_Motor_PWMB,0); //Speed Motor B
digitalWrite(PIN_Motor_STBY,LOW); // Turn Motor off
//digitalWrite(PIN_Motor_AIN_1,LOW); //Motor A Backward
//digitalWrite(PIN_Motor_BIN_1,LOW); //Motor B Backward
delay (100); // delay 2000 milli seconds
}

else ( fire==true);//If Fire is straight ahead
{
//Dont move the robot 

digitalWrite(PIN_Motor_STBY,LOW); // Turn OFF
digitalWrite(PIN_Motor_AIN_1,LOW); //Motor A
digitalWrite(PIN_Motor_BIN_1,LOW); //Motor B
digitalWrite(pump, HIGH);

// Motor A and B have same speed setting
// A = right wheels; B = left wheels
// speed_Min = 64; // PWM = 25% Duty Cycle
analogWrite(PIN_Motor_PWMA,speed_MidL); //Speed Motor A
analogWrite(PIN_Motor_PWMB,speed_MidL); //Speed Motor B
}

delay(100); //Slow down the speed of robot

}`

Please read this link and follow it: How to get the best out of this forum - Using Arduino / Project Guidance - Arduino Forum

If You post schematics and links to the datasheets for the pump, the Elegoo shield and the servo You could receive better comments than vague guesses.

What is powering the pump? You cannot power any motor from an Arduino pin.

I'm powering the board with this rechargeable battery pack. When I had the pump hooked into just the ground and 5v pin on servo1 the pump did work but it just wouldn't listen my code

The 5V pin is permanently powered. It's the signal from Arduino pin that tells the servo when to move. But that is a signal pin, not a power pin. The servo does not draw power from the Arduino pin, it only listens to the signal.

With your pump, you need to do what the servo does internally, which is to draw power from the 5V pin based on the signal from the Arduino pin. Do make it do that, you need a MOSFET driver board. You can make one yourself or buy one from eBay or similar. But post a link to the board your choose do we can check it will be suitable, before you buy it.

You must also use a flyback diode to protect the circuit from the reverse voltage that gets generated when the pump is switched off. 1N4001 or similar would be fine.

Thank you for the advice, I looked up some other options and saw a lot of people using relays for the pump. I found one at my school that I saw a few other links using but when I hooked it up the relay worked but the pump had no power.

this is the relay I'm using

here is the code that I found for that relay and pump

/*
 * Created by ArduinoGetStarted.com
 *
 * This example code is in the public domain
 *
 * Tutorial page: https://arduinogetstarted.com/tutorials/arduino-controls-pump
 */

// constants won't change
const int RELAY_PIN = 10;  // the Arduino pin, which connects to the IN pin of relay

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 10 as an output.
  pinMode(RELAY_PIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(RELAY_PIN, HIGH); // turn on pump 5 seconds
  delay(5000);
  digitalWrite(RELAY_PIN, LOW);  // turn off pump 5 seconds
  delay(5000);
}

How do you have the pump connected to the power supply and relay.

Usually...

Power supply GND -> Pump GND
Power supply +V -> Relay Common
Relay NO (Normally Open) -> Pump +V

Does the output of the power supply match the pump's requirements?

Thank you I ended up figuring it out and it now works perfectly