TIP120 and peristaltic pumps

Hello,

I am trying to use a TIP120 to switch on and off a 12v peristaltic pump. I am using the attached sketch and the code posted below. I cannot get this circuit to work. I do know that my PWM pin and my motor function correctly. I am using a base resistor of 1k. According to the datasheet for the TIP120, there already is a diode included, so does that mean I do not need an external diode between the motor leads? Secondly, whenever I attach the emitter to the ground, my power supply led starts to flash on and off, to me that indicates a short somewhere, but I cant see where. Sense I am using a seperate power supply, I connected the Arduino ground to the external ground on the breadboard. Any advice as where I am going wrong?

I cant find the datasheet to the pump I got, however on the pump itself it says 12V 5W. My power supply is 12V 5 Amps.

//Define Pins
int motorPin = 9;

void setup()
{
//Set the PWM Motor pin as an output
pinMode(motorPin, OUTPUT);
}

void loop()
{

analogWrite(motorPin, 100);
delay(500); //Hold it!

}

Edit: I am using an Arduino Mega, and the pump I am using is NPK-DC-S10B. My Ardunio Is being powered from a USB off my computer.

joebob296:
the pump I am using is NPK-DC-S10B

You should post a link to the data sheet.

You should also read this and put your pix in the post to save everyone the hassle of downloading them.

kenwood120s:
You should post a link to the data sheet.

You should also read this and put your pix in the post to save everyone the hassle of downloading them.

Fixed the pictures so they are now inside the post. I cannot find the datasheet, but I posted the specifics from the tag on the motor. Hopefully that helps.

That ceramic capacitor needs to be physically on the motor terminals to suppress interference, and 1uF is too much and will stress the driver - try 10nF. Always twist motor leads together, don't make big loops like in
the pictures, that sprays EMI everywhere to be picked up by the rest of your project.

Use thick wires for high current, even the 0.6mm diameter solid core wire will be loads better than
premade breadboard hookup wires like those which can be incredibly thin in my experience (ie only good for
signals, not power). Breadboards are not great for high currents, its something to be aware of.

That pump motor is rated at 5W, ie its rated current is 0.4A or so, thus the stall current is many amps
which is what will be dropping out your supply - its not specifically a motor supply so it just resets on
overcurrent.

Ramp up the drive PWM, this will reduce the initial current to lower than the stall value, although
I see you've only set the output to 100 out of 255 which ought to help. Try

void setup()
{
  pinMode(motorPin, OUTPUT);

  // ramp up drive to avoid high current spike.
  for (byte i = 0 ; i <= 100 ; i++)
  { 
    analogWrite(motorPin, i);
    delay (5) ;
  }
}

Thanks for the advice. I was able to get it working by removing the capacitor and placing the diode directly across the terminals on the motor. Thanks for the ramp up code, I implemented that as well. I will be soldering and using different wires for a permanent install later on. This was just a proof of concept for me. Thanks for the help.

MarkT:
That ceramic capacitor needs to be physically on the motor terminals to suppress interference, and 1uF is too much and will stress the driver - try 10nF. Always twist motor leads together, don't make big loops like in
the pictures, that sprays EMI everywhere to be picked up by the rest of your project.

Use thick wires for high current, even the 0.6mm diameter solid core wire will be loads better than
premade breadboard hookup wires like those which can be incredibly thin in my experience (ie only good for
signals, not power). Breadboards are not great for high currents, its something to be aware of.

That pump motor is rated at 5W, ie its rated current is 0.4A or so, thus the stall current is many amps
which is what will be dropping out your supply - its not specifically a motor supply so it just resets on
overcurrent.

Ramp up the drive PWM, this will reduce the initial current to lower than the stall value, although
I see you've only set the output to 100 out of 255 which ought to help. Try

void setup()

{
  pinMode(motorPin, OUTPUT);

// ramp up drive to avoid high current spike.
  for (byte i = 0 ; i <= 100 ; i++)
  {
    analogWrite(motorPin, i);
    delay (5) ;
  }
}

Hi,
Also TIP120 is a Darlington Pair transistor.

Tom... :slight_smile:

joebob296:
Thanks for the advice. I was able to get it working by removing the capacitor and placing the diode directly across the terminals on the motor. Thanks for the ramp up code, I implemented that as well. I will be soldering and using different wires for a permanent install later on. This was just a proof of concept for me. Thanks for the help.

The capacitor needs to be on the motor, but much smaller, the diode was correct where it was - you've
increased the EMI from the motor leads substantially now as the current along the leads is
now being switched on and off, before it was only being diverted between diode and transistor.