Microcontroller › 8051 › Interface 8051 to a 12V dc motor
- This topic has 13 replies, 14 voices, and was last updated 8 years, 8 months ago by amol ghodke.
-
AuthorPosts
-
October 14, 2010 at 1:01 pm #435kapilParticipant
Can anybody provide me details of connecting 8051 to a dc motor with code and diagram.
Thanks,
rahul
October 20, 2010 at 4:41 am #5100AnonymousGuestuse L293D to interface 12V motor to microcontroller. control signals for the driver can be given in the code.
October 20, 2010 at 5:36 am #5103dagakshayParticipantyou can use any motordriver Ckt (eg: H-bridge using TIP transistors, relays, l293d or l298….)
there are no of reasons that the o/p of microcontroller cant be feed directly to motors, for simply understanding that you can say microcontroller can’t provide that much of current to drive a motor.
February 3, 2012 at 8:19 am #7105praveen kumarParticipanti need l293d usage to at89s51….can any body plz mail me..
February 9, 2012 at 7:09 pm #7128mother lives foreverParticipantcan anyone gives me the descripription of interfacing dc motor with 8051….i need the code there plzzzzzzz
February 9, 2012 at 7:50 pm #7129Syed AameerParticipantgive the ports output to h bridge(L293d).for pin number 2,7,10,15(if you are using 2 motors).then connect motors to pin number 3,6,11,14 respectively.
In program if you give 00 or 11 off state
10 one direction
01 opposite direction (*for each motor )
Repeat the above for other motor too……..
February 10, 2012 at 11:43 pm #7147DexterParticipantthis may help u
March 25, 2012 at 8:27 pm #7329BILAL sadiqParticipanthi every one can some one help me please
i do not know how to connect 12V supply for my dc motor with 5v microcontroller 8051 ,,,i mean to say in hardware what should i do ???? should i use LM7812 or how ,,,,,please do help me ,,,,,what and how i manage to run a 12V dc motor with 8051 microcontroller,,,i know the theory(about L293D) but on hardware how can i get 12 V ???
please help me and especially guide me please
waiting for nice advices and help …
thanksMarch 31, 2012 at 9:50 am #7366anurudh tiwariParticipantHERE THE FULL DETAIL OF THE 12V DC INTERFACING WITH THE HELP OF THE L293D IC
..L293D Dual H-Bridge Motor Driver
L293D is a dual H–Bridge motor driver, So with one IC we can interface two DC motors which can be controlled in bothclockwise and counter clockwise direction and if you have motor with fix direction of motion the you can make use of all thefour I/Os to connect up to four DC motors. L293D has output current of 600mA and peak output current of 1.2A perchannel. Moreover for protection of circuit from back EMF ouput diodes are included within the IC. The output supply (VCC2)has a wide range from 4.5V to 36V, which has made L293D a best choice for DC motor driver.
A simple schematic for interfacing a DC motor using L293D is shown below.As you can see in the circuit, three pins are needed for interfacing a DC motor (A, B, Enable). If you want the o/p to beenabled completely then you can connect Enable to VCC and only 2 pins needed from controller to make the motor work.
As per the truth mentioned in the image above its fairly simple to program the microcontroller. Its also clear from the truthtable of BJT circuit and L293D the programming will be same for both of them, just keeping in mind the allowed combinationsof A and B. We will discuss about programming in C as well as assembly for running motor with the help of a microcontroller.March 31, 2012 at 6:21 pm #7369tarunParticipant#include<reg51.h>
sbit enable1=P1^0;sbit enable2=P1^2;sbit mtr1_1=P1^1;sbit mtr1_2=P1^7;sbit mtr2_1=P1^3;sbit mtr2_2=P1^6;sbit sw1=P2^2;sbit sw2=P2^3;sbit sw3=P2^4;sbit sw4=P2^5;void delay(void);void main(){P1=0x00;P2=0xff;while(1){enable1=0x00;enable2=0x00;delay();if(sw1==0x00){enable1=0x01;enable2=0x01;delay();mtr1_1=0x01;mtr1_2=0x00;mtr2_1=0x01;mtr2_2=0x00;}else if(sw2==0x00){enable1=0x01;enable2=0x01;delay();mtr1_1=0x00;mtr1_2=0x01;mtr2_1=0x00;mtr2_2=0x01;}else if(sw3==0x00){enable1=0x01;enable2=0x01;delay();mtr1_1=0x01;mtr1_2=0x00;mtr2_1=0x00;mtr2_2=0x01;}else if(sw4==0x00){enable1=0x01;enable2=0x01;delay();mtr1_1=0x00;mtr1_2=0x01;mtr2_1=0x01;mtr2_2=0x00;}else if(sw1==0x0f&&sw2==0x0f&&sw3==0x0f&&sw4==0x0f){enable1=0x00;enable2=0x00;delay();}}}void delay(){int i,j;for(i=1;i<=2;i++)for(j=1;j<=500;j++);}March 31, 2012 at 6:24 pm #7370Dinesh KumawatParticipant/*Connections:1. Connect P2.0 to E1 pin of L293D Section on the kit2. Connect P2.1 to I1 pin of L293D Section on the kit3. Connect P2.2 to I2 pin of L293D Section on the kit4. Connect VS pin of L293D section to Vcc Pin. The Vcc pin is the 1st pin on the 6 pin header (marked as ISP) just above the 89V51RD2 IC. This provides 5V to the DC Motor. In case your DC motor requires higher voltage (max 12V) then connect external DC power source to VS & GND pins of L293D section.*/#include <REG52.H> /* special function register declarations *//* for the intended 8051 derivative */#include <stdio.h> /* prototype declarations for I/O functions *///L293D Pin Definessbit E1 = P2^0;sbit I1 = P2^1;sbit I2 = P2^2;void MSdelay(unsigned int rtime){unsigned int r,s;for(r=0;r<rtime;r++)for(s=0;s<1275;s++);}void main (void) {E1 = 1; //Set E1 pin High to Enable Channel of L293Dwhile(1) //End less while so that program never ends{//Rotate in One DirectionI1 = 0;I2 = 1;MSdelay(500);//Rotate in Other DirectionI1 = 1;I2 = 0;MSdelay(500);}}April 27, 2012 at 3:02 pm #7557MeghanaParticipantcan anyone please tell me give the circuit for driver of stepper motor of specification 1mA. this motor is interfaced with FPGAn not with microcontroller.
October 10, 2013 at 1:11 pm #10521vinoth kumarParticipantuse L293D to interface 5V motor relay control the direction to microcontroller. control signals for the driver can be given in the code.
February 9, 2016 at 10:14 am #13698amol ghodkeParticipantcan u give me c code for controlling of dc motor with 8051 using 7 switch array
-
AuthorPosts
- You must be logged in to reply to this topic.