0

Using the Adafruit Motor Shield v2.3 to power a water pump
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Using the Adafruit Motor Shield v2.3 to power a water pump

by maansaake on Sun Apr 19, 2020 3:57 pm

Hi!

I've been scratching my head at this problem and can't really figure out where I have went wrong. I am trying to use the Adafruit Motor Shield v2.3 to power a water pump (only the water pump is connected at this time) but all the pump does is squeal.

First some info on the pump:
working voltage range: 5 VDC to 12 VDC
max. load current: 0.35 A at 12 VDC
power consumption: 4.2 W at 12 VDC
driving mechanism: brushless DC motor

For this to work I have connected an external power supply to the motor shield's power input and I have NOT attached the VIN Jumper. The external power supply yields 12VDC and a maximum of 1500mA.

To ensure the pump is not damaged I have connected it directly to the power supply and boy does it go. I have also measured on top of the incoming power terminal on the motor shield and can see that it does indeed show 12V. I also measured on the output motor port where the pump is connected and can see that it shows 12V.

Here's how the connections look (couldn't use the image function for some reason):
https://imgur.com/a/D7vGD5f

And here's the code:
Code: Select all | TOGGLE FULL SIZE
/*
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control

For use with the Adafruit Motor Shield v2
---->  http://www.adafruit.com/products/1438
*/

#include <Wire.h>
#include <Adafruit_MotorShield.h>


Adafruit_MotorShield AFMS = Adafruit_MotorShield();

Adafruit_DCMotor *myMotor = AFMS.getMotor(1);

void setup() {
  Serial.begin(9600);
  Serial.println("Adafruit Motorshield v2 - DC Motor test!");

  AFMS.begin();

  myMotor->setSpeed(255);
  myMotor->run(FORWARD);
}

void loop() {
  delay(3000);
  Serial.println("Still running...");
}


I'm suspecting that the pump has some weird requirements that I don't know of, because I can't for the life of me find a datasheet on it. It's a VMA421 from Velleman, or are there settings on the motor shield I can try and tinker with to make it run?

maansaake
 
Posts: 13
Joined: Sun Apr 19, 2020 3:24 pm

Re: Using the Adafruit Motor Shield v2.3 to power a water pu

by adafruit_support_bill on Sun Apr 19, 2020 4:23 pm

I don't see anything wrong with the code or your setup. Check the polarity of the power from the shield to the motor and swap the leads if necessary. The "FORWARD" direction in the shield library is arbitrary and you pump may not like getting reverse polarity.

adafruit_support_bill
 
Posts: 81890
Joined: Sat Feb 07, 2009 10:11 am

Re: Using the Adafruit Motor Shield v2.3 to power a water pu

by maansaake on Sun Jul 18, 2021 11:26 am

I ended up using this reply: viewtopic.php?f=31&t=54510

I made another observation though, when calling analogWrite(254) the pump stops, only 255 works. According to the Arduino docs 255 means "always on", so the pump does not seem to tolerate lower duty cycles. Perhaps this could be my issue with the motor shield library as well? I checked around in the GitHub repo (https://github.com/adafruit/Adafruit_Motor_Shield_V2_Library/blob/master/Adafruit_MotorShield.h) and saw the the default frequency is 1.6 kHz but that there are exposed methods to change it, and that a value above 4095 means "always on". I still have not had time to try it out, but do you think this could work?

maansaake
 
Posts: 13
Joined: Sun Apr 19, 2020 3:24 pm

Re: Using the Adafruit Motor Shield v2.3 to power a water pu

by sj_remington on Sun Jul 18, 2021 11:39 am

The pump uses a brushless motor. Many such motors will not tolerate PWM control, as the switching interferes with the timing of the internal controller.

sj_remington
 
Posts: 123
Joined: Mon Jul 27, 2020 4:51 pm

Re: Using the Adafruit Motor Shield v2.3 to power a water pu

by adafruit_support_bill on Sun Jul 18, 2021 1:34 pm

AnalogWrite is not at all related to the Motor Shield library. The MotorShield uses a PCA9685 PWM generator chip. AnalogWrite uses PWM generated by the processor. The maxmum frequency supported by the PCA9685 is 1.6KHz.

The analogWrite PWM frequency depends on which model Arduino and which pins you are using. For the UNO, the frequency is about 1KHz on pins 4 and 13 and 500Hz on the other PWM pins. It is possible to change that by tweaking the timer control registers.

However, as sj_remington correctly notes, many brushed DC motors do not get along with PWM. I'd check with the pump manufacturer to see if they have any recommendations for speed control.

adafruit_support_bill
 
Posts: 81890
Joined: Sat Feb 07, 2009 10:11 am

Re: Using the Adafruit Motor Shield v2.3 to power a water pu

by maansaake on Wed Jul 28, 2021 4:12 pm

I realize I was trying to do something I shouldn't have, going to use the MOSFET circuit instead as its more suited for the task. Thanks though for all the replies, it helped me understand the problem I was causing a lot better :-)

maansaake
 
Posts: 13
Joined: Sun Apr 19, 2020 3:24 pm

Please be positive and constructive with your questions and comments.


cron