Stepper motor has high pitch when idle, and no torque when running

Hi …

This might not be the right place for this detailed electronics question, but then again, I have before received help here with these types of questions :wink:

Questions I’m struggling with:
-Why does the stepper motor produce a high pitch sound when idle ?
-The stepper motor doesn’t seem to have a high torque - with a single finger I can stop the rotation, how to solve that ?

Now to all the details.
I’m in the process of building a feeding station for my dog. I have built the setup, and have the electronics in place, and about to integrate it with HA.
It uses a ESP8266 - with a c program, that uses MQTT for ‘feeding’ tasks, and it is controlled from HA.
I have a setup, where I can send MQTT messages, and the stepper rotates the requested steps. So far so good.

This has raised these two issues.
When the stepper motor is not turning, it produces a high pitch sound. I don’t believe it is there when the stepper motor is running - it is noisy so it is hard to tell.
Guess when the motor is idle, it still has ‘power’ on to hold its positions, which is not needed. So could an option be to somehow turn off the motor ?

Second issue is that I thought I bought a motor with a high torque (0.55N.m) and it is powered with 12 volt, but I can hold/stop it from rotating with just one finger. How come ?

These are the components:
Stepper motor driver - A4988 https://www.tinytronics.nl/shop/en/robotics/motors/motor-drivers/a4988-motor-driver-module
Stepper motor - 0.55N.m - 1.5A - NEMA17 https://www.tinytronics.nl/shop/en/robotics/motors/motor/stepper-motor-0.55n.m-1.5a-nema-17
Power supply for the stepper motor - 12v 3A https://www.tinytronics.nl/shop/en/power-supplies/12v/12v-3a-adapter-with-dc-jack
ESP8266 is still powered with 5v, but the plan is to add a buck converter.
ESP8266, capacitor

Wiring:

Code:
The code is really simple - These are the sniffits that involves the stepper motor

(no include of stepper.h or similar)
int dirPin = D4;
int stepPin = D3;

void setup() {
  // pins setup
  pinMode(dirPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
…

In function that turns the stepper:
  digitalWrite(dirPin, HIGH);
  //Loop through one rotation
  for(int x = 0; x < 200; x++)
  {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(4000);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(4000);
  }

Code works. The stepper motor turns when a message is placed in mqtt.

So, how to get rid of the noise and to get more torque ?

Thanks
Regards Joern.

Your code seems incomplete.

However what you are describing typically means you are sending steps too quickly for the motor.

I had the high pitch issue with the steeper motor and it was the enable/sleep pin that was not hooked up correctly. That pin cuts power to the motor when not in use. It was also getting hot. But also the potentiometer was not in the right position.
motordriver

You should check this: It’s a different project but it has all the elements that you need.