Skip to main content

Arduino board interfacing with servo motor

1.    Servo motor

    A servomotor is a rotary actuator or linear actuator that allows for precise control of angular or linear position, velocity and acceleration. It consists of a suitable motor coupled to a sensor for position feedback. It also requires a relatively sophisticated controller, often a dedicated module designed specifically for use with servomotors.
                         


Table of specifications: -

S. no
Type
Specification
1
Size
38 x 11.5 x 24mm (Include tabs) 28 x 12.7 x 27mm (Not include tabs)
2
weight
17 to 18 g
3
Speed
0.14sec/60degrees (4.8V) 0.12sec/60degrees (6.0V
4
Torque
2.5kgf-cm (4.8V) 3.0kgf-cm (6.0V)
5
Voltage
4.8V-6.0V
6
Connector type
JR type (Yellow: Signal, Red: VCC, Brown:GND)


2.    Arduino interfacing with Servo motor

 Here we will see how to connect a servo motor and then how to turn it to different positions.
 The first motor I ever connected to an Arduino, seven years ago, was a Servo motor.  Nostalgic  moment over, back to work!
 We will need the following things:
 1.      An Arduino board connected to a computer via USB
 2.      A servo motor
 3.      Jumper wires


Following are the steps to connect a servo motor to the Arduino:
1.  The servo motor has a female connector with three pins. The darkest or even black one     is usually the ground. Connect this to the Arduino GND.
2.  Connect the power cable that in all standards should be red to 5V on the Arduino.
3.  Connect the remaining line on the servo connector to a digital pin on the Arduino.

Note: - Any digital pin of arduino board can be used to run servo motor but initial don’t forget to add servo library.

download servo library from here:Servo master library


Arduino code for Servo motor: -


#include <Servo.h>  //Include the Servo library


int servoPin = 3;   // Declare the Servo pin

Servo Servo1;      // Create a servo object

void setup()
{
   Serial.begin(9600);
   Servo1.attach(servoPin); / /We need to attach the servo to the used pin number
}

void loop()
{
   
   Servo1.write(0);      / / Make servo go to 0 degrees
   Serial.println("Rotate the servo with 0 degree");
   delay(1000);
   
   Servo1.write(90);       // Make servo go to 90 degrees
   Serial.println("Rotate the servo with 90 degree");
   delay(1000);
   
   Servo1.write(180);       // Make servo go to 180 degrees
   Serial.println("Rotate the servo with 180 degree");
   delay(1000);

}


Please share and follow my blog for more Arduino projects.

Comments

Popular posts from this blog

RFID-MFRC522 with Arduino Board.

1.     RFID MFRC522:        A normal RFID kit is just like our ATM card which can send a specific data to controller when it gets in touch with its reader module.       MFRC522 is name of controller which is being used in this RFID kit.   Figure 1 : RFID MRFC522      1.1 Specifications of RFID MFRC22 Module Name:MF522-ED Working current : 13 - 26mA / DC 3.3V Standby current : 10 - 13mA / DC 3.3V Sleep current : <80uA Peak current : <30mA Working frequency : 13.56MHz Card reading distance : 0 ~ 60mm ( Mifare1 card ) Protocol : SPI. Data communication speed : 10Mbit/s Max. Card types supported: Mifare1  S50, Mifare1 S70, Mifare UltraLight, Mifare Pro, Mifare  Desfire Dimension : 40mm × 60mm Working temperature : -20—80 degree Storage temperature : -40—85 degree Humidity : relevant humidity 5%—95% This RFID kit works on the...

Smart Home Door lock system project.

RFID MFRC522  Door lock system Project summary: RFID system radio frequency identification in which Information is written in the card or tag is get read by RFID module when they get in contact. In this project we are making a home lock system which would open only when an authorized card will be available and access will be denied on wrong card. Component require: - In this project we are interfacing Arduino board with RFID MFRC522 and servo motor. RFID system would send data to Arduino board and according to that data action would be taken by Arduino board. Components are listed below:         ·          Arduino board.         ·          Arduino software.         ·          RFID MFRC522 board.         ·        ...

An alarm system with Sound detector sensor.

Project: Alarm system with Sound sensor Project summary:  In this project we would interface our sound detector sensor and make alarm system which would detect any sound in the room of any kind of noise disturbance, by beeping up a buzzer. And also we would able to see the result on the Serial monitor of Arduino Software (IDE). Figure 1:alarm system with Sound detector sensor. Component & tools required: - In this project we would required the component and tools which are described below. ·          Arduino board. ·           Arduino Software (IDE). ·           Sound detector sensor. ·          Red led 1, and Green led 1. ·          Buzzer. ·          1K resisters 2....