SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Mais 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
 

Mais 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
 

Último

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 

Último (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).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