Arduino Uno R3 Elegoo Servo Project

Arduino+Uno+R3+Elegoo+Servo+Project

Today I will be making the arduino uno R3 elegoo servo project. The materials you will need for this project are, a USB cable, the uno R3 controller board, 3 breadboard jumper wires, and one servo motor SG90. I will be going through the steps one by one in order for you to follow along.

Step 1: Connect your first wire to the 5V pin on the uno R3 controller board

Step 2: Connect your second wire to the GND pin (ground pin) on the uno R3 controller board

Step 3: Connect your third wire to this pin “~9” on the uno R3 controller board

Step 4: Now take the wire that you connected to the 5V pin and connect the other end to the red wire on the servo

Step 5: Take the wire that you connected to the GND pin (ground pin) and connect the other end to the brown wire on the servo

Step 6: Take the wire that you connected to the “~9” pin and connect the other end to the orange wire on the servo

Step 7: Now connect the USB cable to the uno R3 controller board and after that connect it to your computer

Step 8: Now you have to instal the code to the project which will be located below under the video

You are done, your servo should be moving after you have installed the code. And this is how you make the arduino uno R3 elegoo servo project.

Code for the servo project:

/*
Sweep

by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.

modified 8 Nov 2013 by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/

#include <Servo.h>

int pos = 0;

Servo servo_9;

void setup()
{
servo_9.attach(9);

}

void loop()
{
// sweep the servo from 0 to 180 degrees in steps
// of 1 degrees
for (pos = 0; pos <= 180; pos += 1) {
// tell servo to go to position in variable ‘pos’
servo_9.write(pos);
// wait 15 ms for servo to reach the position
delay(15); // Wait for 15 millisecond(s)
}
for (pos = 180; pos >= 0; pos -= 1) {
// tell servo to go to position in variable ‘pos’
servo_9.write(pos);
// wait 15 ms for servo to reach the position
delay(15); // Wait for 15 millisecond(s)
}
}