SG90 Micro Servo Motor
SG90 Micro Servo Motor
The SG90 Micro Servo Motor is a compact, high-performance servo motor designed for small-scale robotic and automation applications. This miniature servo motor is a popular choice among robotics enthusiasts, hobbyists, and professionals due to its ease of use, affordability, and high precision.
The SG90 Micro Servo Motor operates on the principle of servo control, where the motor rotates to a specific angle based on the input signal received from a microcontroller or other control devices. The motor uses a three-wire interface, consisting of power, ground, and signal wires, to receive commands and provide feedback.
The SG90 servo motor is designed to rotate to a specific angle within its mechanical range, typically between 0 and 180. The motor responds to pulse-width modulation (PWM) signals, where the width of the pulse determines the desired rotation angle. The servo motor's internal controller interprets the PWM signal and adjusts the motor's rotation accordingly.
| Parameter | Value |
| --- | --- |
| Operating Voltage | 3.5V - 6V |
| Maximum Torque | 1.8 kg-cm (25 oz-in) @ 4.8V |
| Maximum Speed | 60 degrees per second |
| Accuracy | 1 |
| Rotation Range | 0 - 180 |
| Weight | 9g (0.32 oz) |
| Dimensions | 22.8 x 11.8 x 22.8 mm (0.9 x 0.46 x 0.9 in) |
The SG90 Micro Servo Motor is a versatile and high-performance servo motor ideal for small-scale robotic and automation applications. Its compact size, high torque, and high accuracy make it a popular choice among robotics enthusiasts, hobbyists, and professionals. With its ease of use and affordability, the SG90 servo motor is an excellent component for a wide range of projects.
SG90 Micro Servo Motor DocumentationOverviewThe SG90 Micro Servo Motor is a small, lightweight, and high-precision servo motor designed for robotic, automation, and IoT applications. It is a popular choice for DIY projects and prototypes due to its compact size, ease of use, and affordability.Technical SpecificationsOperating Voltage: 4.8V to 6V
Operating Current: 10mA to 100mA
Torque: 1.6kg/cm (4.8V), 2.2kg/cm (6V)
Speed: 60/sec (4.8V), 120/sec (6V)
Rotation Angle: 0 to 180
Weight: 9g
Dimensions: 22.8mm x 11.8mm x 20.8mmConnecting the SG90 Micro Servo MotorTo use the SG90 Micro Servo Motor, you'll need to connect it to a microcontroller or a dedicated servo controller. The motor has three wires:VCC (Red): Connect to a power source (4.8V to 6V)
GND (Brown): Connect to ground
Signal (Orange): Connect to a digital pin on your microcontroller or servo controllerCode Examples### Example 1: Basic Servo Control with ArduinoThis example demonstrates how to control the SG90 Micro Servo Motor using an Arduino board.
```c++
#include <Servo.h>Servo servo; // create a servo objectvoid setup() {
servo.attach(9); // attach the servo to digital pin 9
}void loop() {
servo.write(0); // set the servo to 0
delay(1000);
servo.write(90); // set the servo to 90
delay(1000);
servo.write(180); // set the servo to 180
delay(1000);
}
```
### Example 2: Servo Control with Raspberry Pi and PythonThis example demonstrates how to control the SG90 Micro Servo Motor using a Raspberry Pi and Python.
```python
import RPi.GPIO as GPIO
import timeGPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT) // set GPIO 17 as an outputpwm = GPIO.PWM(17, 50) // create a PWM object with a frequency of 50Hz
pwm.start(0) // start the PWM with a duty cycle of 0while True:
pwm.ChangeDutyCycle(5) // set the servo to 0
time.sleep(1)
pwm.ChangeDutyCycle(10) // set the servo to 90
time.sleep(1)
pwm.ChangeDutyCycle(15) // set the servo to 180
time.sleep(1)
```
### Example 3: Servo Control with ESP32 and MicroPythonThis example demonstrates how to control the SG90 Micro Servo Motor using an ESP32 board and MicroPython.
```python
import machine
import timeservo = machine.PWM(machine.Pin(18), freq=50) // create a PWM object with a frequency of 50Hzwhile True:
servo.duty(50) // set the servo to 0
time.sleep(1)
servo.duty(100) // set the servo to 90
time.sleep(1)
servo.duty(150) // set the servo to 180
time.sleep(1)
```
Note: In all examples, make sure to adjust the pin numbers and frequencies according to your specific setup and requirements. Additionally, ensure that your power supply can provide the required voltage and current for the servo motor.