Please help
I need control water pump with ir sensor but pump must work only 1 - 5 seconds regardless of the fact that the object is still in front of the sensor.
arduino NANO ( or UNO)
mini pump 3-6v
ir sensor
??
Can anyone help with the scheme and program?
I am new to arduino
You will need a driver for the pump. An Arduino output cannot supply enough current to run a motor. The driver can be a relay, transistor or motor driver. I recommend a logic level MOSFET. You will need to know the motor stall current to be able to intelligently choose a driver.
The state change detection tutorial shows how to detect switch transitions. That will help with the IR sensor activation part. Look in the IDE digital examples.