SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à 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
 

Similaire à 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
 

Plus de 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
 

Plus de 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
 

Dernier

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 

Dernier (20)

LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 

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