10A Motor Shield Restart Problem
Posted: Sat Jul 22, 2017 4:22 pm
I have a 10A Motor Shield (SHIELD-MD10). I am using it to drive a windshield wiper motor. I've discovered that when changing speed from high to a low speed (or changing direction) dramatically, the board appears to power down and then restart. Is this normal? Is there something I can do to avoid this (like, for example, a feedback diode)?
Here is a sketch that can duplicate the problem with my motor.
Here is a sketch that can duplicate the problem with my motor.
- CODE: SELECT_ALL_CODE
const static int MOTOR_DIR_PIN = 8;
const static int MOTOR_PWM_PIN = 9;
void setup() {
Serial.begin(9600);
pinMode(MOTOR_PWM_PIN, OUTPUT);
pinMode(MOTOR_DIR_PIN, OUTPUT);
digitalWrite(MOTOR_DIR_PIN, LOW);
}
void loop() {
Serial.println("Setting motor high speed... This does not cause a restart of the board.");
analogWrite(MOTOR_PWM_PIN, 255);
delay(10000);
Serial.println("Setting motor low speed... This causes a restart of the board.");
analogWrite(MOTOR_PWM_PIN, 100);
delay(5000);
}