Servo SG90 9g 180 Degree (Torque: 1.6KG)

### Lesson Plan: Understanding and Utilizing the Servo SG90 9g 180 Degree in Electronic Circuits

**Introduction**

In this lesson, we will explore the operational principles and practical applications of the Servo SG90 9g 180 Degree. Servos are essential components in robotics and automation projects because they provide precise control over angular position. By the end of this lesson, you will have a comprehensive understanding of how the SG90 servo works and how to control it using the Raspberry Pi Pico WH.

**Learning Objectives**

Upon completing this lesson, you will be able to:
1. Identify the physical characteristics of the Servo SG90 9g 180 Degree.
2. Explain the function of a servo motor and its role in electronic circuits.
3. Implement the SG90 servo to perform precise angular movements using the Raspberry Pi Pico WH.

**Materials Needed**

– Servo SG90 9g 180 Degree
– Breadboard
– Jumper wires
– Raspberry Pi Pico WH
– External power supply (if needed)
– Multimeter (optional)

**Background Information**

A servo motor, such as the SG90, consists of a DC motor, a gear train, a position sensor, and a control circuit. The SG90 servo can rotate approximately 180 degrees (90 degrees in each direction). It receives control signals in the form of Pulse Width Modulation (PWM) to set the angular position of its shaft.

**Servo Characteristics**

The SG90 servo has three wires:
– **Orange (Signal)**: Receives the PWM control signal.
– **Red (VCC)**: Power supply (typically 4.8V to 6V).
– **Brown (GND)**: Ground.

**Principles of Operation**

The servo operates by receiving PWM signals to control its position:
– **PWM Control**: The width of the PWM pulse determines the angular position of the servo shaft.
– **Angle Range**: The SG90 can rotate from 0 to 180 degrees based on the PWM signal.

**Circuit Diagram and Setup**

**Step-by-Step Instructions**

1. **Identify the Servo Wires**:
– Locate the orange (signal), red (VCC), and brown (GND) wires on the SG90 servo.

2. **Set Up the Breadboard Circuit**:
– Place the SG90 servo on the breadboard.
– Connect the red wire of the servo to the 5V pin on the Raspberry Pi Pico WH or an external power supply (if the servo requires more current than the Pico can provide).
– Connect the brown wire of the servo to the ground (GND) pin on the Raspberry Pi Pico WH.
– Connect the orange wire of the servo to a GPIO pin (e.g., GP0) on the Raspberry Pi Pico WH.

3. **Write the Control Code**:
– Open your MicroPython IDE and write the following code to control the SG90 servo and move it to different positions:

“`python
from machine import Pin, PWM
from time import sleep

# Initialize PWM for servo control
servo = PWM(Pin(0))
servo.freq(50)

def set_servo_angle(angle):
duty = int((angle / 180) * 1023 + 512)
servo.duty_u16(duty)

while True:
for angle in range(0, 181, 30):
set_servo_angle(angle)
sleep(1)
for angle in range(180, -1, -30):
set_servo_angle(angle)
sleep(1)
“`

4. **Upload and Test the Code**:
– Connect your Raspberry Pi Pico WH to your computer using a Micro USB cable.
– Upload the code to the Raspberry Pi Pico WH.
– Observe the SG90 servo rotating to different angles in steps of 30 degrees, pausing for one second at each position.

5. **Optional: Measure Signal Characteristics**:
– Use a multimeter to measure the voltage across the VCC and GND wires to ensure proper power supply.
– Verify the PWM signal on the signal wire using an oscilloscope to observe the PWM pulse width.

**Applications and Extensions**

1. **Robotics**:
– Use the SG90 servo in robotics projects to control the movement of arms, legs, or other mechanical parts.
– Combine with sensors to create autonomous or remote-controlled robots.

2. **Automated Systems**:
– Implement the SG90 servo in automated systems for precise control of valves, levers, or other mechanisms.
– Integrate with other sensors and actuators for complex automation tasks.

3. **Interactive Projects**:
– Use the SG90 servo in interactive projects where precise angular control is required, such as in pan-tilt camera mounts or animatronic displays.
– Experiment with different control algorithms to achieve smooth and accurate movements.

**Summary and Review**

This lesson has provided a detailed exploration of the Servo SG90 9g 180 Degree, covering its identification, operational principles, and practical applications in electronic circuits. By understanding and utilizing servo motors, you can create dynamic and precise motion control systems for a variety of applications, enhancing the functionality and interactivity of your electronic projects.

Post a comment

Leave a Comment

Your email address will not be published. Required fields are marked *