Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Controlled Servo Motor Sequence

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled Servo Motor Sequence

Circuit Documentation

Summary

This circuit consists of an Arduino UNO microcontroller board interfaced with a Tower Pro SG90 servo motor. The Arduino UNO is programmed to control the position of the servo motor by sending it a series of pulse-width modulation (PWM) signals. The servo motor is powered directly from the Arduino's 5V output and is controlled via one of the Arduino's digital I/O pins.

Component List

Arduino UNO

Tower Pro SG90 Servo

Wiring Details

Arduino UNO

Tower Pro SG90 Servo

Documented Code

sketch.ino

#include <Servo.h>
Servo servo;

void setup() {
  servo.attach(7); // Attaches the servo on pin 7 to the servo object
}

void loop() {
  // Rotates the servo to various angles with a 2-second delay between each move
  servo.write(0);
  delay(2000);
  servo.write(30);
  delay(2000);
  servo.write(60);
  delay(2000);
  servo.write(90);
  delay(2000);
  servo.write(120);
  delay(2000);
  servo.write(150);
  delay(2000);
  servo.write(180);
  delay(2000);
  servo.write(210);
  delay(2000);
  servo.write(240);
  delay(2000);
  servo.write(270);
  delay(2000);
  servo.write(300);
  delay(2000);
  servo.write(330);
  delay(2000);
  servo.write(360);
  delay(2000);
}

documentation.txt

The provided code file documentation.txt is empty and does not contain any additional information.