A servo that turns without stopping may be a continuous-rotation type, which takes speed, not angle. A standard servo has end stops.
What the message means
A standard servo turns to the angle set by a pulse of about 1 to 2 ms every 20 ms. A continuous type treats the same pulse as a speed and direction.
Fix it in this order
- Check the servo label or datasheet. If it says continuous rotation, use it as a motor with direction and speed.
- For a standard servo, use Servo.write(angle) with values from 0 to 180.
- If the ends do not reach, use writeMicroseconds or the min and max values in attach(), and test slowly.
- Do not push the servo past its end stop. See the servo overheating page.
- Power the servo from a supply with enough current and join the grounds.
Why it happens
A servo that spins continuously is probably a continuous-rotation type: it takes a speed command, not an angle. A real SG90 positional servo turns about 180 degrees, and the exact pulse range varies between units.
If the angle is wrong at the ends, use writeMicroseconds() with a range that suits your servo, for example 500 to 2400 µs, and test in small steps so the servo does not stall against its end stops.
If you see this, do this
| You see | Do this |
|---|---|
| Never stops turning | Continuous type or wrong pulse. |
| Buzzes at the end | Past its stop. Reduce the range. |
Related
servo pulse calculator, servo buzzing, servo does not move.
Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.
Why this happens
A standard hobby servo has a small controller and a position sensor, usually a potentiometer on the output shaft. It compares the commanded pulse width with the sensed position and drives the motor until they agree. A pulse near 1500 microseconds means the centre, with shorter and longer pulses moving to each side. A continuous-rotation servo has the position sensor removed or disconnected, so it can never reach agreement. The same pulse sets speed and direction instead, and 1500 microseconds means stop.
The pulse range that gives exactly 0 to 180 degrees is not the same on every unit. The Arduino Servo library assumes a default range of 544 to 2400 microseconds. Many small servos use a narrower range, so the end angles will fall short or hit the stop and buzz.
How to confirm the cause
- Check the servo body. Continuous-rotation versions are often marked as such. If in doubt, send 1500 microseconds. A positional servo goes to the centre, and a continuous one stops or creeps slowly.
- If it creeps at 1500 microseconds, it is a continuous type with a trim to adjust. A small turn of that trim screw usually brings it to a stop.
- Step the angle slowly towards each end. Stop when the horn stops moving, or when you hear a buzz, since that is the point it hits its end stop.
- Note the microsecond values at the two ends. Use them in attach() as the minimum and maximum.
- Check the supply voltage while the servo moves. A drop causes jitter that is easy to confuse with a wrong range.
Worked example
This sets a range of 500 to 2400 microseconds, which is a common choice for the SG90. Reduce the range if your servo buzzes at either end, because every unit differs. The sweep moves in 10-degree steps so you can watch where the horn stops moving.
#include <Servo.h>
Servo s;
void setup() {
s.attach(9, 500, 2400); // pin, min us, max us
s.writeMicroseconds(1500); // centre
delay(1000);
}
void loop() {
for (int a = 0; a <= 180; a += 10) {
s.write(a);
delay(300);
}
}Common mistakes
- Using a continuous servo for a position task, then trying to fix it in code.
- Setting the range wider than the servo can travel, which makes it push against the end stop.
- Using a battery or USB port that cannot supply the servo, then blaming the angle.
- Moving the horn by hand while the servo is powered, which can strip gears.
If this did not fix it
- Supply and ground: a shared ground between the servo supply and the board is needed for the signal to be read.
- The horn fitted a tooth out. Remove it and fit it again at the centre position.
- Library conflicts that use the same timer as the Servo library, such as some PWM code on certain pins.