Skip to main content

Theft preventer alarm project coding

#include <REGX51.H>
#include "lcd.c"

#define MAX_DELAY() delay(65000)

sbit IR_Sense=P3^1;
sbit Buz=P1^0;
sbit Load=P0^1;

void intro()
{
 lcd_init();lcd_clr();
 lcd_str("Theft Preventer ",0x80);
 lcd_str(" Security Alarm ",0xc0);
 MAX_DELAY();MAX_DELAY();
 lcd_clr();
 }

 void main()
 {
unsigned int i = 0, j= 0;
Buz = 1; Load = 0;
intro();
   while(1)
   {
if(IR_Sense == 1)
{
lcd_clr();
lcd_str("No Intruder Detet",0x80);
lcd_str("Home is Safe now ",0xc0);
delay(1000);
Buz = 1; Load = 0;
while(IR_Sense == 1);
}
else
{
lcd_clr();
lcd_str(" Intruder Deteted",0x80);
lcd_str("Home at Risk now ",0xc0);
delay(1000);
Buz = 0; Load = 1;
while(1);
}


   }
 }


LCD CODING:


#define AT89C51
#undef PIC16F877A

#ifdef AT89C51
#undef PIC16F877A

sbit rs=P0^5;
sbit rw=P0^6;
sbit en=P0^7;

#define DATA P2

#else

#define rs RB1
#define rw RB2
#define en RB4
#define DATA PORTD

#endif

#define DELAY() delay(20)

void delay(unsigned int i)
{
while(i--);
}
void lcd_cmd(unsigned char c)
{
rs=0;
DATA=c;
en=1;
DELAY();
en=0;
}

void lcd_data(unsigned char d)
{
delay(500);
rs=1;
DATA=d;
en=1;
DELAY();
en=0;
}

void lcd_clr()
{
 lcd_cmd(0x01);
 delay(100);
 lcd_cmd(0x80);
}

void lcd_init()
{
  #ifdef PIC16F877A
    TRISB1=TRISB2=TRISB4=0;
    TRISD=0;
  #endif
    rw=0;
    lcd_cmd(0x38);
    lcd_cmd(0x0c);
lcd_clr();
}

void lcd_str(const unsigned char *str, const unsigned char pos)
{
 if(pos != 0xff) /*to follow previous written position*/
  lcd_cmd(pos);
 while(*str)
  lcd_data(*str++);
 
}

Comments

Popular posts from this blog

PUNCHING MACHINE

ACCIDENT AVOIDING SYSTEM FOR PUNCHING MACHINE SYNOPSIS The aim of our project is to take a system-wide approach to preventing the machine accident. The system includes not just the machine and the operator; but rather, it includes everything from the initial design of the machine to the training of everyone that is responsible for any aspect of it, to the documentation of all changes, to regular safety audits and a finally a corporate culture of safety-first. Design is the part of a machine's life where the greatest impact can be made in relation to avoiding accidents. The designer should ensure that the machine is safe to set up and operate, safe to install, safe to maintain, safe to repair, and safe to decommission. Although safe operation is usually at the forefront of a designer's mind, safe maintenance and repair should also be a high priority. Around 50% of fatal accidents involving industrial equipment are associated with maintenance activities, and design...

Inverted Linear Quadtree: Efficient Top K Spatial Keyword Search

Inverted Linear Quadtree: Efficient Top K Spatial Keyword Search ABSTRACT: In this paper, With advances in geo-positioning technologies and geo-location services, there are a rapidly growing amount of spatiotextual objects collected in many applications such as location based services and social networks, in which an object is described by its spatial location and a set of keywords (terms). Consequently, the study of spatial keyword search which explores both location and textual description of the objects has attracted great attention from the commercial organizations and research communities. In the paper, we study two fundamental problems in the spatial keyword queries: top k spatial keyword search (TOPK-SK), and batch top k spatial keyword search (BTOPK-SK). Given a set of spatio-textual objects, a query location and a set of query keywords, the TOPK-SK retrieves the closest k objects each of which contains all keywords in the query. BTOPK-SK is the batch processing of sets...

A simple and reliable touch sensitive security system CODING

#include <REGX51.H> #include "lcd.c" #define MAX_DELAY() delay(65000) sbit Vibra_Sense=P3^1; sbit Buz=P1^0; void intro() {  lcd_init();  lcd_str("Touch Sensitive ",0x80);  lcd_str("Security System ",0xc0);  MAX_DELAY();MAX_DELAY();  lcd_clr();  }  void main()  { unsigned int i = 0, j= 0; intro();    while(1)    { lcd_str("Security Syst On",0x80); lcd_str("No Vibra Detectd",0xc0); Buz = 1; if(Vibra_Sense == 1) { while(Vibra_Sense == 1) delay(1000); } else { while(Vibra_Sense == 0) delay(1000); } Buz = 0; lcd_str("Vibraton Detectd",0xc0);delay(65000); while(1);    }  }