Professional Documents
Culture Documents
Final Project Document
Final Project Document
at
Sathyabama Institute of Science and Technology
(DEEMED TO BE UNIVERSITY)
MARCH 2019
SATHYABAMA INSTITUTE OF SCIENCE
AND TECHNOLOGY
(DEEMED TO BE UNIVERSITY)
(Established under Section 3 of UGC Act, 1956)
Jeppiaar Nagar, Rajiv Gandhi Salai, Chennai - 600119
www.sathyabamauniversity.ac.in
_________________________________________________________________
SCHOOL OF COMPUTING
BONAFIDE CERTIFICATE
This is to certify that this Professional Training Report is the bonafide work
AMARA VENKATA SAI NYNESH (Reg.No.3511026) who underwent the
professional training in “” under our supervision from May 2018 to June 2018.
Internal Guide
Ms.ISHWARYA M V M.E.,(Ph.D)
DATE:
PLACE:CHENNAI SIGNATURE OF THE CANDIDATE
ACKNOWLEDGEMENT
I would like to express my sincere and deep sense of gratitude to my Project Guide for
her valuable guidance, suggestions and constant encouragement paved way for
the successful completion of my project work.
I wish to express my thanks to all Teaching and Non-teaching staff members of the
Department of Computer Science and Engineering who were helpful in many ways
for the completion of the project.
CHAPTER 1
INTRODUCTION
1.3 IR SENSOR
An infrared sensor is an electronic device, that emits in order to sense some
aspects of the surroundings. An IR sensor can measure the heat of an object as well as
detects the motion. These types of sensors measures only infrared radiation, rather
than emitting it that is called as a passive IR sensor. Usually in the infrared spectrum, all
the objects radiate some form of thermal radiations. These types of radiations
are invisible to our eyes, that can be detected by an infrared sensor. The emitter is
simply an IR LED (Light Emitting Diode) and the detector is simply an IR photodiode
which is sensitive to IR light of the same wavelength as that emitted by the IR LED.
When IR light falls on the photodiode, the resistances and these output voltages,
change in proportion to the magnitude of the IR light received.
1.7 GSM
GSM stands for Global System for Mobiles. This is a world-wide standard for
digital cellular telephony, or as most people know them Digital Mobile Telephones. GSM
was created by the Europeans, and originally meant "Group Special Mobile", but this
didn't translate well, so the now common more globally appealing name was adopted.
GSM is a published standard by ETSI, and has now enjoys widespread implementation
in Europe, Asia, and increasingly America.
The concept of cellular service is the use of low-power transmitters where
frequencies can be reused within a geographic area. The idea of cell-based mobile
radio service was formulated in the United States at Bell Labs in the early 1970s.
However, the Nordic countries were the first to introduce cellular services for
commercial use with the introduction of the Nordic Mobile Telephone (NMT) in 1981.
1.10 OBJECTIVES
The main objective of this project is to decrease the travel time of the emergency
vehicles to their destination without any issues and also we will find the theft vehicles in
this by the help of RFID tag. In the theft vehicles scenario we will get the location and
time when did the vehicle crossed that particular sensor.
In any hard situation like, it is difficult to clear the traffic through the above
process we will send a message to the emergency vehicle driver that the traffic is high
in this route
So go in another route. So by this the emergency vehicles won’t struck in the traffic they
can easily go to their destination without any delay.
CHAPTER 2
ALGORITHMS AND METHODS
2.1 GENERAL
Embedded C Programming is the soul of the processor functioning inside each
and every embedded system we come across in our daily life, such as mobile phone,
washing machine, and digital camera. Each processor is associated with an embedded
software. The first and foremost thing is the embedded software that decides
functioning of the embedded system. Embedded C language is most frequently used
to program the microcontroller. In many embedded applications were developed using
assembly level programming. However, they did not provide portability. This
disadvantage was overcome by the advent of various high level languages like C,
Pascal, and COBOL. However, it was the C language that got extensive acceptance for
embedded systems, and it continues to do so. The C code written is more reliable,
scalable, and portable; and in fact, much easier to understand.
The embedded system designers must know about the hardware architecture to
write programs. These programs play prominent role in monitoring and controlling
external devices. They also directly operate and use the internal architecture of the
microcontroller, such as interrupt handling, timers, serial communication and other
available features
C language was developed by Dennis Ritchie in 1969. It is a collection of one or
more functions, and every function is a collection of statements performing a specific
task.
C language is a middle-level language as it supports high-level applications and low-
level applications. Before going into the details of embedded C programming, we should
know about RAM memory organization.
Salient features of the language, C language is a software designed with different
keywords, data types, variables, constants, etc. Embedded C is a generic term given to
a programming language written in C, which is associated with a particular hardware
architecture. Embedded C is an extension to the C language with some additional
header files. These header files may change from controller to controller.
The microcontroller 8051 #include<reg51.h> is used.
2.2 OVERVIEW
The application is developed by using embedded C programing language and
Arduino as platform. Arduino is a platform in which embedded C language is used to
develop IOT applications.
In this we are having a website which will helps in the theft vehicle identification
and in this website we will have date, time also location of the vehicles where it is
identified. By this it is easy to catch theft vehicle faster. And in this project the main thing
is to control the traffic and allow the emergency vehicles faster to the location. Each and
every emergency vehicle will have different number and also normal vehicles will also
have different number which is different from each and everyone.
By this application we can reduce the wait time of the emergency vehicles and
also we can improve India traffic situation to be good. In this project we will use
embedded c language to make hardware work as our need.
2.3 SUMMARY
This project is about monitoring the traffic and managing the traffic through this
IOT application. And also we will find the theft vehicles using this IOT application. So
this is a Multipurpose application which is helpful for emergency vehicles and also at
same time for theft vehicles.
CHAPTER 3
SYSTEM IMPLEMENTATION
void initPWM(void);
int temp1,temp2=0,m_length;
unsigned int alc=0;
int distance,speed;
char TX_Buf[150];
char RX_Buf[45];
char control_data[16];
unsigned char B[10];
char Out[15];
char data_len= 0;
int TX_Len= 0;
char RX_Len= 0;
int TX_Max_Len= 0;
char carr= 0;
char k= 0;
char zz[50];
char TX_Enable;
char RX_Enable;
char Ok;
char Send_Enable;
char check,Serial_check;
char count=0;
char carr2;
char data_send;
char data_send1;
char message;
char web_error;
char GPRS_Enable;
char RX_Flag,Rdy,Vechile_Status;
char data_mode;
char data_mode1=0;
unsigned char medicine=0;
char Zigbee_RX_Flag;
volatile static unsigned char Zigbee_Data;
char RX_Buf_Zigbee[4];
/*************** gps***********************/
char Lat[13] = {"0000.0000"};
char Log[13] = {"00000.0000"};
char RX_Buf_GPS[200];
char Serial_RX_BUF[50];
int Serial_len=0;
char Temp_GPS[100];
char Buf[4];
unsigned char RX_Len_GPS=0;
unsigned char RMC_Enable=0;
char LCD_Buf[16];
unsigned char lamp0=0,lamp1=0,lamp2=0,lamp3=0;
static unsigned char v;
unsigned char gps_receiver(void);
void delay(void)
{
unsigned long wait;
for(wait=0;wait<=250000;wait++);
void Length_CAL2(void);
/***************************************************************************************/
void UART1(void) __irq
{
char aa=0;
aa= U1IIR;
if(U1LSR==0x61)
{
Close= U1RBR;
if(Close=='A')
{
lamp0=1;
lamp1=0;
}
if(Close=='B')
{
lamp1=1;
lamp0=0;
}
/* if(Close=='C')
{
lamp2=1;
}
if(Close=='D')
{
lamp3=1;
} */
if(aa&0x04)
{
lamp_load=Close;
RX_Flag=1;
}
if(Close=='~')
{
Rdy=1;
}
else if(Rdy&&(Close!='~'))
{
Vechile_Status=Close;
RX_Flag=1;
Rdy=0;
else if(Close==0x0D)
{
carr++;
}
else if(Close != 0x0D && Close != 0x0A && data_mode==0)
{
RX_Buf[RX_Len] = Close;
RX_Len=RX_Len+1;
if(message==1)
k++;
}
else if( Close==0x0D)
{
carr++;
Serial_RX_BUF[Serial_len]=0;
if(Close)
{
Serial_check = 1;
Serial_RX_BUF[Serial_len]=Close;
// Serial_len++;
Serial_len=Serial_len+1;
Serial_RX_BUF[Serial_len]=0;
}
}
else if(U1LSR==0x20 )
{
}
VICVectAddr = 0x00000000;
int test_len=0;
void UART0_ISR_GPS(void)__irq
{
aa=U0IIR;
GPS_Data= U0RBR;
if(U0LSR==0x60)
{
test_len++;
if(test_len<12)
{
RX_Buf_GPS[RX_Len_GPS] = GPS_Data;
RX_Len_GPS++;
}
else if(test_len==12)
{
Msg_End = 1;
RX_Buf_GPS[RX_Len_GPS]='\0';
RX_Len_GPS=0;
test_len=0;
}
else if(GPS_Data==0x0D)
{
Msg_End = 1;
RX_Buf_GPS[RX_Len_GPS]='\0';
RX_Len_GPS=0;
} */
}
VICVectAddr = 0x00000000;
}
/*else if(U0LSR==0x20 )
{
VICVectAddr = 0x00000000;
} */
/***************************************************************************************/
void delay_s(unsigned int val){
T0MR3 = val*29498500;
T0EMR &= 0xFFFFFFF7;
T0TC = 0x00000000;
T0TCR =1;
while((T0EMR & 0x00000008)==0);
/***************************************************************************************/
void UART0_Init(void)
{
PINSEL0= 5;
VPBDIV = 2;
U0FCR = 0x07;
U0LCR = 0x83;
U0DLL = 0xc3;
U0DLM = 0x00;
U0LCR = 0x03;
U0IER = 0x03; // tX intr enable
VICIntSelect = 0x00000000;
VICIntEnable = 0x00000040;
VICVectCntl3 = 0x00000020|6;
VICVectAddr3 = (unsigned int) UART0_ISR_GPS;
}
void UART1_Init(void)
{
U1FCR = 0x07;
U1LCR = 0x83;
U1DLL = 0xc3;
U1DLM = 0x00;
U1LCR = 0x03;
U1IER = 0x03; // tX intr enable
PINSEL0|= 0x50000;
VICIntSelect = 0x00000000;
VICIntEnable = 0x00000080;
VICVectCntl2 = 0x00000020|7;
VICVectAddr2 = (unsigned int)UART1;
}
TX_Enable = 1;
TX_Len = 1;
TX_Max_Len=strlen(TX_Buf);
U0THR = TX_Buf[0];
while(TX_Enable);
}
/***************************************************************************************/
void Lcd_Cmd(int a)
{
int b,c;
b = a>>4;
IO1CLR =(1<<16);
IO1SET =(1<<17);
IO1CLR = clear;
IO1SET = (b<<18);
delay3(10);
IO1CLR =(1<<17);
delay3(10);
c = a&0x0f;
IO1CLR =(1<<16);
IO1SET =(1<<17);
IO1CLR = clear;
IO1SET = (c<<18);
delay3(10);
IO1CLR =(1<<17);
delay3(10);
/*******************************************************************************************/
void lcd_data(unsigned char a)
{
int b,c;
b = a>>4;
IO1SET =(1<<16);
IO1SET =(1<<17);
IO1CLR = clear;
IO1SET = (b<<18);
delay3(10);
IO1CLR =(1<<17);
delay3(10);
c = a&0x0f;
IO1SET =(1<<16);
IO1SET =(1<<17);
IO1CLR = clear;
IO1SET = (c<<18);
delay3(10);
IO1CLR =(1<<17);
delay3(10);
}
/***************************************************************************************/
while(*dat)
{
lcd_data(*dat);
dat++;
}
}
/***************************************************************************************/
void delay3(unsigned int delay3)
{
unsigned int i,j;
for(i=0;i<delay3;i++)
{
for(j=0;j<10000;j++)
{}
}
}
/*******************************************************************************************/
void Start_TX(void)
{
TX_Enable = 1;
TX_Len = 1;
TX_Max_Len=strlen(TX_Buf);
U1THR = TX_Buf[0];
while(TX_Enable);
}
/*******************************************************************************************/
void init_delay(void)
{
T0MR3 = val*29498;
T0EMR &= 0xFFFFFFF7;
T0TC = 0x00000000;
T0TCR =1;
while((T0EMR & 0x00000008)==0);
}
//************************************/
//* Delay Function [Seconds] */
//************************************/
void Delay(void)
{
unsigned int count=65535;
while(count--);
count=65535;
while(count--);
count=65535;
while(count--);
count=65535;
while(count--);
}
/***********************************************************************************************/
void EXTINTVectoredIRQ (void) __irq
{
temp2=temp2+1;;
} /*****************************************************************************************/
void Init_EINT1(void)
{
PINSEL0 |= (1<<31)|(0<<30); //Enable the EXTINT1 interrupt
EXTMODE = 0X04;
EXTPOLAR = 0X04;
}
/*******************************************************************************************/
void dela(unsigned int num)
{
unsigned int i,j;
for(i=0;i<num;i++)
for(j=0;j<65534;j++);
}
/*******************************************************************************************/
void Modem_Config(void)
{
CLEARSCREEN;
Uart1PutS("AT\r"); // this code is to show the data from gprs shield, in order to easily
see the process of how the gprs shield submit a http request, and the following is for
this purpose too.
_DelayMs(100);
Uart1PutS("\n\r");
Uart1PutS("ATE0\r"); // this code is to show the data from gprs shield, in order to
easily see the process of how the gprs shield submit a http request, and the following is
for this purpose too.
_DelayMs(100);
Uart1PutS("\n\r");
Uart1PutS("AT+COPS?\r"); // this code is to show the data from gprs shield, in order
to easily see the process of how the gprs shield submit a http request, and the following
is for this purpose too.
_DelayMs(100);
Uart1PutS("\n\r");
Uart1PutS("AT+CSQ\r"); // this code is to show the data from gprs shield, in order to
easily see the process of how the gprs shield submit a http request, and the following is
for this purpose too.
_DelayMs(100);
Uart1PutS("\n\r");
Uart1PutS("AT+CGATT?\r");
_DelayMs(100);
Uart1PutS("\n\r");
Uart1PutS("AT+SAPBR=3,1,\"CONTYPE\",\"GPRS\"\r");
_DelayMs(100);
Uart1PutS("\n\r");
Uart1PutS("AT+SAPBR=3,1,\"APN\",\"CMNET\"\r");
_DelayMs(100);
Uart1PutS("\n\r");
Uart1PutS("AT+SAPBR=1,1\r");
_DelayMs(100);
Uart1PutS("\n\r");
Uart1PutS("AT+DDET=1,1000,0,0\r");
_DelayMs(100);
Uart1PutS("\n\r");
}
CLEARSCREEN;
Lcd_Cmd(0x01);
Lcd_Cmd(0x80);
LCD("Accessing web url");
delay3 (500);
sprintf(TX_Buf,"AT+HTTPPARA=\"URL\",\"http://iotclouds.in/swmanageeaswari/
upload.php?bstatus=%s&bnumber=%s&area=%s&city=%s\"\r",status,number,area,city);
Uart1PutS(TX_Buf);
delay_ms(200);
Uart1PutS("\n\r");
delay_ms(200);
CLEARSCREEN;
action();
CLEARSCREEN;
Read_data();
CLEARSCREEN;
// modem_terminate();
void action(void)
{
Uart1PutS("AT+HTTPACTION=0\r");
_DelayMs(1000);
// Uart1PutS("\n\r");
Uart1PutS("\n\r");
void Read_data(void)
{
Uart1PutS("AT+HTTPREAD\r");
Uart1PutS("\n\r");
}
//void modem_terminate(void)
//{
// CLEARSCREEN;
// Lcd_Cmd(0x01);
// Lcd_Cmd(0x80);
// LCD("terminate");
// _DelayMs(100);
// Uart1PutS("AT+HTTPTERM\r");
//
// Uart1PutS("\n\r");
//
//}
void HTTP_INIT(void)
{
Uart1PutS("AT+HTTPINIT\r");
Uart1PutS("\n\r");
}
/*************************************************************************************/
int main(void)
{
char BUF[10];
int value;
int i=0,j=0;
int a,b=0,c,d,e=0,ts,as,t;
int x,x1;
char a1[16];
IO0DIR &= ~(1<<5);
init_delay();
Lcd_Init();
UART0_Init();
UART1_Init();
ADC_Init();
CSB_init();
delay_ms(50);
Init_EINT1();
Modem_Config();
Lcd_Cmd(0x01);
Lcd_Cmd(0x80);
LCD(" Garbage ");
Lcd_Cmd(0xC0);
LCD(" Management ");
delay3(1000);
CLEARSCREEN;
while(1)
{
delay_ms(100);
CSB_START1();
Length_CAL1();
value=m_length;
if(m_length>100)
value=100;
sprintf(BUF,"Distance=%d",value);
Lcd_Cmd(0x80);
LCD(BUF);
delay_ms(100);
// if(m_length==0)
// {
// CLEARSCREEN;
// }
if(m_length>100)
{
CLEARSCREEN;
sprintf(BUF,"Distance=%d",100);
LCD(BUF);
Lcd_Cmd(0xc0);
LCD("Bin is Empty");
delay_ms(300);
CLEARSCREEN ;
a++;
if(a==1)
{
LCD("Updated to Server");
delay_ms(300);
CLEARSCREEN ;
LCD("Accessing web url");
delay_ms(300);
sentto_webpage("Bin_is_Empty","7","Ashok_Nagar","Chennai");
}
CLEARSCREEN;
}
else if(value<=100 && value>=81)
{
Lcd_Cmd(0x01);
sprintf(BUF,"Distance=%d",value);
Lcd_Cmd(0x80);
LCD (BUF);
_DelayMs(500);
t++;
if(t==1)
{
LCD("Updated to Server");
delay_ms(300);
CLEARSCREEN ;
LCD("Accessing web url");
delay_ms(300);
sentto_webpage("Bin_is_Empty","7","Ashok_Nagar","Chennai");
}
CLEARSCREEN;
}
else if(value>=1 && value<=20)
{
b++;
CLEARSCREEN ;
Lcd_Cmd(0xc0);
LCD("Dust Bin Filled");
delay_ms(300);
Lcd_Cmd(0x01);
if(b==1)
{
Lcd_Cmd(0x80);
LCD("Update to Server");
delay_ms(300);
sentto_webpage("Dust_Bin_Filled","7","Ashok_Nagar","Chennai");
Lcd_Cmd(0x01);
Lcd_Cmd(0x80);
LCD("Call To Emp1");
delay_ms(300);
Gsmdial();
Serial_len=0;
for(i=0;i<30;i++)
{
Lcd_Cmd(0x01);
Lcd_Cmd(0x80);
LCD("Calling1...");
delay_ms(100);
Lcd_Cmd(0x01);
if(Serial_RX_BUF[9]=='1'||(strcmp(Serial_RX_BUF,"NO CARRIER")==0))
{
Uart1PutS("ATH\r\n");
delay_ms(50);
GsmSendMsg("Bin No:7");
Lcd_Cmd(0x80);
LCD(" Employee 1");
Lcd_Cmd(0xc0);
LCD("Answered 'YES'");
delay_ms(300);
// Serial_RX_BUF[9]='\0';
ts=1;
break;
}
else if(Serial_RX_BUF[9]=='2'|| (strcmp(Serial_RX_BUF,"NO
CARRIER")==0))
{
Uart1PutS("ATH\r\n");
delay_ms(50);
Lcd_Cmd(0x80);
LCD(" Employee 1");
Lcd_Cmd(0xc0);
LCD("Answered 'NO'");
delay_ms(300);
Lcd_Cmd(0x01);
Lcd_Cmd(0x80);
LCD("Call To Next Emp");
delay_ms(300);
Gsmdial1();
delay_ms(50);
// Serial_RX_BUF[9]='\0';
Serial_len=0;
for(j=0;j<30;j++)
{
LCD("Calling2...");
delay_ms(100);
Lcd_Cmd(0x01);
if(Serial_check==1)
{
Serial_check=0;
if(Serial_RX_BUF[9]=='1')
{
Lcd_Cmd(0x01);
Uart1PutS("ATH\r\n");
delay_ms(50);
GsmSendMsg1("Bin No:7");
LCD(" Employee 2");
Lcd_Cmd(0xc0);
LCD("Answered 'YES'");
delay_ms(300);
i=50;as=1;
break;
}
}
}
// Serial_RX_BUF[9]='\0';
Serial_RX_BUF[0]=='\0';
Lcd_Cmd(0x01);
LCD(Serial_RX_BUF);
delay_ms(300);
Serial_RX_BUF[9]='\0';
delay_ms(300);
CLEARSCREEN ;
}
}
else if(value>=21&&value<=50)
{
CLEARSCREEN;
Lcd_Cmd(0x80);
LCD("Below 80% Filled");
delay_ms(300);
CLEARSCREEN ;
d++;
if(d==1)
{
LCD("Updated to Server");
delay_ms(300);
CLEARSCREEN ;
LCD("Accessing web url");
delay_ms(300);
// Modem_Config();
sentto_webpage("Below_80%_Filled","7","Ashok_Nagar","Chennai");
}
}
else if(value>50&&value<=80)
{
CLEARSCREEN ;
Lcd_Cmd(0x80);
LCD("Below 50% Filled");
delay_ms(300);
CLEARSCREEN ;
e++;
if(e==1)
{
LCD("Updated to Server");
delay_ms(300);
CLEARSCREEN ;
LCD("Accessing web url");
delay_ms(300);
// Modem_Config();
sentto_webpage("Below_50%_Filled","7","Ashok_Nagar","Chennai");
e++;
}
CLEARSCREEN ;
}
if (Msg_End ==1)
{
Msg_End=0;
// Lcd_Cmd(0x01);
delay3(1000);
LCD( RX_Buf_GPS);
if((strcmp(RX_Buf_GPS,"21008B1B902")==0)&&ts==1)
{
Lcd_Cmd(0x01);
Lcd_Cmd(0x80);
LCD("Employee 1 ");
delay_ms(300);
for(i=0;i<10;i++)
{
Lcd_Cmd(0x01);
Lcd_Cmd(0x80);
LCD("Cleaning...");
delay_ms(20);
}
Lcd_Cmd(0x80);
LCD("Bin Cleaned ");
delay_ms(300);
sentto_webpage("Cleaned_by_Employee_1","7","Ashok_Nagar","Chennai");
a=0,b=0,c=0,d=0,e=0,ts=0,t=0;
CSB_START1();
Length_CAL1();
value=m_length;
if(m_length>100)
value=100;
sprintf(BUF,"Distance=%d",value);
Lcd_Cmd(0x80);
LCD(BUF);
}
else if((strcmp(RX_Buf_GPS,"210088FCE5B")==0)&&as==1)
{
Lcd_Cmd(0x01);
Lcd_Cmd(0x80);
LCD("Employee 2 ");
delay_ms(300);
for(i=0;i<10;i++)
{
Lcd_Cmd(0x01);
Lcd_Cmd(0x80);
LCD("Cleaning...");
delay_ms(20);
}
Lcd_Cmd(0x80);
LCD("Bin Cleaned");
delay_ms(300);
sentto_webpage("Cleaned_by_Employee_2","7","Ashok_Nagar","Chennai");
a=0,b=0,c=0,d=0,e=0,as=0,t=0;
CSB_START1();
Length_CAL1();
value=m_length;
if(m_length>100)
value=100;
sprintf(BUF,"Distance=%d",value);
Lcd_Cmd(0x80);
LCD(BUF);
}
}
}
}
/*******************************************************************************************/
void Uart1PutCh (unsigned char ch) // Write character to Serial Port
{
U1THR = ch;
while (!(U1LSR & 0x20));
}
//******************************************************************************
void ADC_Init(void)
{
PINSEL0 |= ((1<<8)|(1<<9)|(1<<10)|(1<<11)); //AD0.6+AD0.7
PINSEL1 |= ((0<<25)|(1<<24)|(0<<27)|(1<<26)); //AD0.1+AD0.2
VPBDIV = 2;
}
/*************************************************************************************/
void initPWM(void)
{
PINSEL0 |= (1<<15)|(0<<14);
PWMPCR = 0x0;
PWMPR = PWMPRESCALE-1;
PWMMR0 = 10000;
PWMMR2 = 1000;
PWMMCR = (1<<1);
PWMLER = (1<<2) | (1<<0);
PWMPCR = (1<<10);
PWMTCR = (1<<7) ;
Lcd_Cmd(0x01);
_DelayMs(500);
LCD("Done");
// For getting sms length during sms read
Uart1PutS("AT+CSDH=1\r");
_DelayMs(500);
Uart1PutS("AT+CMGS=");
Uart1PutCh('"');
Uart1PutS("8056156998");
Uart1PutCh('"');
Uart1PutCh('\r');
_DelayMs(1000);
Uart1PutS(msgStr);
_DelayMs(1000); // timepass
Uart1PutCh(0x1A);
_DelayMs(1000); // timepass
// return (1);
}
}
unsigned char Gsmdial(void)
{
Uart1PutS("\r");
delay_ms(100);
Uart1PutS("AT\r\n");
delay_ms(100);
LCD("ok");
Uart1PutS("ATE0\r\n");
delay_ms(500);
LCD("ok");
Uart1PutS("ATD 8056156998;\r\n");
delay_ms(100);
return (1);
}
/***************************************************************************************/
void Length_CAL1(void)
{
m_length=((temp1)*700)*0.0003;
m_length=m_length*0.04;
m_length=m_length*0.5;
}
void Length_CAL2(void)
{
m_length=((temp2)*700)*0.0003;
m_length=m_length*0.04;
m_length=m_length*0.5;
}
/*******************************************************************************************/
temp1=T0CR0;
T0CR0=0;
VICVectAddr = 0x00;
}
void ENTinit(void)
{
PINSEL1 |=0X30000003;
PINSEL0 |=0X00001000;
VICIntSelect = 0x00000000;
VICVectCntl0 = 0x20 | 4;
VICVectAddr0 = (long)Timer1_CapInt;
VICIntEnable = 1 << 4;
}
void Time1init(void)
{
T0PR = 9;
T0CCR = (1 << 1)|(1 << 2);
}
void TimeDelay()
{
int i;
for(i=100;i>0;i--) ; ///25KHZ
}
void CSB_init(void)
{
Time1init();
IO0DIR |=1<<21;
ENTinit();
void CSB_PWM_OUT1()
{
IO0SET |=1<<21;
TimeDelay();
IO0CLR |=1<<21;
TimeDelay();
IO0SET |=1<<21;
TimeDelay();
IO0CLR |=1<<21;
TimeDelay();
IO0SET |=1<<21;
TimeDelay();
IO0CLR |=1<<21;
TimeDelay();
IO0SET |=1<<21;
TimeDelay();
IO0CLR |=1<<21;
TimeDelay();
}
void CSB_START1(void)
{
T0TC=0;
CSB_PWM_OUT1();
VICIntEnable = 1 << 4;
T0TCR = 0x2;
T0TCR=0x01;
}
void delay11(unsigned int delay)
{
unsigned int i,j;
for(i=0;i<delay;i++)
{
for(j=0;j<65535;j++)
{}
}
}
/*ultrasonic1---->trig p0.21
echo---> p0.30
*/
/************************************************************************************
CHAPTER 4
CONCLUSION AND FUTURE WORK
4.1 CONCLUSION
This survey has been performed for collecting the details of Smart Waste Collection
System based on IoT and to find out effective methods which are useful for providing
hygiene environment in cities. As the level of garbage in the bins crossed the threshold,
it will be informed to the corresponding authority, if it was found ignored then the details
will be forwarded to the higher authority to take necessary actions. Thus a hygiene and
clean environment can be provided. This survey helps in identifying all possible smart
waste collection methods that can be implemented to make city clean.
This proposed system assures the collection of garbage soon when the garbage level
reaches its maximum level. The system will thus provide accurate reports, increasing
the efficiency of the system. The real-time monitoring of the garbage level with the help
of sensors and wireless communication will reduce the total number of trips required of
GCV and thus, will reduce the total expenditure associated with the garbage collection.
Thus, the dustbins will be cleared as and when filled, giving way to cleaner city, better
infrastructure and increased hygiene.