How to Control the SG90 Servo Motor With the Arduino UNO

by TechSensor in Circuits > Arduino

7282 Views, 3 Favorites, 0 Comments

How to Control the SG90 Servo Motor With the Arduino UNO

How To Control the SG90 Servo Motor With the Arduino UNO

In this tutorial you will learn how to control the SG90 Servo Motor with the Arduino UNO R3.

Supplies

Parts_list.png

You will need:

  • 1x Computer with Arduino IDE installed
  • 1x Arduino UNO R3 or clone
  • 1x USB Cable
  • 1x SG90 Servo Motor
  • 3x M-M Jumper Wires

Connect Jumper Wires to Servo Connector

step_1.png

Connect the jumper wires to the connector of the servo motor.

It is recommended to use the same color to avoid confusion.

Connect Black Jumper Wire to Ground on Arduino

step_2.png

Connect the black jumper wire to the ground (GND) on the Arduino.

Connect Red Jumper Wire to 5V on Arduino

step_3.png

Connect the red jumper wire to the 5V pin of the Arduino.

Connect Orange Jumper Wire to Pin 9 on Arduino

step_4.png

Connect the orange jumper wire to pin number 9 on the Arduino, since the code uses pin number 9.

Connect Usb Cable From Arduino to Computer

step_5.png

Plug in the USB cable into the arduino and with the other end into the USB port of the computer.

Open Arduino IDE and Select the Sweep Sketch

step_6.png

Launch the Arduino IDE software on the computer and go to "File - Examples - Servo - Sweep" to select the sweep sketch.

Upload Code to Arduino

step_7.png

Click the upload button to upload the sketch to the Arduino, the servo motor should be moving now.

Congratulations on completing this tutorial!