Actuator

⚙️ SG90 Servo Motor (180°)

📌 Description

The SG90 servo motor is a small, lightweight motor that can rotate to a specific angle between 0° and 180°. Unlike regular motors that spin continuously, a servo motor moves to precise positions, making it ideal for robotics and control systems.

🎯 Use

In our projects, the SG90 servo is used to:

  • Move robot arms or joints.
  • Control steering mechanisms.
  • Create precise movements like opening/closing doors or pointing sensors.

👉 Think of the servo as the robot’s muscle — it moves exactly where you tell it to.

Module parameters

Pin name Description
Brown line GND (Power Input Negative)
Red line VCC (Power Input Cathode)
Orange line Control signal pins
  • Supply voltage: 4.8V to 6V DC
  • Standby Current: 5mA
  • Limit Angle: 210°±5%
  • Torque: 1.3 to 1.7kg/cm
  • Operating temperature: -10°C to 60°C
  • Humidity range: 60%±10%
  • Rotational speed: 0.09 to 0.10 sec/60° (4.8V)
  • Signal period: 20 ms
  • Signal High Level Time Range: 1000 to 2000 us/cycle

🖥️ Code Explanation

import servo
import time

while True:
    servo.servo180_angle(25, 0)     # Move to 0°
    time.sleep(0.5)                 # Wait 0.5 seconds
    servo.servo180_angle(25, 90)    # Move to 90°
    time.sleep(0.5)                 # Wait 0.5 seconds
    servo.servo180_angle(25, 180)   # Move to 180°
    time.sleep(0.5)                 # Wait 0.5 seconds
    servo.servo180_angle(25, 90)    # Return to 90°
    time.sleep(0.5)                 # Wait 0.5 seconds

Step by Step

  1. import servo, time → Tools for controlling the servo and adding pauses.
  2. servo.servo180_angle(25, 0) → Moves the servo on pin 25 to .
  3. time.sleep(0.5) → Waits half a second.
  4. servo.servo180_angle(25, 90) → Moves the servo to 90° (middle position).
  5. servo.servo180_angle(25, 180) → Moves the servo to 180° (maximum position).
  6. Loop repeats → The servo cycles through 0°, 90°, 180°, and back to 90°.

👉 Together, this program makes the servo sweep through its range of motion continuously.


✅ Conclusion of the Test

  • If the servo moves smoothly between 0°, 90°, and 180°, the program is working correctly.
  • This test shows how the robot can control precise angles with a servo motor.
  • Later, the servo could be used for robot arms, steering systems, or sensor positioning.
On this page