Sensor acting strange when using pump

Hello everybody!
The thing is i've been trying to do a project which helps put off fires. It works like this:
I have 2 servomotors, one submersible water pump, a ssr and and a sensor.(they all work on 5v)
The two servo act like a robotic arm, a sensor detects the fire and the moment it detects the fire the servos freeze and the ssr actionates the water pump.
The problem is that when the water pump works, the sensor goes nuts and the values change. I have tried to disconnect the water pump and to see if the problem is there and it seems that it was. Any ideas of how to approach the problem?

Where do all these components get their power?

I am using a usb port from my pc, so all the components are functioning with 5v.

So the Arduino is providing all the power , which is not a good idea.

1.The motor creates electrical noise which will affect the Arduino and the sensor.

  1. The current drain the pump is likely to be excessive .

You need to power pump by a different supply and the Arduino switch it via a transistor or relay.

hammy:
You need to power pump by a different supply

Almost certainly the servos too.

So i shouldn't use the arduino for powering the parts?

hammy:
So the Arduino is providing all the power , which is not a good idea.

1.The motor creates electrical noise which will affect the Arduino and the sensor.

  1. The current drain the pump is likely to be excessive .

You need to power pump by a different supply and the Arduino switch it via a transistor or relay.

Sorry i didn't quite get it. How to power the arduino via a relay? Wasn't the arduino supposed to give the signal to control the relay?

Never use the Arduino 5V output to power motors or servos. Use a separate power supply and connect the grounds.

For motors spinning in one direction only, or for pumps or solenoids, a circuit like this is recommended:

Your computer's USB can supply 0.5-1A or so. That all has to go through the Arduino (which is not designed for that), and even if the Arduino could pass it all through it's likely not enough power to begin with.

A 5V, 5-10A power supply is probably what you need for those motors. Check the actual ratings.

I didn’t say power the Arduino via a relay !!
The pump !!