SlideShare a Scribd company logo
Servo Motors
1
Servo Motors
2
• A servo is a motor with a feedback system that helps to
control the position of the motor.
• Servo motors are small in size but pack a big punch and are
very energy efficient. Because of these features, they can be
used to operate remote-controlled or radio-controlled toy
cars, robots and airplanes. Servo motors are also used in
industrial applications, robotics, in-line manufacturing,
pharmaceutics and food services.
• Servo motors are great devices that can turn to a specified
position. Usually, they have a servo arm that can turn 180
degrees.
Servo Motors
3
There are so many types of servo motors:
Servo Motors
4
How it works
Servo Motors
5
Servos are clever devices. Using just one input pin, they receive
the position from the Arduino and they go there. Internally, they
have a motor driver and a feedback circuit that makes sure that
the servo arm reaches the desired position. But what kind of
signal do they receive on the input pin?
It is a square wave similar to PWM. Each cycle in the signal lasts
for 20 milliseconds and for most of the time, the value is LOW. At
the beginning of each cycle, the signal is HIGH for a time
between 1 and 2 milliseconds. At 1 millisecond it represents 0
degrees and at 2 milliseconds it represents 180 degrees. In
between, it represents the value from 0–180. This is a very good
and reliable method.
Servo Motors
To build such application, you need the following
components:
1. Arduino Uno
2. USB cable
3. Micro Servo Motor 180 degrees
4. Jumper wires
6
Servo Motors
7
Servo Motors
// Include the Servo library
#include <Servo.h>
// Declare the Servo pin
int servoPin = 3;
// Create a servo object
Servo Servo1;
void setup() {
// We need to attach the servo to the used pin number
Servo1.attach(servoPin);
}
8
The following code will turn a servo motor to 0 degrees, wait 1
second, then turn it to 90, wait one more second, turn it to 180,
and then go back.
Servo Motors
void loop(){
// Make servo go to 0 degrees
Servo1.write(0);
delay(1000);
// Make servo go to 90 degrees
Servo1.write(90);
delay(1000);
// Make servo go to 180 degrees
Servo1.write(180);
delay(1000);
}
9
Servo Motors
10
More things about servos:
•Controlling the exact pulse time
Arduino has a built-in function servo.write(degrees) that simplifies
the control of servos. However, not all servos respect the same
timings for all positions. Usually, 1 millisecond means 0 degrees, 1.5
milliseconds mean 90 degrees, and, of course, 2 milliseconds mean
180 degrees. Some servos have smaller or larger ranges.
For better control, we can use the servo.writeMicroseconds(us)
function, which takes the exact number of microseconds as a
parameter. Remember, 1 millisecond equals 1,000 microseconds.
Servo Motors
11
• More servos
In order to use more than one servo, we need to declare multiple
servo objects, attach different pins to each one, and address each
servo individually. First, we need to declare the servo objects—as
many as we need:
// Create servo objects
Servo Servo1, Servo2, Servo3;
Then we need to attach each object to one servo motor. Remember,
every servo motor uses an individual pin:
Servo1.attach(servoPin1);
Servo2.attach(servoPin2);
Servo3.attach(servoPin3);
Servo Motors
12
• Continuous rotation servos
There is a special breed of servos labelled as continuous rotation
servos. While a normal servo goes to a specific position depending
on the input signal, a continuous rotation servo either rotates
clockwise or counter-clockwise at a speed proportional to the
signal.
For example, the Servo1.write(0) function will make the servomotor
spin counter-clockwise at full speed. The Servo1.write(90)function
will stop the motor and Servo1.write(180) will turn the motor
clockwise at full speed.
Relay
13
Relay
• A relay is an electrically operated switch. Many relays use an
electromagnet to mechanically operate a switch.
• Relays are used where it is necessary to control a circuit by a low-
power signal (with complete electrical isolation between control
and controlled circuits), or where several circuits must be
controlled by one signal.
• There are many types of relays as follows:
14
Relay
How Relays work:
When power flows through the first circuit (1), it activates the
electromagnet (brown), generating a magnetic field (blue) that
attracts a contact (red) and activates the second circuit (2). When
the power is switched off, a spring pulls the contact back up to its
original position, switching the second circuit off again.
15
Relay
• Normally Open (NO) relay:
Normally open relays are the most common; the contacts in
the second circuit are not connected by default, and switch on
only when a current flows through the magnet.
• Normally Closed (NC) relay:
The contacts are connected so a current flows through them
by default and switch off only when the magnet is activated,
pulling or pushing the contacts apart.
16
Relay
To build such application, you need the following
components:
• Arduino Uno
• USB cable
• 5v relay
• AC power source
• A lamp (or any device that has to be controlled).
• Electrical wires
• Jumper wires
17
Relay
A simple example shows how to control a lamp using
a 5v relay.
18
19

More Related Content

PPTX
Newppt major
PPTX
servo motor control using arduino
PPTX
dual axis control of servomotor using joystick
PPTX
Robotic arm control through internet/Lan for patient operation
PDF
Radar System with Arduino Processor
PPT
ULTRASONIC
PPTX
Wireless gesture controlled robotic arm
Newppt major
servo motor control using arduino
dual axis control of servomotor using joystick
Robotic arm control through internet/Lan for patient operation
Radar System with Arduino Processor
ULTRASONIC
Wireless gesture controlled robotic arm

What's hot (19)

PPSX
Leading Robotics Research: SMAC Direct Drive Servo Motor Robotic Finger
PPT
Physical prototyping lab5-complex_sensors
PPTX
Sensor, Transducers and Actuator in Robotics
PPTX
SERVO MOTOR CONTROLLER
PPTX
Triac Based Automatic Voltage Stabilizer
PDF
Microcontroller based voltage stabilizer
PPTX
Servomotor control
PDF
Automated ppt
PPTX
Load Cells Explained
PPTX
Fire Fighting Robot using arduino UNO PPT
PPT
Rotary encoder training material
PDF
PPTX
Stepper and hbridgestepper motor as generator hack
PPTX
Obstacle Avoidance ROBOT using ARDUINO
PDF
Bot Robo Tanker Sound Detector
PDF
SGA Presentation
PPT
Stepper motor
PDF
Ultrasonicsensor 170828140914
PDF
Obstacle Avoidance Robot
Leading Robotics Research: SMAC Direct Drive Servo Motor Robotic Finger
Physical prototyping lab5-complex_sensors
Sensor, Transducers and Actuator in Robotics
SERVO MOTOR CONTROLLER
Triac Based Automatic Voltage Stabilizer
Microcontroller based voltage stabilizer
Servomotor control
Automated ppt
Load Cells Explained
Fire Fighting Robot using arduino UNO PPT
Rotary encoder training material
Stepper and hbridgestepper motor as generator hack
Obstacle Avoidance ROBOT using ARDUINO
Bot Robo Tanker Sound Detector
SGA Presentation
Stepper motor
Ultrasonicsensor 170828140914
Obstacle Avoidance Robot
Ad

Similar to Arduino based applications-part 3 (20)

PPTX
Topic 7 - Servo_US_Temp_IRrrrrrrrrrrrrrrrrrrrrrrrrr.pptx
PPTX
Servo Motors and it's applications .pptx
PDF
Pdpm,mayank awasthi,jabalpur,i it kanpur, servo motor,keil code
PPTX
Electric Servo Motor
PPTX
Robotic Hand
PPTX
Self Obstacle Avoiding Rover
DOC
Automatic room light contoller without microcontroller
PDF
Microcontroller part 3
PPTX
Robotic Arm using flex sensor and servo motor
PPTX
module 5_17.2 stepper motor copy microcontrollerpptx
PPTX
Robo arm final 2 (2)
PPTX
Microcontroller based four step linear stroke positioning system
PPTX
Motor Control Relay, Pwm, DC and Stepper Motors
PPTX
Actuators.pptx
PPT
Sensors
PPT
Sensors
DOCX
INTELIGENT RAILWAY SYSTEM
PPTX
Share 'speed control_of_dc_motor_using_microcontroller.pptx'[1][1]
PPTX
sunil jha presentation.pptx
Topic 7 - Servo_US_Temp_IRrrrrrrrrrrrrrrrrrrrrrrrrr.pptx
Servo Motors and it's applications .pptx
Pdpm,mayank awasthi,jabalpur,i it kanpur, servo motor,keil code
Electric Servo Motor
Robotic Hand
Self Obstacle Avoiding Rover
Automatic room light contoller without microcontroller
Microcontroller part 3
Robotic Arm using flex sensor and servo motor
module 5_17.2 stepper motor copy microcontrollerpptx
Robo arm final 2 (2)
Microcontroller based four step linear stroke positioning system
Motor Control Relay, Pwm, DC and Stepper Motors
Actuators.pptx
Sensors
Sensors
INTELIGENT RAILWAY SYSTEM
Share 'speed control_of_dc_motor_using_microcontroller.pptx'[1][1]
sunil jha presentation.pptx
Ad

More from Jawaher Abdulwahab Fadhil (20)

PDF
PPT
PDF
Add instruction-part1
PPTX
Dealing with 8086 memory
PPTX
MOV instruction part1
PDF
Cisco webex installation guide
PPTX
A survey on the applications of smart home
PPT
Flag register and add instruction
PDF
Computer Organization -part 1
PPTX
iOS Operating System
PPTX
Android Operating system
PPTX
Types of Mobile Applications
PDF
Ultrasonic with buzzer
PDF
Lecture6 modulation
PDF
Lecture 5: The Convolution Sum
PDF
Lecture 4: Classification of system
PDF
Lecture3: Operations of Ct signals
PDF
Lecture2 : Common continuous time signals
PDF
Lecture1: Introduction to signals
PDF
Arduino- Serial communication
Add instruction-part1
Dealing with 8086 memory
MOV instruction part1
Cisco webex installation guide
A survey on the applications of smart home
Flag register and add instruction
Computer Organization -part 1
iOS Operating System
Android Operating system
Types of Mobile Applications
Ultrasonic with buzzer
Lecture6 modulation
Lecture 5: The Convolution Sum
Lecture 4: Classification of system
Lecture3: Operations of Ct signals
Lecture2 : Common continuous time signals
Lecture1: Introduction to signals
Arduino- Serial communication

Recently uploaded (20)

PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Institutional Correction lecture only . . .
PPTX
Cell Structure & Organelles in detailed.
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
Business Ethics Teaching Materials for college
PDF
01-Introduction-to-Information-Management.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
102 student loan defaulters named and shamed – Is someone you know on the list?
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Institutional Correction lecture only . . .
Cell Structure & Organelles in detailed.
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
Cell Types and Its function , kingdom of life
Basic Mud Logging Guide for educational purpose
Renaissance Architecture: A Journey from Faith to Humanism
O5-L3 Freight Transport Ops (International) V1.pdf
Supply Chain Operations Speaking Notes -ICLT Program
PPH.pptx obstetrics and gynecology in nursing
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Final Presentation General Medicine 03-08-2024.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Insiders guide to clinical Medicine.pdf
Business Ethics Teaching Materials for college
01-Introduction-to-Information-Management.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
human mycosis Human fungal infections are called human mycosis..pptx

Arduino based applications-part 3

  • 2. Servo Motors 2 • A servo is a motor with a feedback system that helps to control the position of the motor. • Servo motors are small in size but pack a big punch and are very energy efficient. Because of these features, they can be used to operate remote-controlled or radio-controlled toy cars, robots and airplanes. Servo motors are also used in industrial applications, robotics, in-line manufacturing, pharmaceutics and food services. • Servo motors are great devices that can turn to a specified position. Usually, they have a servo arm that can turn 180 degrees.
  • 3. Servo Motors 3 There are so many types of servo motors:
  • 5. Servo Motors 5 Servos are clever devices. Using just one input pin, they receive the position from the Arduino and they go there. Internally, they have a motor driver and a feedback circuit that makes sure that the servo arm reaches the desired position. But what kind of signal do they receive on the input pin? It is a square wave similar to PWM. Each cycle in the signal lasts for 20 milliseconds and for most of the time, the value is LOW. At the beginning of each cycle, the signal is HIGH for a time between 1 and 2 milliseconds. At 1 millisecond it represents 0 degrees and at 2 milliseconds it represents 180 degrees. In between, it represents the value from 0–180. This is a very good and reliable method.
  • 6. Servo Motors To build such application, you need the following components: 1. Arduino Uno 2. USB cable 3. Micro Servo Motor 180 degrees 4. Jumper wires 6
  • 8. Servo Motors // Include the Servo library #include <Servo.h> // Declare the Servo pin int servoPin = 3; // Create a servo object Servo Servo1; void setup() { // We need to attach the servo to the used pin number Servo1.attach(servoPin); } 8 The following code will turn a servo motor to 0 degrees, wait 1 second, then turn it to 90, wait one more second, turn it to 180, and then go back.
  • 9. Servo Motors void loop(){ // Make servo go to 0 degrees Servo1.write(0); delay(1000); // Make servo go to 90 degrees Servo1.write(90); delay(1000); // Make servo go to 180 degrees Servo1.write(180); delay(1000); } 9
  • 10. Servo Motors 10 More things about servos: •Controlling the exact pulse time Arduino has a built-in function servo.write(degrees) that simplifies the control of servos. However, not all servos respect the same timings for all positions. Usually, 1 millisecond means 0 degrees, 1.5 milliseconds mean 90 degrees, and, of course, 2 milliseconds mean 180 degrees. Some servos have smaller or larger ranges. For better control, we can use the servo.writeMicroseconds(us) function, which takes the exact number of microseconds as a parameter. Remember, 1 millisecond equals 1,000 microseconds.
  • 11. Servo Motors 11 • More servos In order to use more than one servo, we need to declare multiple servo objects, attach different pins to each one, and address each servo individually. First, we need to declare the servo objects—as many as we need: // Create servo objects Servo Servo1, Servo2, Servo3; Then we need to attach each object to one servo motor. Remember, every servo motor uses an individual pin: Servo1.attach(servoPin1); Servo2.attach(servoPin2); Servo3.attach(servoPin3);
  • 12. Servo Motors 12 • Continuous rotation servos There is a special breed of servos labelled as continuous rotation servos. While a normal servo goes to a specific position depending on the input signal, a continuous rotation servo either rotates clockwise or counter-clockwise at a speed proportional to the signal. For example, the Servo1.write(0) function will make the servomotor spin counter-clockwise at full speed. The Servo1.write(90)function will stop the motor and Servo1.write(180) will turn the motor clockwise at full speed.
  • 14. Relay • A relay is an electrically operated switch. Many relays use an electromagnet to mechanically operate a switch. • Relays are used where it is necessary to control a circuit by a low- power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal. • There are many types of relays as follows: 14
  • 15. Relay How Relays work: When power flows through the first circuit (1), it activates the electromagnet (brown), generating a magnetic field (blue) that attracts a contact (red) and activates the second circuit (2). When the power is switched off, a spring pulls the contact back up to its original position, switching the second circuit off again. 15
  • 16. Relay • Normally Open (NO) relay: Normally open relays are the most common; the contacts in the second circuit are not connected by default, and switch on only when a current flows through the magnet. • Normally Closed (NC) relay: The contacts are connected so a current flows through them by default and switch off only when the magnet is activated, pulling or pushing the contacts apart. 16
  • 17. Relay To build such application, you need the following components: • Arduino Uno • USB cable • 5v relay • AC power source • A lamp (or any device that has to be controlled). • Electrical wires • Jumper wires 17
  • 18. Relay A simple example shows how to control a lamp using a 5v relay. 18
  • 19. 19