SlideShare a Scribd company logo
1 of 3
EMBEDDED SYSTEMS TUTORIAL11 - CONTROLLING DC
MOTORS WITH AVR
Hi…friends , welcome back..! I am again here with some embedded systems stuff , this time we will learn
how to control motor using AVR MCUs. Motors are very important for almost every ROBOTICS projects
and other electronics projects as well ,and using microcontroller with motors makes is very easy. So lets
have a look , how it happens..??

Introduction
As we know we can generate different output signal from our MCU, which are used to drive the motors
but the signal generated by the MCU is not strong enough to drive the motor , so we need something else
to drive the motor as per the instruction of MCU, and this something else is a motor drive , there are many
motor drivers available , like ULN200X family ICs , L293D and L298 etc. here we are going to
use L293D. I will suggest you to go through my article

Before reading this article as I have discussed almost everything in that article about L293D. ROBOTICS
TUTORIAL 1- HOW TO USE L293D MOTOR DRIVER IC
Now we are pretty much clear about our task, we have to drive a simple DC motor using AVR MCU and
L293D motor driver.

Connections
So first of we have to prepare connections . just implement this simple circuit for that. Things we are going
to need are2 MOTORs
L293D IC
ATmega 16
And some connecting wire and power supply.
Source code
Here is sample code. The code is written to rotate two motors in clockwise direction for some time ,then to
stop one motor and rotate other one in clockwise direction for some time and again rotate second motor
in clockwise direction and stop first one for some time ,then to rotate one motor in clockwise direction
and other one in anticlockwise direction and finally stop both the motor. Code is self explanatory still if you
are facing any problem just let me know..:)
/*
* DRIVING_MOTOR_WITH_AVR.c
*
* Created: 2/2/2013 10:04:53 PM
* Author: ABHILASH
*/
#include <avr/io.h>
#include <util/delay.h>
void main()
{
DDRC=0b00001111; //declaring pin 0-3 of PORTC as output pins
while(1)
{
PORTC=0b00000101; // both motor in clockwise direction
_delay_ms(3000); // delay for some time
PORTC=0b00000001; // only one motor rotating in clockwise direction
_delay_ms(3000); // delay for sometime
PORTC=0b00000100; // second motor rotating in clockwise direction
_delay_ms(3000); // delay for some time
PORTC=0b00001001; // one motor in clockwise direction other one in anticlockwise
_delay_ms(3000); // delay for some time
PORTC=0b00000000; // stop
_delay_ms(3000); // delay for some time
}
}

That all now burn your microcontroller with this program and power up the circuit and you will things going
on..and you can see how easy is it to control a motor with AVR MCU.

DOWNLOADS
You can download source code , .hex file and proteus design file hereSOURCE CODE .c FILE
.hex FILE OF PROGRAM
PROTEUS DESIGN FOR PROJECT

More Related Content

What's hot

EVM - The Heart of Ethereum
EVM - The Heart of EthereumEVM - The Heart of Ethereum
EVM - The Heart of EthereumTruong Nguyen
 
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNOObstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNOSanjay Kumar
 
Buy arduino robot By Robomart
Buy arduino robot By RobomartBuy arduino robot By Robomart
Buy arduino robot By RobomartRobomart India
 
Obstacle avoiding Robot
Obstacle avoiding RobotObstacle avoiding Robot
Obstacle avoiding RobotRasheed Khan
 
Obstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopy
Obstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopyObstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopy
Obstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopyElijah Barner
 
obstacle avoiding robot
obstacle avoiding robotobstacle avoiding robot
obstacle avoiding robotssuser5ba2241
 
Obstacle Detector & Find The Way to Reach Destination Robot
Obstacle Detector & Find The Way to Reach Destination RobotObstacle Detector & Find The Way to Reach Destination Robot
Obstacle Detector & Find The Way to Reach Destination RobotKms Nira
 
Autonomous metal search,collect and collision avoidance robot
Autonomous metal search,collect and collision avoidance robotAutonomous metal search,collect and collision avoidance robot
Autonomous metal search,collect and collision avoidance robotAkhil Unnikrishnan
 
Arduino Final Project
Arduino Final ProjectArduino Final Project
Arduino Final ProjectBach Nguyen
 
Obstacle avoiding car project slide
Obstacle avoiding car project slideObstacle avoiding car project slide
Obstacle avoiding car project slideShourovSarkerJoy
 
American Fibertek RR-2800E Data Sheet
American Fibertek RR-2800E Data SheetAmerican Fibertek RR-2800E Data Sheet
American Fibertek RR-2800E Data SheetJMAC Supply
 
Frankencar - Agile is Not Just for Software
Frankencar - Agile is Not Just for SoftwareFrankencar - Agile is Not Just for Software
Frankencar - Agile is Not Just for SoftwareMatt Spradley
 
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009Eoin Brazil
 
Final report obstacle avoiding roboat
Final report obstacle avoiding roboatFinal report obstacle avoiding roboat
Final report obstacle avoiding roboatShubham Thakur
 
Obstacle Avoidance Robot
Obstacle Avoidance RobotObstacle Avoidance Robot
Obstacle Avoidance RobotRatan Srikanth
 
Obstacle Avoiding Robot Report Robot23
Obstacle Avoiding Robot Report Robot23Obstacle Avoiding Robot Report Robot23
Obstacle Avoiding Robot Report Robot23Abhijeet kapse
 

What's hot (19)

EVM - The Heart of Ethereum
EVM - The Heart of EthereumEVM - The Heart of Ethereum
EVM - The Heart of Ethereum
 
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNOObstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
 
Buy arduino robot By Robomart
Buy arduino robot By RobomartBuy arduino robot By Robomart
Buy arduino robot By Robomart
 
Obstacle avoiding Robot
Obstacle avoiding RobotObstacle avoiding Robot
Obstacle avoiding Robot
 
Obstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopy
Obstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopyObstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopy
Obstacle_Avoidance_Robot_Coruse_Project_ECET402_Mechatronics_FinalCopy
 
obstacle avoiding robot
obstacle avoiding robotobstacle avoiding robot
obstacle avoiding robot
 
Obstacle Detector & Find The Way to Reach Destination Robot
Obstacle Detector & Find The Way to Reach Destination RobotObstacle Detector & Find The Way to Reach Destination Robot
Obstacle Detector & Find The Way to Reach Destination Robot
 
Autonomous metal search,collect and collision avoidance robot
Autonomous metal search,collect and collision avoidance robotAutonomous metal search,collect and collision avoidance robot
Autonomous metal search,collect and collision avoidance robot
 
Arduino Final Project
Arduino Final ProjectArduino Final Project
Arduino Final Project
 
Obstacle avoiding car project slide
Obstacle avoiding car project slideObstacle avoiding car project slide
Obstacle avoiding car project slide
 
American Fibertek RR-2800E Data Sheet
American Fibertek RR-2800E Data SheetAmerican Fibertek RR-2800E Data Sheet
American Fibertek RR-2800E Data Sheet
 
Frankencar - Agile is Not Just for Software
Frankencar - Agile is Not Just for SoftwareFrankencar - Agile is Not Just for Software
Frankencar - Agile is Not Just for Software
 
Obstacle avoiding robot
Obstacle avoiding robotObstacle avoiding robot
Obstacle avoiding robot
 
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 3 - Interactive Media CS4062 Semester 2 2009
 
Final report obstacle avoiding roboat
Final report obstacle avoiding roboatFinal report obstacle avoiding roboat
Final report obstacle avoiding roboat
 
Obstacle Avoidance Robot
Obstacle Avoidance RobotObstacle Avoidance Robot
Obstacle Avoidance Robot
 
Obstacle Avoiding Robot Report Robot23
Obstacle Avoiding Robot Report Robot23Obstacle Avoiding Robot Report Robot23
Obstacle Avoiding Robot Report Robot23
 
Exception handling on the x86
Exception handling on the x86Exception handling on the x86
Exception handling on the x86
 
Exception handling on the x86
Exception handling on the x86Exception handling on the x86
Exception handling on the x86
 

Similar to Est 11

Tutorial Arach N!D
Tutorial Arach N!DTutorial Arach N!D
Tutorial Arach N!Dkameshsept
 
Report no.6..(bipolar motor n DC motor)
Report no.6..(bipolar motor n DC motor)Report no.6..(bipolar motor n DC motor)
Report no.6..(bipolar motor n DC motor)Ronza Sameer
 
Design and Development of a prototype of AGV
Design and Development of a prototype of AGVDesign and Development of a prototype of AGV
Design and Development of a prototype of AGVKUNJBIHARISINGH5
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxMeghdeepSingh
 
ACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CARACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CARHarshit Jain
 
AVR Atmega16 based Projects List - ATMega32 AVR _ Atmega16 based Projects.pdf
AVR Atmega16 based Projects List - ATMega32 AVR _ Atmega16 based Projects.pdfAVR Atmega16 based Projects List - ATMega32 AVR _ Atmega16 based Projects.pdf
AVR Atmega16 based Projects List - ATMega32 AVR _ Atmega16 based Projects.pdfIsmailkhan77481
 
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptxVenuVenupk1431
 
Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and RoboticsNIT Raipur
 
Mini ee 5 motor speed controlling interfaces with microcontroller Electrical ...
Mini ee 5 motor speed controlling interfaces with microcontroller Electrical ...Mini ee 5 motor speed controlling interfaces with microcontroller Electrical ...
Mini ee 5 motor speed controlling interfaces with microcontroller Electrical ...1000kv technologies
 
Home Appliances Controlling using Android Mobile via Bluetooth
Home Appliances Controlling using Android Mobile via BluetoothHome Appliances Controlling using Android Mobile via Bluetooth
Home Appliances Controlling using Android Mobile via BluetoothMOKTARI MOSTOFA
 

Similar to Est 11 (20)

Tutorial Arach N!D
Tutorial Arach N!DTutorial Arach N!D
Tutorial Arach N!D
 
Report no.6..(bipolar motor n DC motor)
Report no.6..(bipolar motor n DC motor)Report no.6..(bipolar motor n DC motor)
Report no.6..(bipolar motor n DC motor)
 
Design and Development of a prototype of AGV
Design and Development of a prototype of AGVDesign and Development of a prototype of AGV
Design and Development of a prototype of AGV
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
 
ACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CARACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CAR
 
AVR Atmega16 based Projects List - ATMega32 AVR _ Atmega16 based Projects.pdf
AVR Atmega16 based Projects List - ATMega32 AVR _ Atmega16 based Projects.pdfAVR Atmega16 based Projects List - ATMega32 AVR _ Atmega16 based Projects.pdf
AVR Atmega16 based Projects List - ATMega32 AVR _ Atmega16 based Projects.pdf
 
Embedded notes.iet.trichy
Embedded notes.iet.trichyEmbedded notes.iet.trichy
Embedded notes.iet.trichy
 
Embedded notes.iet.trichy
Embedded notes.iet.trichyEmbedded notes.iet.trichy
Embedded notes.iet.trichy
 
Automotive report
Automotive report Automotive report
Automotive report
 
Part 2 master
Part 2 masterPart 2 master
Part 2 master
 
Project Report
Project ReportProject Report
Project Report
 
Part 2 master
Part 2 masterPart 2 master
Part 2 master
 
Wifi controlled rover prototype
Wifi controlled rover prototypeWifi controlled rover prototype
Wifi controlled rover prototype
 
project 3 full report
project 3 full reportproject 3 full report
project 3 full report
 
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
438050190-presentation-for-arduino-driven-bluetooth-rc-cr.pptx
 
Obstacle avoiding robot(Lab report)
Obstacle  avoiding  robot(Lab report)Obstacle  avoiding  robot(Lab report)
Obstacle avoiding robot(Lab report)
 
Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and Robotics
 
Mini ee 5 motor speed controlling interfaces with microcontroller Electrical ...
Mini ee 5 motor speed controlling interfaces with microcontroller Electrical ...Mini ee 5 motor speed controlling interfaces with microcontroller Electrical ...
Mini ee 5 motor speed controlling interfaces with microcontroller Electrical ...
 
Home Appliances Controlling using Android Mobile via Bluetooth
Home Appliances Controlling using Android Mobile via BluetoothHome Appliances Controlling using Android Mobile via Bluetooth
Home Appliances Controlling using Android Mobile via Bluetooth
 

More from Akshay Sharma

Eye monitored wheel chair control for people suffering from quadriplegia
Eye monitored wheel chair control for people suffering from quadriplegiaEye monitored wheel chair control for people suffering from quadriplegia
Eye monitored wheel chair control for people suffering from quadriplegiaAkshay Sharma
 
The next generation classroom smart, interactive and connected learning envir...
The next generation classroom smart, interactive and connected learning envir...The next generation classroom smart, interactive and connected learning envir...
The next generation classroom smart, interactive and connected learning envir...Akshay Sharma
 
Over voltage protector circuit
Over voltage protector circuitOver voltage protector circuit
Over voltage protector circuitAkshay Sharma
 
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...Akshay Sharma
 
A_law_and_Microlaw_companding
A_law_and_Microlaw_compandingA_law_and_Microlaw_companding
A_law_and_Microlaw_compandingAkshay Sharma
 
Ldr based line follower robot
Ldr based line follower robotLdr based line follower robot
Ldr based line follower robotAkshay Sharma
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full TutorialAkshay Sharma
 

More from Akshay Sharma (14)

Eye monitored wheel chair control for people suffering from quadriplegia
Eye monitored wheel chair control for people suffering from quadriplegiaEye monitored wheel chair control for people suffering from quadriplegia
Eye monitored wheel chair control for people suffering from quadriplegia
 
The buzzer glove
The buzzer gloveThe buzzer glove
The buzzer glove
 
The next generation classroom smart, interactive and connected learning envir...
The next generation classroom smart, interactive and connected learning envir...The next generation classroom smart, interactive and connected learning envir...
The next generation classroom smart, interactive and connected learning envir...
 
Over voltage protector circuit
Over voltage protector circuitOver voltage protector circuit
Over voltage protector circuit
 
Haptic technology
Haptic technologyHaptic technology
Haptic technology
 
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
Double Side Band – Suppressed Carrier (DSB-SC) Modulation Demodulation using ...
 
A_law_and_Microlaw_companding
A_law_and_Microlaw_compandingA_law_and_Microlaw_companding
A_law_and_Microlaw_companding
 
8085 instructions
8085 instructions8085 instructions
8085 instructions
 
Ldr based line follower robot
Ldr based line follower robotLdr based line follower robot
Ldr based line follower robot
 
Arduino Full Tutorial
Arduino Full TutorialArduino Full Tutorial
Arduino Full Tutorial
 
Est 8 2 nd
Est 8 2 ndEst 8 2 nd
Est 8 2 nd
 
Est 8 1 st
Est 8 1 stEst 8 1 st
Est 8 1 st
 
Est 6
Est 6Est 6
Est 6
 
Est 1
Est 1Est 1
Est 1
 

Recently uploaded

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 

Recently uploaded (20)

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 

Est 11

  • 1. EMBEDDED SYSTEMS TUTORIAL11 - CONTROLLING DC MOTORS WITH AVR Hi…friends , welcome back..! I am again here with some embedded systems stuff , this time we will learn how to control motor using AVR MCUs. Motors are very important for almost every ROBOTICS projects and other electronics projects as well ,and using microcontroller with motors makes is very easy. So lets have a look , how it happens..?? Introduction As we know we can generate different output signal from our MCU, which are used to drive the motors but the signal generated by the MCU is not strong enough to drive the motor , so we need something else to drive the motor as per the instruction of MCU, and this something else is a motor drive , there are many motor drivers available , like ULN200X family ICs , L293D and L298 etc. here we are going to use L293D. I will suggest you to go through my article Before reading this article as I have discussed almost everything in that article about L293D. ROBOTICS TUTORIAL 1- HOW TO USE L293D MOTOR DRIVER IC Now we are pretty much clear about our task, we have to drive a simple DC motor using AVR MCU and L293D motor driver. Connections So first of we have to prepare connections . just implement this simple circuit for that. Things we are going to need are2 MOTORs L293D IC ATmega 16 And some connecting wire and power supply.
  • 2. Source code Here is sample code. The code is written to rotate two motors in clockwise direction for some time ,then to stop one motor and rotate other one in clockwise direction for some time and again rotate second motor in clockwise direction and stop first one for some time ,then to rotate one motor in clockwise direction and other one in anticlockwise direction and finally stop both the motor. Code is self explanatory still if you are facing any problem just let me know..:) /* * DRIVING_MOTOR_WITH_AVR.c * * Created: 2/2/2013 10:04:53 PM * Author: ABHILASH */ #include <avr/io.h> #include <util/delay.h> void main() { DDRC=0b00001111; //declaring pin 0-3 of PORTC as output pins while(1) { PORTC=0b00000101; // both motor in clockwise direction _delay_ms(3000); // delay for some time
  • 3. PORTC=0b00000001; // only one motor rotating in clockwise direction _delay_ms(3000); // delay for sometime PORTC=0b00000100; // second motor rotating in clockwise direction _delay_ms(3000); // delay for some time PORTC=0b00001001; // one motor in clockwise direction other one in anticlockwise _delay_ms(3000); // delay for some time PORTC=0b00000000; // stop _delay_ms(3000); // delay for some time } } That all now burn your microcontroller with this program and power up the circuit and you will things going on..and you can see how easy is it to control a motor with AVR MCU. DOWNLOADS You can download source code , .hex file and proteus design file hereSOURCE CODE .c FILE .hex FILE OF PROGRAM PROTEUS DESIGN FOR PROJECT