0% found this document useful (0 votes)
14 views8 pages

Lesson 17 Servo

This lesson teaches how to use a Servo motor with the RexQualis UNO R3 board, including hardware requirements and specifications. The SG90 Servo can rotate 180 degrees and is controlled by sending electrical pulses, with provided code for operation. The document also outlines experimental procedures for building the circuit and uploading the code to the board.

Uploaded by

Euronymous
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views8 pages

Lesson 17 Servo

This lesson teaches how to use a Servo motor with the RexQualis UNO R3 board, including hardware requirements and specifications. The SG90 Servo can rotate 180 degrees and is controlled by sending electrical pulses, with provided code for operation. The document also outlines experimental procedures for building the circuit and uploading the code to the board.

Uploaded by

Euronymous
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Lesson 17 Servo

Introduction

In this lesson, you will learn how to use Servo. Servo is a type of geared motor
that can only rotate 180 degrees. It is controlled by sending electrical pulses
from your UNO R3 board. These pulses tell the servo what position it should
move to.

Hardware Required

 1 * RexQualis UNO R3

 1 * Servo

 3 * M-M Jumper Wires

Principle

SG90 Servo

Tiny and lightweight with high output power. Servo can rotate approximately
180 degrees (90 in each direction), and works just like the standard kinds but
SMALLER. You can use any servo code, hardware or library to control these
servos. Good for beginners who want to make stuff move without building a
motor controller with feedback & gear box, especially since it will fit in small
places. It comes with a 3 horns (arms) and hardware.
Specifications

•Weight: 9 g

•Dimension: 22.2 x 11.8 x 31 mm approx.

•Stall torque: 1.8 kgf·cm

•Operating speed: 0.1 s/60 degree

•Operating voltage: 4.8 V (~5V)

•Dead band width: 10 µs

•Temperature range: 0 ºC – 55 ºC

Position "0" (1.5 ms pulse) is mi ddle, "90" (~2 ms pulse) is all the way to the
right, "-90" (~1 ms pulse) is all the way to the left.
Code interpretation

#include <Servo.h>

Servo myservo; // create servo object to control a servo,can get


to eight

int pos = 0; // variable to store the servo position

void setup() {

myservo.attach(9); // attaches the servo on pin 9 to the servo


object

void loop() {

for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180
degrees

// in steps of 1 degree

myservo.write(pos);

delay(15); // waits 15ms for the servo to


reach the position

}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0
degrees

myservo.write(pos);

delay(15); // waits 15ms for the servo to


reach the position

Experimental Procedures

Step 1:Build the circuit

Schematic Diagram
Step 2:Open the code:Servo_Code
Step 3: Attach Arduino UNO R3 board to your computer via
USB cable and check that the 'Board Type' and 'Serial Port' are
set correctly.

Step 4: Load the Library:Servo


Step 5:Upload the code to the RexQualis UNO R3 board.

Then, You can see the servo turns anticlockwise and then
turns clockwise.
If it isn’t working, make sure you have assembled the circuit
correctly, verified and uploaded the code to your board. For
how to upload the code and install the library, check Lesson 0
Preface.

You might also like