Discussion in "Project Help" started by    kks    Mar 1, 2018.
Thu Mar 01 2018, 07:49 pm
#1
I posted a question before on the working of my project in Proteus. With the help from this website o successfully manged to run it on Proteus, but now when connecting the GND of motor driver ic to the GND of the 8051 programming board, the programming board doesn't even start. For better understanding (since the image its difficult to understand the connections) hers is the pins which i have connected to the 8051 programming board (i followed the proteus simulation circuit diagram which i am posting)

L293D MOTOR DRIVER IC :
A1 - P2.4
A2 - P2.5
EA - 5V
VCC - 12V
GND - GND

I also tried connecting the +ve to 12v and - ve to Gnd, still not working. Help me out here!


[ Edited Fri Mar 02 2018, 01:53 am ]
Thu Mar 01 2018, 07:54 pm
#2
Here's the attached images.






#include<reg51.h>

#include<string.h>

#include<stdio.h>

#define lcdport P1


sbit rs=P3^7;
sbit en=P3^5;
sbit rw=P3^6;
sbit m1=P2^4;
sbit m2=P2^5;

char i,rx_data[50];

char rfid[13],ch=0;

char pass[4];

void forwardmotor(void) ;
void stopmotor(void);

 void delay(int itime)
{
    int i,j;
    for(i=0;i<itime;i++)
    for(j=0;j<1275;j++);
}

void daten()
{
    rs=1;
	  rw=0;
    en=1;
    delay(5);
    en=0;
}

void lcddata(unsigned char ch)
{
    lcdport=ch & 0xf0;
    daten();
    lcdport=(ch<<4) & 0xf0;
    daten();
}

void cmden(void)
{
    rs=0;
    en=1;
    delay(5);
    en=0;
}

void lcdcmd(unsigned char ch)
{
    lcdport=ch & 0xf0;
    cmden();
    lcdport=(ch<<4) & 0xf0;
    cmden();
}

void lcdstring(char *str)
{
    while(*str)
    {
        lcddata(*str);
        str++;
    }
}

void lcd_init(void)
{
    lcdcmd(0x02);
    lcdcmd(0x28);
    lcdcmd(0x0e);
    lcdcmd(0x01);
}

void uart_init()
{
 TMOD=0x20;
 SCON=0x50;
 TH1=0xfd;
 TR1=1;
}
char rxdata()
{
  while(!RI);
    ch=SBUF;    
    RI=0;
    return ch;
}

void forwardmotor()
{
  m1=1; 
	m2=0;    
	delay(500);
  stopmotor(); 
	delay(500);
  m1=0; 
	m2=1;    
	delay(500);   
	stopmotor();
}


void stopmotor()
{
  m1=0; 
	m2=0;
}

void main()
{
    uart_init();
    lcd_init();
    lcdstring("  RFID Based    ");
    lcdcmd(0xc0);
    lcdstring("Security system "); 
    delay(400);
    while(1)
    {
        lcdcmd(1);
        lcdstring("Place Your Card:");
        lcdcmd(0xc0);
        i=0;
        for(i=0;i<12;i++)
        rfid[i]=rxdata();
        rfid[i]='\0';
        lcdcmd(1);
        lcdstring("Your ID No. is:");
        lcdcmd(0xc0);
        for(i=0;i<12;i++)
        lcddata(rfid[i]);
        delay(100);
        if(strncmp(rfid,"160066A5EC39",12)==0)
        {
            lcdcmd(1);
            lcdstring("Access Granted ");
            lcdcmd(0xc0);
            lcdstring("Person1");
            forwardmotor();
          }
        
        else if(strncmp(rfid,"160066BD7AB7",12)==0)
            {
            lcdcmd(1);
            lcdstring("Access Granted ");
            lcdcmd(0xc0);
            lcdstring("Person2");
            m1=1;
            m2=0;
            delay(300);
            m1=0;
            m2=0;
            delay(200);
            m1=0;
            m2=1;
            delay(300);
            m1=0;
            m2=0;
            }
            
                else if(strncmp(rfid,"160066203060",12)==0)
            {
            lcdcmd(1);
            lcdstring("Access Granted ");
            lcdcmd(0xc0);
            lcdstring("Person3");
            m1=1;
            m2=0;
            delay(300);
            m1=0;
            m2=0;
            delay(200);
            m1=0;
            m2=1;
            delay(300);
            m1=0;
            m2=0;    
            }

        else 
        {
           lcdcmd(1);
           lcdstring("Access Denied");
           delay(300);
        }
  }
}


[ Edited Fri Mar 02 2018, 02:08 am ]
Fri Mar 02 2018, 02:10 am
#3
The motor driver module.

Fri Mar 02 2018, 03:01 am
#4
EA is "Enable A".
It can be switched on and off by logic, or tied high, but not both.
Disconnect EA from pin P2.3 or the 5Volt supply.
If using P2.3 , set it high when the motor is running.


Vcc is 5 volts, by connecting to 12v you may have damaged the chip.
Worse, 12 volts may have fed back onto the main board and damaged it.

Supply the 12 volt power to the screw connections labelled + V -

Fri Mar 02 2018, 12:55 pm
#5
I don't know whether i damaged it or not. The board is behaving strangely though. Sometimes it works, sometimes it doesn't display anything on the Lcd with the same connections.
I have given both 5v and 12v both to vcc. I even tried giving 12v to the + V - pins. But whenever i try to give 12v to either vcc or - /+, the lcd brightens up a little more and the text that was appearing before disappears. Plus there is the problem with the Gnd connection. Doesn't matter what i do as soon as i connect the Gnd pin to the gnd of microcontroller, the board doesn't work. What should i do?
Sat Mar 03 2018, 01:57 am
#6
The first thing is to check the microcontroller.
Disconnect the motor driver board completely.
Does the microcontroller board (the main board) work normally ?
Sat Mar 03 2018, 05:29 am
#7
Yes it works fine enough. I have successfully managed to run the program without the motor driver module. When i give Gnd then on giving Vcc Lcd stops working and vice versa.
Sun Mar 04 2018, 03:43 am
#8
It sounds very much like the driver module is damaged.
Replace the L293 chip.
Do not connect Vcc to 12 volt.
Sun Mar 04 2018, 07:50 am
#9
😔 Guess you are right. Isn't there any other way in which i can run the motor?
Mon Mar 05 2018, 02:48 am
#10


😔 Guess you are right. Isn't there any other way in which i can run the motor?

kks


As this is an academic project, do you really need a motor ?
Can you use another way to indicate a door being unlocked.. say an LED ?

Getting a motor to go one way then the other is quite difficult.
You can use relays,but I assume you don't have any.
The L293 chip is the simplest way.

How much current does your motor draw ?


Get Social

Information

Powered by e107 Forum System

Downloads

Comments

carpinteyrowrl
Fri Apr 19 2024, 02:51 pm
DonaldJAX
Fri Apr 19 2024, 01:08 pm
Lewisuhakeply
Thu Apr 18 2024, 06:00 pm
Darrellciz
Thu Apr 18 2024, 11:07 am
Charlessber
Thu Apr 18 2024, 09:29 am
BartonSem
Thu Apr 18 2024, 04:56 am
DonaldKnown
Thu Apr 18 2024, 12:24 am
utaletxcyw
Wed Apr 17 2024, 10:21 am