I successfully manged to run my project on Proteus, but now when trying to run it actually in real world, the LCD remains blank and nothing appears. I am posting the code and images of my connection, please check it and help me out. Also 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 in the image its difficult to understand the connections) here is the pins which i have connected to the 8051 programming board (i followed the proteus simulation circuit diagram which i am posting)
LCD pins :
VSS - 5V
VDD, V0, RW - GND
RS - P3.7
E - P3.5
D0-D7 - P1.0-P1.7
A - 5V
K - GND
RFID MODULE :
GN - GND
TX - 3.0
L293D MOTOR DRIVER IC :
A1 - P2.4
A2 - P2.5
EA - 5V
VCC - 12V
GND - GND
Mod edit: added C qualifier to code tags.
LCD pins :
VSS - 5V
VDD, V0, RW - GND
RS - P3.7
E - P3.5
D0-D7 - P1.0-P1.7
A - 5V
K - GND
RFID MODULE :
GN - GND
TX - 3.0
L293D MOTOR DRIVER IC :
A1 - P2.4
A2 - P2.5
EA - 5V
VCC - 12V
GND - GND
C:
#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);
}
}
}
Last edited by a moderator: