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

Android Tutorial

Android  is a complete set of software for mobile devices such as tablet computers, notebooks, smartphones, electronic book readers, set-top boxes etc. It contains a  linux-based Operating System ,  middleware  and  key mobile applications . It can be thought of as a mobile operating system. But it is not limited to mobile only. It is currently used in various devices such as mobiles, tablets, televisions etc. This tutorial is developed for beginners and experienced persons. Let's see the topics of android that we are going to learn. Basics of Android In this fundamental chapter, you will learn about android, its components, how to create first android application, internal of first android application etc. What is Android History and Version Software Stack Core Building Blocks Android Emulator Installing softwares Setup Eclipse Hello Android example Internal Details Dalvik VM AndroidManifest.xml R.java Hide Title Bar Activity and I...

CLOUD WORKFLOW SCHEDULING WITH DEADLINE AND TIME SLOT ALGORITHM

CLOUD WORKFLOW SCHEDULING WITH DEADLINE AND TIME SLOT ALGORITHM Abstract Allocating service capacities in cloud computing is based on the assumption that they are unlimited and can be used at any time. However, available service capacities change with workload and cannot satisfy users’ requests at any time from the cloud provider’s perspective because cloud services can be shared by multiple tasks. Cloud service providers provide available time slots for new user’s requests based on available capacities. In this paper, we consider workflow scheduling with deadline and time slot availability in cloud computing. An iterated heuristic framework is presented for the problem under study which mainly consists of initial solution construction, improvement, and perturbation. Three initial solution construction strategies, two greedy- and fair-based improvement strategies and a perturbation strategy are proposed. Different strategies in the three phases result in several heuristics. ...

MobiContext: A Context-aware Cloud-Based Venue Recommendation Framework

            MobiContext: A Context-aware Cloud-Based Venue Recommendation Framework ABSTRACT  In recent years, recommendation systems have seen significant evolution in the field of knowledge engineering. Most of the existing recommendation systems based their models on collaborative filtering approaches that make them simple to implement. However, performance of most of the existing collaborative filtering-based recommendation system suffers due to the challenges, such as: (a) cold start, (b) data sparseness, and (c) scalability. Moreover, recommendation problem is often characterized by the presence of many conflicting objectives or decision variables, such as users’ preferences and venue closeness. In this paper, we proposed MobiContext , a hybrid cloud-based Bi-Objective Recommendation Framework (BORF) for mobile social networks. The MobiContext utilizes multi-objective optimization techniques to generate personalized recommendat...