Assignment 9 – Servo

Component used:
1. Elego Uno R3
2. Servo (SG90)
3. Male to Male jumper wire

Servo motor:

A servo motor is a closed-loop system that uses position feedback to control its motion and final position. The main feature of the servo motors are the ability to precisely control the position of their shaft. Servo motors are used to control the position of objects, rotate objects, move legs, arms or hands of robots, move sensors etc. The best thing about a servo motor is that it can be connected directly to an Arduino.

Wiring Diagram:
Here we have connected the yellow wire to the 5V pin Arduino, Servo brown wire to the Ground pin Arduino and Servo yellow wire to PWM (9) pin Arduino.

Code:
When the program starts running, the servo motor will start rotate slowly from 0 degree to 180 degrees, one degree at a time. when the motor has rotated 180 degree , it will begin to rotate in the other direction until it returns to the home position.

Wiring Diagram

Leave a comment