Electroni Toll Collection project:

12 replies [Last post]
eshaali
Offline
Last seen: 10 years 8 weeks ago
Joined: 2009-11-23
bOt Points: 78

hello,can anyone tell which one is better for identification of car,barcode or number plate scanning usin ocr and why?i want that the barcode/ocr read the tag(placed on car at specific location) and send this code to 8051.will b very thankful.

shashwat
Offline
Last seen: 1 year 25 weeks ago
Joined: 2009-02-18
bOt Points: 1160
Hello eshaali, I guess

Hello eshaali,

I guess implementing barcode technique will be easier as compared to number plate scanning using OCR (Optical Character Recognition) but the drawback is that in barcode technique there should be some tag which should be present on each vehicle while there is no so such thing involved in OCR. So number plate scanning is a better technique but it will be difficult to implement.

Check out these projects -

1. Barcode Scanner

2. Wand based Barcode Scanner

3. Optical Scanner

  

Founder and Admin

eshaali
Offline
Last seen: 10 years 8 weeks ago
Joined: 2009-11-23
bOt Points: 78
Thanx

Thanx Shashwat,

               yes if i use barcode i will place a tag(containing all info about car)on the car,and i have decided to use barcodes but problem is that i have no idea how to use barcodes.

can anyone provide or give some help regarding program to interface barcode to 8051

shashwat
Offline
Last seen: 1 year 25 weeks ago
Joined: 2009-02-18
bOt Points: 1160
Check out the project links

Check out the project links below. 

 

1. Barcode Scanner

2. Wand based Barcode Scanner

 

Founder and Admin

eshaali
Offline
Last seen: 10 years 8 weeks ago
Joined: 2009-11-23
bOt Points: 78
Thanx Shashwat,       

Thanx Shashwat,

       Talking about interfacing of lcd+keyboard to 8051,i want to enter some code from keybord and display information stored related to code for example if i enter ABC from keyboard ,lcd display a message "WELCOME  HERE".........i am having problems in it,please provide me code.

shashwat
Offline
Last seen: 1 year 25 weeks ago
Joined: 2009-02-18
bOt Points: 1160
Check out this tutorial -

Founder and Admin

eshaali
Offline
Last seen: 10 years 8 weeks ago
Joined: 2009-11-23
bOt Points: 78
i have this programe but i

i have this programe but i want this code in C

shashwat
Offline
Last seen: 1 year 25 weeks ago
Joined: 2009-02-18
bOt Points: 1160
For LCD

For LCD -

#include<stdio.h>

#include<reg51.h>



sbit rs=P3^6;

sbit en=P3^7;


void cmdwrt();

void delay();

void datawrt();


unsigned char dis[7]={0x30,0x38,0x01,0x06,0x0f,0x80};

unsigned char a;

main()

{

int i;

for( i=0;i<7;i++)

{

a=dis[i];

cmdwrt();

delay();

}

a='A';

datawrt();

delay();

while(1);

}


void cmdwrt()

{

rs=0;

P0=a;

en=1;

delay();

en=0;

}

void datawrt()

{

rs=1;

P0=a;.

en=1;

delay();

en=0;


}


void delay()

{

int i;

for(i=0;i<1000;i++);


}

 

For Keypad -

 

#include<reg51.h>

#include<intrins.h>


sbit rs=P0^0;

sbit en=P0^1;


void cmdwrt();

void delay(); 

void datawrt();

void mdata();


unsigned char dis[8]={0x20,0x20,0x28,0x0f,0x01,0x06,0x80};

unsigned char a;


main()

{

int i;

for( i=0;i<8;i++)

{

a=dis[i];

cmdwrt();

delay(); delay();

}

while(1)

{

P1=0x78;

a=P1;

if(a == 0x70)

{

a='0';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0x74;

a=P1;

if(a == 0x70)

{

a='1';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0x72;

a=P1;

if(a == 0x70)

{

a='2';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0x71;

a=P1;

if(a == 0x70)

{

a='3';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0xb8;

a=P1;

if(a == 0xb0)

{

a='4';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0xb4;

a=P1;

if(a == 0xb0)

{

a='5';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0xb2;

a=P1;

if(a == 0xb0)

{

a='6';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0xb1;

a=P1;

if(a == 0xb0)

{

a='7';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0xd8;

a=P1;

if(a == 0xd0)

{

a='8';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0xd4;

a=P1;

if(a == 0xd0)

{

a='9';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0xd2;

a=P1;

if(a == 0xd0)

{

a='A';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0xd1;

a=P1;

if(a == 0xd0)

{

a='B';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0xe8;

a=P1;

if(a == 0xe0)

{

a='C';

delay(); delay();

datawrt();

delay(); delay();

}


P1=0xe4;

a=P1;

if(a == 0xe0)

{

a='D';

delay(); delay();

datawrt();

delay(); delay();

}



P1=0xe2;

a=P1;

if(a == 0xe0)

{

a='E';

delay(); delay();

datawrt();

delay(); delay();

}



P1=0xe1;

a=P1;

if(a == 0xe0)

{

a='F';

delay(); delay();

datawrt();

delay(); delay();

}


}

}


void cmdwrt()

{

unsigned char s=0;

s=a;

a=a & 0xf0;

a=a>>2;

rs=0;

//mdata();

//delay(); delay();

P0=a;

rs=0;

en=1;

en=0;

a=s;

a=(a<<4);

a=a & 0xf0;

a=a>>2;

rs=0;

//mdata();

P0=a;

rs=0;

en=1;

en=0;

delay(); delay();

}


void datawrt()

{

unsigned char s=0;

s=a;

a=a & 0xf0;

a=a>>2;

rs=1;

//mdata();

//delay(); delay();

P0=a;

rs=1;

en=1;

en=0;

a=s;

a=a<<4;

a=a & 0xf0;

a=a>>2;

rs=1;

//mdata();

P0=a;

rs=1;

en=1;

en=0;

delay(); delay();

}






void delay()

{

int i;

for(i=0;i<9000;i++);

}

 

Founder and Admin

eshaali
Offline
Last seen: 10 years 8 weeks ago
Joined: 2009-11-23
bOt Points: 78
Thanx shashwat,,let me try

Thanx shashwat,,let me try this,,what type of file is this <intrins.h>?

shashwat
Offline
Last seen: 1 year 25 weeks ago
Joined: 2009-02-18
bOt Points: 1160
The intrins.h include file
The intrins.h include file contains prototypes for routines that instruct the compiler to generate intrinsic code.
 
_chkfloat_
_crol_
_cror_
_irol_
_iror_
_nop_
_pop_
_push_

_testbit_ 

Check out these links - 

http://www.netrino.com/Embedded-Systems/How-To/Optimal-C-Code-8051

Esacademy automation

Founder and Admin

eshaali
Offline
Last seen: 10 years 8 weeks ago
Joined: 2009-11-23
bOt Points: 78
Hello Shashwat,         i

Hello Shashwat,

        i have tried this code in keil,by runnig lcd code there was no error but lcd was not displaying any thing in proteus......when i compiled the code of keyboard it produced such errors that i can't understand i.e

 

 

*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS

    SYMBOL:  DELAY

    MODULE:  keys.obj (KEYS)

*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS

    SYMBOL:  DATAWRT

    MODULE:  keys.obj (KEYS)

 

 

and many more

 please help me in removing these errors and running the code.Thanx

 

eshaali
Offline
Last seen: 10 years 8 weeks ago
Joined: 2009-11-23
bOt Points: 78
There is another confusion,in

There is another confusion,in 2nd code which is for keyboard,keyboard is connected to which port?is port 1 is connected to pin D0-D7 of lcd?

you have used if(a == 0x70) many times,is it right?

shashwat
Offline
Last seen: 1 year 25 weeks ago
Joined: 2009-02-18
bOt Points: 1160
Hello eshaali, Check out this

Hello eshaali,

Check out the example 4 and example 5 in the pdf below. Circuit diagram has also been provided.

Writing C Code for 89C51

Founder and Admin