I'm looking for a way to connect a DC water pump to my Arduino.
I need the speed to be varied. ON/OFF is not enough for what I want to achive.
At the moment I'm using a relay to control it but that allows me to either turn it off or on.
How can I vary the speed of the water pump?
It's a DC motor right? You need a transistor as the switch and send PWM to vary the speed. Google "Arduino DC motor speed control" and you should get tons of stuff to look at. It's one of the more common topics.
Use a transistor or [u]MOSFET[/u] driver circuit. 5W at 12V is a little less than 1/2 Amp, but the motor will draw more current during start-up, so get a transistor or MOSFET capable of 1A or more (easy to find).
Then use analogWrite() (which is [u]PWM[/u]) to control motor speed.
You might have to hit it with 100% PWM (255 or digitalWrite() ) to get the motor started before slowing it down. And, 50% (127) PWM probably won't be half-speed so you'll have to experiment.
Boardburner2:
They exist but are nowhere as cheap or as readily available fountain pumps.
... pencils are cheaper than printers.....
cost does not have a direct bearing on function.
they make variable speed brushless motor speed controllers. just saying. no use with this pump.
without the actual process, this is all moot.
the fountain pump has a head of 350cm.
this pump is designed for a discharge blocking valve, this one would not benifit with a bypass or run-around valve as the discharge pressure is so low.
the vanes have large gaps to allow for the bypass to occur inside of the impeller housing.
it can push water with little resistance, but is worthless for a pressure application.
at 260 lph, it might push 50 lph in a piped system.
as a note the run-around valving is a good solution for a fixed speed motor/pump.
the valve should be reduced port with an area of no more than half the pump port opening as it will have a much higher pressure drop because it is connected to the high and low pressures of the pump.
dave-in-nj:
cost does not have a direct bearing on function.
they make variable speed brushless motor speed controllers. just saying. no use with this pump.
Used to be able to get brushed pumps like this which can be speed controlled.
Most seem to have gone over to brushless though now.
Fountain pumps are cheap because of mass market , i can get brushed pumps but have to pay more.
ESC,s used by modellers are cheap for this but you have to break open the pump to connect.
EDIT
It can be done with some by cutting a hole in the side with a dremel.
Downside is you have to sacrifice a pump to find out where to cut the hole.