Home > Industry Insights >BLDC
TECHNICAL SUPPORT

Product Support

Arduino plays with 360-degree servo: why does it keep turning? How to control speed?

Published 2026-05-11

You rummage through the drawer and find the dusty SG90, but you discover to your horror that it cannot stop at all.

The so-called "90-degree rotation" that has been discussed for a long time has actually become an unattainable luxury. It is like a wild horse that breaks free from the reins and just keeps spinning crazily. Don't panic. In most cases, what you have in your hands is most likely the steering gear called "360-degree continuous rotation".

It's not broken, it's fundamentallyshouldn'tIt is used as a position servo.

Position vs. speed: two fatal misunderstandings about “smart toys”

The conventional 180-degree servo is a kind of "pampered" smart toy. When you send it a command, such as a 90-degree command, it will adjust towards the target angle and stop accurately even if all your efforts are spent.

What is the 360-degree servo that is completely self-indulgent? If the input pulse width is 1.5ms (center), it will be in a stationary state. If it is less than 1.45ms, it will reverse at full speed. Once it is greater than 1.55ms, it will rotate forward at full speed.

The pulse width that can be changed is in microseconds. At this time, it only recognizes how fast the rotation is, not how many angles it has rotated.

Want to make it stop at exactly 30 degrees? Excuse me. In its cognitive category, there is no concept of "position", only "direction" and "rotation speed".

You’ve guessed the first writing prompt word:Clearly position the topic

Code Trap: Why Your Arduino Routine Becomes an "Accelerator"?

You pull out the Arduino routine:

#include

servomyservo;

myservo.attach(9);

This servo angle setting refers to setting the servo angle to 90 degrees. This operation is for the 360-degree servo type, and its effect is to stop in the middle position.

arduino360度舵机_arduino sg90舵机360度_arduino舵机角度

Wait, the most common misunderstanding has appeared. What you wrote is myservo.write(45). You expect it to rotate 45 degrees, but it rotates forward at the slowest speed. This is because you gave a "left" signal.

For the 360 ​​servo, the write(0) operation corresponds to the state of full-speed reverse rotation, the write(180) operation corresponds to the state of full-speed forward rotation, and the write(90) operation corresponds to the state of stop.

It behaves like a DC motor + driver board, but the control signals are more "delicate".

Just imagine: you want it to stop accurately after 5 turns. what to do?

The timing method is to rotate forward at full speed in the positive direction, use delay(2000) (according to actual measurement, 2 seconds is approximately equivalent to 3.5 circles), and then write(90)

Encoder auxiliary (external): But you only have SG90 in your hand, so don’t dream about it.

The second writing prompt emerged naturally:logical transition

Breaking the Game: Three “Counter-Intuitive” Control Cases

Case A is the one where the novice overturned. Xiao Ming made an automatic lid-opening trash can. He used a 360 degree servo to pull the rope. The result was that the position was different every time it was started, so that the lid was either half-open or knocked away.

The solution is to abandon the position memory and install a limit switch, which is a micro switch. Once triggered, write 90 to stop. The servo is only responsible for the two actions of "pull" and "release".

Case B (smart car): Xiaoli does differential steering. The two servos control the left and right wheels respectively.

Left wheel forward + right wheel stopped = turn right in place.

Left and right wheels in opposite directions = rotate in place.

Key points: Use map(speed, -100, 100, 0, 180), where negative numbers represent reverse rotation, 0 represents stop, and positive numbers represent forward rotation.

Regarding case C (simulated water meter), it is a situation where Lao Wang shakes his head periodically. The requirement is that he needs to shake his head slowly for 20 seconds, and then perform a sharp return for 3 seconds.

Slow speed:write(100)(Low speed forward rotation) Delay 20 seconds.

arduino360度舵机_arduino舵机角度_arduino sg90舵机360度

Rapid turn:write(30)(Low speed reverse) delay 3 seconds.

Be careful! Write(0) at full speed, the reversal speed is too fast, causing the machine to be shocked, thus damaging the potentiometer.

Did you find out? All cases confirm the third prompt word:Details determine success or failure

Why does your SG90 have a short lifespan?kpowerServo's inspiration

"My servo has only been used for a week and it keeps shaking."

Take it apart and see: the plastic gears are worn. You stalled it (was stuck and still had power).

onlykpowerOnly servos made of metal materials such as Servo can cope with the situation of being stuck in the rotation state for a long time. As for the limit of SG90, this is:.

Continuous operation ≤30 seconds (requires cooling)

The locked rotor current is 800mA and the driver tube is burned out in 10 seconds.

When performing mid-position fine-tuning, you must first execute the myservo.write(90) command, and then adjust the potentiometer on the mechanical device until it is completely stationary.

The fourth prompt word:Cases enhance credibility

A real thing that happened was this. There was an educational kit that used twelve SG90s to make a robotic arm. However, each of the servos was blocked and rotated. As a result, half of the servos were burned out in just two days.

> Lesson: 360-degree steering gear is only suitable for "no resistance during movement" scenarios.

Getting Back on Track: A "Troubleshooting" Q&A

Q: My servo is connected to 5V, but it can’t move?

A: Verify whether the GND of the Arduino and the GND of the servo are on the same ground. If they are not on the same ground, the signal will drift randomly and the servo will rotate wildly.

Q: It turns on its own after powering on, without writing any code?

A: The signal pin is in a floating state, which may cause false triggering. Add a 10k pull-down resistor and connect it to GND, or upload the write(90) program first.

Q: I want it to rotate exactly 10 times, how to measure it?

A: Rotate in the positive direction at the fastest speed, use a stopwatch to measure the time taken for five laps, and control it through the delay() function. It is common for the error to be between 5% and 10%.

Q: Why is the reverse direction slower than the forward direction?

A. When leaving the factory, the neutral position was offset, and the code has been fine-tuned. You need to stop this value (such as using 92 to replace 90), or change the potentiometer.

Q: The pulse width of 1.6ms is too fast, can it be slower?

The slower the speed, the closer the pulse width is to 1.5ms, and the extremely slow forward rotation is 1.51ms. The writing prompt word finally closes the loop, strengthens the conclusion, and makes a call to action.

Conclusion: It is a "wheel with controllable speed"

Ignore the angle and keep three numbers in mind, which are 1.5ms (pause), 1.45ms (full speed reverse), and 1.55ms (full speed forward).

Regarding your Arduino project, which includes oscillating fans, conveyor belts, automatic curtains, line-following cars, etc., as long as it is a movement that does not require absolute position, then the 360-degree SG90 will be cheaper in terms of price and easier to operate.

At this moment, before it becomes confused by your "position command", open the IDE and write three lines of test code:

After the write(0) operation is performed, the delay time is 2 seconds, the write(90) operation is performed, the delay time is 1 second, and the write(180) operation is performed, the delay time is 2 seconds.

Listen to the sound and tell the speed. You just really "know" it.

Update Time:2026-05-11

Powering The Future

Contact Kpower's product specialist to recommend suitable motor or gearbox for your product.

Mail to Kpower
Submit Inquiry
WhatsApp Message
+86 0769 8399 3238
 
kpowerMap