Servo Motor with L293D Shield

Driving Servo Motors with L293D Shield
A servo motor is a rotary actuator or a motor that allows for a precise control in terms of the angular position, acceleration, and velocity. Basically it has certain capabilities that a regular motor does not have. Consequently it makes use of a regular motor and pairs it with a sensor for position feedback .

Types of servo motors:
Servo motors can be of different types on the basis of their applications. The most important amongst them are : AC servo motor, DC servo motor, brushless DC servo motor, positional rotation servo motor, continuous rotation servo motor, and linear servo motor.

A typical servo motor comprises of three wires namely- power, control, and ground. The shape and size of these motors depends on their applications.

DC servo motor:
The basic operating principle of DC motor is the same as other electromagnetic motors. The design, construction, and the modes of operation are different. The rotors of this kind of motor are designed with long rotor length and smaller diameters. Their size is larger than that of conventional motors of same power ratings.
The motor shield actually breaks out Arduino’s 16bit PWM output pins #9 & #10 to the edge of the shield with two 3-pin headers. PWM pins, the sketch uses IDE’s built in Servo library.


#include <Servo.h>
Servo myservo; // create servo object to control a servo
int pos = 0; // variable to store the servo position
void setup()
// attaches the servo on pin 10 to the servo object

void loop()
// sweeps from 0 degrees to 180 degrees
for(pos = 0; pos <= 180; pos += 1) { myservo.write(pos); delay(15); } // sweeps from 180 degrees to 0 degrees for(pos = 180; pos>=0; pos-=1)

Subramanian MK, currently serving as a workshop instructor at Sakthi Polytechnic College, Erode Tamil Nadu. With a career spanning 25 + years, Subramanian MK has dedicated himself to advancing knowledge in Electronics and Communication Engineering (ECE). His passion for exploring new technologies has led to the development of numerous projects, showcasing expertise in IoT and PCB design.

Articles: 504

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Hi, How can I help you?