Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Parking guiding system

Status
Not open for further replies.

laxmid

New Member
As i am doing project on this

RFID, PIC-16f877, 3 sensor for parking


const unsigned char card1[] = "1D00E4018971";
const unsigned char card2[] = "1A003E2C5850";
const unsigned char card3[] = "1A003E772A79";

void read_card_value_from_uart() // Rxing card_value from rfid
{
for(k=0; k<=13; k++)
{
read_card_value[k-1]=getch();
}

}


rxed card_value from rfid should be compared with card1,card2 , card3

if any one card matches with rxed value it should display the corresponding card user on lcd otherwise it should display as unautherisd user.
for this i wrote function as

void compare_cards()
{
if((strcmp(card1,read_card_value))==0)
{
lcd_clear();
lcd_goto(0);
lcd_puts("card1 user");
}
else if((strcmp(card2,read_card_value))==0)
{
lcd_clear();
lcd_goto(0);
lcd_puts("card2 user");

}
else if((strcmp(card3,read_card_value))==0)
{
lcd_clear();
lcd_goto(0);
lcd_puts("card3 user");

}
else
{
lcd_clear();
lcd_goto(0);
lcd_puts("Un-Autherised user");

}

}


for im getting o/p as "unautherised user".

plz check the function let me know.

Thanks
 

Gayan Soyza

Active Member
That means your "read_card_value" doesn't read the card values properly.You can verify is your "read_card_value" gives the proper unique code by sending the "read_card_value" directly to the LCD without comparing.
 

BeeBop

Active Member
As i am doing project on this

RFID, PIC-16f877, 3 sensor for parking


const unsigned char card1[] = "1D00E4018971";
const unsigned char card2[] = "1A003E2C5850";
const unsigned char card3[] = "1A003E772A79";

void read_card_value_from_uart() // Rxing card_value from rfid
{
for(k=0; k<=13; k++)
{
read_card_value[k-1]=getch();
}

}

...

read_card_value[k-1]=getch();
Why are you doing this? On the first time through the loop you then have:
read_card_value[-1]=getch();
Just use:
Code:
void read_card_value_from_uart() { // Rxing card_value from rfid 

	for(k=0; k<=13; k++) {
		read_card_value[k]=getch();
	}
 
}
 

AtomSoft

Well-Known Member
heh also your arrays are wrong:

Code:
const unsigned char card1[] = "1D00E4018971";
const unsigned char card2[] = "1A003E2C5850";
const unsigned char card3[] = "1A003E772A79";

Are supposed to be 13 byte arrays i assume...You are supposed to have 13 bytes in it now 13 characters like this would be it more or less but your missing bytes then:

Code:
const unsigned char card1[] = {0x1D,0x00,0xE4,0x01,0x89,0x71};
const unsigned char card2[] = {0x1A,0x00,0x3E,0x2C,0x58,0x50};
const unsigned char card3[] = {0x1A,0x00,0x3E,0x77,0x2A,0x79};

As you can see there is infact only 6 bytes in this... If the string is exact and contains those 13 characters you might mean this then:

Code:
const unsigned char card1[] = {0x01,0x0D,0x00,0x00,0x0E,0x04,0x00,0x01,0x08,0x09,0x07,0x01};
const unsigned char card2[] = {0x01,0x0A,0x00,0x00,0x03,0x0E,0x02,0x0C,0x05,0x08,0x05,0x00};
const unsigned char card3[] = {0x01,0x0A,0x00,0x00,0x03,0x0E,0x07,0x07,0x02,0x0A,0x07,0x09};
 
Last edited:

laxmid

New Member
Thanx to all for ur kind reply.

Actually "read_card_value" doesn't read the card values properly. Thats the i was getting 1st value its taking dummy then after 12 numbers its taking again 2 dummy variable. for that reason i was getting problem.
i have completed this project.

Thanks to all.
 

laxmid

New Member
If you know please tell me how to interface keyboard to pic16f877a?
n how it works?
as i am using 6-pin ps/2 connector. Please help me out as arly as posible.
Thanks in advance.
 

AtomSoft

Well-Known Member
PS/2 isnt hard nor easy heh. I have code somewhere on the forum for it.I need to redo a new one tho. Just to clean it up since i feel smarter now maybe i can make it better heh
 
Status
Not open for further replies.

Latest threads

Top