first of all, I apologize for any difficulty of understanding my thread since this is my first type posting my question.
I am trying to use potentiometer to control my sumtor 42HS4013A4 Bipolar Stepper motor’s speed using the Arduino and the SEEED arduino motor shield v2 but the motor and the motor light indicators on the Seeed motor shield behaves erratically (the behavior of the motor and the indicators are directly related)
You can see the picture of the setup and the codes in my attachment.
If I use the usb cable to power the arduino + arduino shield + the stepper motor, the motor only runs accordingly to my code when I bend the cable end near the arduino. If it is not bent, the motor light indicators fine but motor cannot turn (it seems that the power to the motor is not sufficient if the cable is not bent)
If I use the external power (at 9V) hooked up to the seeed motor shield to run the circuit, the motor light indicators on the motor shield are fine at high potentiometer (analog) value (but the stepper motor turns very crooked). At low potentiometer(analog) value. The motor shield runs for 1 second then turns all motor lights indicators off (while the power indicator on the shield stays on). This behavior repeats in a cycle until I increase the potentiometer (analog) value.
I at first thought that the problem was due to a low quality arduino. Yet the problem remains the same after switching to 2 other arduino boards.
Seeed_potentiometer_controling_speed.ino (673 Bytes)