Electric motor: machine that converts electricity into a
mechanical motion (rotations).
Types of motors
MOTORS FOR ES
STEPPER MOTOR SERVO MOTOR DC MOTOR
TYPES OF
MOTORS
for ES
STEPPER MOTOR
- Control on every step
- Precise time and distance control
SERVO MOTOR
- Moves in fixed angles.
- Rotatory actuator that allows precise control of
angular position.
- Application: robotics, car windshield wiper.
DC MOTOR
- Power delivered is direct DC.
- Widely used for Line-O-Bot
- Application: small toys, disk drives.
Gear DC MOTOR
Internal structure of DC Motor
Internal structure of Stepper Motor
STEPPER
MOTOR
SERVO MOTOR
DC MOTOR
Task
MOTOR AND ITS PURPOSE
• Fans (starter)
• Laptops (fan inside the computer)
• Mobile phones (for vibrations)
• Printer carriage motor.
• Car- window.
DC Motors are used everywhere.
For current amplification, we require a motor
driver IC.
Problem
IC L293D
 It is a motor driver IC.
 It has internal clamp diodes
 Output current 600mA per channel.
Supply Voltage range of 4.5 V to 36 V.
 Dual Half H-Bridge Drive.
H-BRIDGE
1 0 CLOCKWISE
0 1 ANTI- CLOCKWISE
0 0 HALT
1 1 HALT
H-BRIDGE
1 0 CLOCKWISE
0 1 ANTI- CLOCKWISE
0 0 HALT
1 1 HALT
MOTOR MOVEMENTS
Moving the bot…..
MOTOR 1 MOTOR 2 MOVEMENT
10 01 FORWARD
10 00 SLIGHT RIGHT
10 10 SHARP RIGHT
00 01 SLIGHT LEFT
01 01 SHARP LEFT
01 10 BACKWARD
L R
Always look
from
OUTSIDE
0 1 1 0 -- FORWARD
0 0 1 0 -- LEFT
0 1 0 0 -- RIGHT
LET’S ROTATE A MOTOR!!!...
#include<avr/io.h>
#include<util/delay.h>
int main(void)
{
DDRB=0b11111111; //port b is connected to L293D//
while(1)
{
PORTB=0b00000010; //clockwise logic//
_delay_ms(5000);
PORTB=0b00000000; //halt//
_delay_ms(5000);
PORTB=0b00000001; //anti-clockwise logic//
_delay_ms(5000);
PORTB=0b00000000; //halt//
_delay_ms(5000);
}
}
Lets Program the Motors…
#include<avr/io.h>
#include<util/delay.h>
int main(void)
{
DDRB=0b00001111;
while(1)
{
PORTB=0b00001001; //Move Forward
}
}
#include<avr/io.h>
#include<compat/deprecated.h>
#include<util/delay.h>
int main(void)
{
DDRB=0b00001111;
while(1)
{
PORTB=0b00001001; //Move Forward
_delay_ms(1000);
PORTB=0b00000110; //Move Backward
_delay_ms(1000);
}
}
Lets turn the bot…..
#include<avr/io.h>
#include<compat/deprecated.h> //bit level operations
#include<util/delay.h>
int main(void)
{
DDRB=ob00001111;
while(1)
{
PORTB=ob00001000; //Slight right turn
_delay_ms(1000);
PORTB=ob00001010; //Sharp right turn
_delay_ms(1000);
}}
Now take a left turn….
#include<avr/io.h>
#include<util/delay.h>
int main(void)
{
DDRB=0b00001111;
while(1)
{
PORTB=0b00000001; //Slight left turn
_delay_ms(1000);
PORTB=0b00000101; //Sharp left turn
_delay_ms(1000);
}
Thank U

Motors