I have tried all suggestions in comment but no good result. Finally, I added a 100 µF capacitor to VCC and GND of Arduino (5 V), and remove the 1 kΩ in pin 11.
Here's the update:
and the code:
void setup()
{
Serial.begin(9600);
pinMode(11,OUTPUT);
digitalWrite(11,LOW); // Normally LOW inthis pin
pinMode(A0,INPUT); // 10k Potentiometer
}
void loop()
{
int s=analogRead(A0); // 10k Potentiometer
int z=map(s,0,1024,0,255);
Serial.println(z);
analogWrite(11,z);
}
Temp Result:
- The motor is not too hot anymore.
- I still have motor vibrations.
- Motor speed cannot reach the max speed (I'm sure this is because of the vibration)
UPDATE 2
- I change the thick of the wire. I use all the same wires. Result = No heat.
- I remove the 10Ω and the speed can reach the MAX Throttle/speed. Yeah! (based on this article).
By doing the two above, I finally didn't see the vibration!!!