top of page

Lesson-08 : Introduction to the interfacing of Servo with Arduino Uno

Firstly will look into the introduction of servo motor and it's working. Then we will study how to interface this servo motor with Arduino Uno.


Description of Servo motor

Positional rotation servo motor is the most important servo motor. Hence it is also the most common type of servo motor. The shaft output rotates in about 180 degree. Additionally it includes physical stops located in gear mechanism to stop turning outside these limits to guard the rotation sensor. These common servos involve in radio controlled water, ratio controlled cars, aircraft, robots, toys and many other applications.

Servo motorRotations of Servo motor


Interfacing Servo with Arduino


Interfacing Servo with Arduino
Interfacing Servo with Arduino

Components Required:

  1. Arduino Uno with usb cable

  2. Servo motor

  3. Jumper wires (Male to Male (3))

  4. Breadboard (optional)


Wiring of Servo motor with Arduino Uno Steps: -

  • Connect the first pin to the Digital pin 9 of the Arduino uno

  • Connect the 2nd pin to the +5v of Arduino

  • Connect the 3rd pin to the Gnd of Arduino

Code for Interfacing the Servo motor

  1. Define the Pin Mode in the void Setup

  2. Define the logic in the void Loop

Functions used in this example:

  1. pinMode(Pin_Number, IN/OUT); to set the mode i.e. input or output for example pinMode(3,OUTPUT);

  2. digitalWrite(Pin_Number,LOW/HIGH); to set the pin as High or low for example digitalWrite(3,LOW);

  3. delay(microseconds) to put a time delay between two instructions. For example delay(1000) i.e. 1 sec delay

Register for the IoT course provided by Nation Innovation.


9 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating