Is there any way to do an "automatic" switch?

Hi, I am working on a robot vacuum, and I want it to stop after a time, and I know how to do it. The problem is that the vacuumpump, connected directly to the battery, doesn't turn off after the other things stop. Does anybody know how to stop it, using like a switch? Sorry for my english :)

Data! We need data!

Or put another way you’ve told us nothing about this pump except that it exists.

Yes it can be switched, but what voltage and current are we talking about? Model
number?, datasheet?, photo of the nameplate?

Are you talking about a ROUGHING PUMP ? ROUGHING PUMP

I think it's pretty clear from the post that what is called for is an appropriate MOSFET to switch the motor - he's switching a fairly large DC motor (we know it's DC, since it's connected to batteries). Be sure to include a diode to clamp the back EMF, and make sure the MOSFET has the required performance with 5v on the gate. Probably want an N-channel enhancement type mosfet switching the negative side of the motor. You may also need to take measures to stabilize the power to the electronics, so the starting surge of the motor doesn't reset the Arduino.

In the absence of much info here....

You stop the robot after a time, so presumably there's some control happening there, and presumably an Arduino since this is an Arduino forum. So, when you do that stopping, just control another pin which will be connected to the motor in some way or other, and turn it off.

The connection to the motor cannot be defined at this stage since you told us noting about the motor's volage and current but some kind of transistor or relay certainly seems do-able.

That can't be much different to stopping the robot: presumably you have some kind of transistor or h-bridge set up stopping the wheels?