The SG90 servo motor is a compact and efficient actuator capable of precise position control. It is widely used in various applications such as radio-controlled devices, robotics, and small-scale automation projects. Its popularity stems from its affordability, reliability, and ease of use, making it an ideal choice for hobbyists and educators alike.
Pin Number | Color | Description |
---|---|---|
1 | Brown | Ground (GND) |
2 | Red | Power Supply (VCC) |
3 | Orange | Control Signal (PWM) |
#include <Servo.h>
Servo myservo; // create servo object to control the SG90
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
myservo.write(90); // sets the servo position to 90°
delay(1000); // waits for the servo to reach the position
myservo.write(0); // sets the servo position to 0°
delay(1000); // waits for the servo to reach the position
}
Q: Can I control the SG90 servo motor with a microcontroller other than Arduino?
A: Yes, any microcontroller with PWM output capability can be used to control the SG90.
Q: What is the maximum angle the SG90 servo motor can rotate?
A: The SG90 typically has a rotation range of 180 degrees, but the actual range may vary slightly.
Q: How can I increase the torque of the SG90 servo motor?
A: Torque cannot be increased beyond the motor's specifications; however, using the servo within its optimal voltage range can ensure maximum torque performance.