Varying Voltage to a Pump

Hi all,

I'm building a project which will require me to vary the amount of voltage reaching a 12v pump. I'm assuming that I can do this using a TIP120, as shown below (initially this will be a little manual circuit, without the complication of an Arduino):

Then, when I come to iterate up to Arduino control, I pull out the potentiometer, replace it with a pull-down resistor and on to an arduino PWN pin.

So, in principle, am I on the right tracks, here?


You are going in the right direction.

If you use an analog input for the transistor, it might get very hot. PWM is just on or off, that prevents it from getting hot. Your circuit will work with the potmeter and 9V.

But an output of the Arduino is HIGH +5V. So the motor will never get 9V. To control it with an Arduino, you better place the motor at the collector of the transistor. And the emitter at ground. A pull-down is not needed, but you need a resistor from the Arduino to the base of the transistor. The protection diode can be placed as a flyback diode over the motor.

Thanks for the reply. So if I go something like this...

(I'm thinking I may have gone wrong here, particularly that diode!)

Edit: pah, Dropbox links to images don't work. It's here

The flyback or snubber diode should be the other way around. A flyback diode is for an inductive load, and is parallel with the inductive load. For a motor, the voltage could not only give a high voltage peak (inductive), but also be negative (dynamo).

To be sure, I would place both diodes, like in this picture I found elsewhere in the forum:

Ok, that makes sense. So I’m using a diode to buffer both the ups and downs which come back off the pump motor.

So I’m looking at something like this, simplified like this ready to go onto stripboard?


Now you can use a digital output pin instead of the potmeter, and start playing with.
Have fun !

const int pinMotor = 9;   // write your own pin here

void setup()
  pinMode (pinMotor, OUTPUT);

void loop()
  analogWrite (pinMotor, 20); // too slow
  delay (3000);
  analogWrite (pinMotor, 50); // very slow
  delay (3000);
  analogWrite (pinMotor, 80); // slow
  delay (3000);
  analogWrite (pinMotor, 120); // medium speed
  delay (3000);
  analogWrite (pinMotor, 255); // full on
  delay (3000);

Great stuff. Thanks for your help.

I misposted the 'simplified' link - does this look ok, for the stripboard?

Yes, that's okay. It is the same.

Even using PWM, unless the pump takes less than and amp or so, the TIP120 is going to get hot because of its high voltage drop. Much better to replace is with a logic-level mosfet. Then you can also eliminate the diode in parallel with the transistor (but you still need the one in parallel with the pump).