Online Course Reviews:

Thursday, January 15, 2015

DC Motor Interfacing with PIC Microcontroller ( PIC18F2550 ) in Proteus [step by step]


mikroc code to start and stop dc motor
DC Motor

This tutorial will describe,  how to interface a DC motor with a Microcontroller and in this tutorial, I will use pic18f2550 microcontroller. Generally, to control a DC motor we need voltage 12v with 300mA current. Basically a microcontroller works on 5v and can't provide the current follow to operate a DC motor.As we know a motor can produce back emf, we need other technique to operate .The solution will be a H-Bridge circuit or L293D ic.

H-Bridge Circuit for dc motor
H-Bridge Circuit 
L293D IC pin out
L293D


We can operate two motors through this IC. Here pin 1 is to enable input 1(pin1)&2(pin7) for input and 3&6 pins for output. Pin9 enables 3(pin 10)&4(15) as input and 14&11 pins as output. We will connect pin2 & pin7 with our microcontroller's pin RC0 and RC1 respectively. Now, look at the picture given below.
 DC Motor Interfacing with PIC Microcontroller ( PIC18F2550 ) in Proteus [step by step]
DC Motor Rotation Controlling


Now Create a new project in Proteus. If you are a beginner, just follow the instructions.

Proteus Circuit:

How to Create a New Project in Proteus 8_Step1
How to Create a New Project in Proteus 8_Step1
How to Create a New Project in Proteus 8_Step2
How to Create a New Project in Proteus 8_Step2

How to Create a New Project in Proteus 8_Step3
How to Create a New Project in Proteus 8_Step3
How to Pick parts from Proteus library
How to Pick parts from Proteus library
How to find Power ,Ground etc
Now just complete the circuit as I have given below.

 DC Motor Interfacing with PIC Microcontroller ( PIC18F2550 ) in Proteus [step by step]
Interface DC Motor with pic Microcontroller
Now we need source code to run this microcontroller. So let's create a project in MikroC.

MikroC Project :

Create a project in mikroC_Step_1
Create a project in mikroC_Step_2
Create a project in mikroC_Step_3
#Source Code :
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


void main() {
CMCON = 0x07; // To turn off comparators
ADCON1 = 0x0F;
Trisc=0x00;
delay_ms(1000);
while(1){
/////// Step1: Rotate Motor Clockwise
PORTC.F0=1;
PORTC.F1=0;
delay_ms(4000);   //delay for 4 sec
/////// Step2: Stop the Motor
PORTC.F0=0;
PORTC.F1=0;
delay_ms(4000);   //delay for 4 sec
 /////// Step3: Rotate Motor Anti-Clockwise
PORTC.F0=0;
PORTC.F1=1;
delay_ms(4000);   //waiting for 4 sec
  /////// Step4: Again Stop The Motor
PORTC.F0=1;
PORTC.F1=1;
delay_ms(4000);   //delay for 4 sec
}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Now run the program and save the hex file on your computer .
Run project in mikroC
Now go to the proteus circuit and load the hex to microcontroller
Load hex to microcontroller
Run the proteus project.
Run Proteus Project

Result :

 mikroc code to start and stop dc motor
DC motor in Clockwise direction
 DC Motor Interfacing with PIC Microcontroller ( PIC18F2550 ) in Proteus [step by step]
DC motor in Anti-Clockwise direction


      Download Proteus File & Hex file

                          Just Click on  '' SKIP ADD '' and You will get the download link

Thank You!



7 comments:

  1. Replies
    1. Dc Motor Interfacing With Pic Microcontroller ( Pic18F2550 ) In Proteus [Step By Step] - Learn Embedded Programming [Step By Step] >>>>> Download Now

      >>>>> Download Full

      Dc Motor Interfacing With Pic Microcontroller ( Pic18F2550 ) In Proteus [Step By Step] - Learn Embedded Programming [Step By Step] >>>>> Download LINK

      >>>>> Download Now

      Dc Motor Interfacing With Pic Microcontroller ( Pic18F2550 ) In Proteus [Step By Step] - Learn Embedded Programming [Step By Step] >>>>> Download Full

      >>>>> Download LINK yb

      Delete
  2. Very nice blog...
    Great information provided. We also provide PIC Microcontroller Training in Noida. I appreciate your work.

    ReplyDelete
  3. Dzone is a training institute and we have provided different types of study material to all students who can easily understand their concepts and ideas and they are easy to express ideas and they don’t have to go to any other place because they have provided all things they are students have been required. If you want to complete your project at a suitable time without any delay you can easily confirm your contact.

    https://bit.ly/downloadITprojects

    ReplyDelete
  4. Good to become visiting your weblog again, it has been months for me. Nicely this article that i've been waited for so long. I will need this post to total my assignment in the college, and it has exact same topic together with your write-up. Thanks, good share. valutazione camper buerstner

    ReplyDelete
  5. Dc Motor Interfacing With Pic Microcontroller ( Pic18F2550 ) In Proteus [Step By Step] - Learn Embedded Programming [Step By Step] >>>>> Download Now

    >>>>> Download Full

    Dc Motor Interfacing With Pic Microcontroller ( Pic18F2550 ) In Proteus [Step By Step] - Learn Embedded Programming [Step By Step] >>>>> Download LINK

    >>>>> Download Now

    Dc Motor Interfacing With Pic Microcontroller ( Pic18F2550 ) In Proteus [Step By Step] - Learn Embedded Programming [Step By Step] >>>>> Download Full

    >>>>> Download LINK XV

    ReplyDelete