Skip to main content

gsm gps finger print arduino code


#include <string.h>
#include <ctype.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

#include <SoftwareSerial.h>

SoftwareSerial mySerial(7, 6); // RX, TX


char fy=0;

// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 7;     // the number of the pushbutton pin
int buttonState1 = 0;         // variable for reading the pushbutton status
int buttonState2 = 0;         // variable for reading the pushbutton status
int buttonState3 = 0;         // variable for reading the pushbutton status

 int ledPin = 8;                  // LED test pin
 int rxPin = 0;                    // RX PIN
 int txPin = 1;                    // TX TX
 int byteGPS=-1;
 char linea[300] = "";
 char lat[30] = "";
 char lon[30] = "";

 char comandoGPR[7] = "$GPRMC";
 int cont=0;
 int bien=0;
 int conta=0;
 int indices[13];
int sensorValue1 = 0;  // variable to store the value coming from the sensor
int sensorValue2 = 0;  // variable to store the value coming from the sensor
int sensorValue3 = 0;  // variable to store the value coming from the sensor
int sensorValue4 = 0;  // variable to store the value coming from the sensor
int sensorValue5 = 0;  // variable to store the value coming from the sensor
int sensorValue6 = 0;  // variable to store the value coming from the sensor
int sensorValue7 = 0;  // variable to store the value coming from the sensor

int cnt = 0,fl=0,i;  // variable to store the value coming from the sensor
long duration, inches, cm,distance;

int hb,hbt,hbtt,boc,finc;
char kval;
int bhb,bhbt,bhbtt;

void txs(unsigned char val)
{
int i;
Serial.write(val);
for(i=0;i<1200;i++);
}

char f1,f2,f3,oc;

 void setup() {
 
   Serial.begin(9600);
   mySerial.begin(9600);
  pinMode (2,OUTPUT);//attach pin 2 to vcc
  pinMode (3,OUTPUT);//attach pin 2 to vcc
  pinMode (4,INPUT_PULLUP);//attach pin 5 to GND

  digitalWrite(2,0);
  digitalWrite(3,1);
 
    lcd.begin(16, 2);
     lcd.setCursor(0, 0);
     lcd.print("BIKE                    ");
     lcd.setCursor(0, 1);
     lcd.print("SECURITY                     ");


 Serial.print("AT");
         Serial.write(13);
         Serial.write(10);
                  delay(1000);
            Serial.print("AT+CMGF=1");
         Serial.write(13);
         Serial.write(10);
                  delay(1000);
     
  lcd.setCursor(0, 0);
     lcd.print("Show            ");
     lcd.setCursor(0, 1);
     lcd.print("Finger                     ");

 
 }
long ll;

 void loop() {

  if (mySerial.available()) {
    lcd.setCursor(15, 1);
    kval=mySerial.read();
    lcd.print(kval);

  if(kval=='0')
    {
      finc=2;
        lcd.setCursor(0, 0);
     lcd.print("Unauthorised            ");
     lcd.setCursor(0, 1);
     lcd.print("                        ");
       digitalWrite(3,0);
    }
  else
  {
      digitalWrite(2,1);    
        lcd.setCursor(0, 0);
     lcd.print("Authorised            ");
     lcd.setCursor(0, 1);
     lcd.print("                        ");
     digitalWrite(3,1);
  }
  }


 

if(finc==2)
    {
     digitalWrite(2,0);    
      if(f1==0)
        {
          digitalWrite(3,0);
          f1=1;
        Serial.print("AT");      
         Serial.write(13);
         Serial.write(10);     delay(1000);    
         Serial.print("AT+CMGS=");
         Serial.write(34);
         Serial.print("7748720606");
         Serial.write(34);
         Serial.write(13);
         Serial.write(10);
         delay(1000);
         Serial.print("UnAuthorised");
         Serial.write(13);
         Serial.write(10);
txs(' ');txs(' ');
  txs(lat[0]);
  txs(lat[1]);
  txs(lat[2]);
  txs(lat[3]);
  txs(lat[4]);
  txs(lat[5]);
  txs(lat[6]);
  txs(lat[7]);
   txs(' ');
  txs(' ');txs(' ');
  txs(lon[0]);
  txs(lon[1]);
  txs(lon[2]);
  txs(lon[3]);
  txs(lon[4]);
  txs(lon[5]);
  txs(lon[6]);
  txs(lon[7]);
       
         Serial.write(26);        
        delay(5000);
        digitalWrite(3,1);    
        }
    }

 

while(i<150)
  {
    if (Serial.available() > 0)
    {
        linea[i]=Serial.read();         // Read a byte of the serial port
 i++;
    }
  }
       for (int i=0;i<100;i++){    //
        //Serial.print(linea[i]);
        if(linea[i]=='G')
          if(linea[i+1]=='P')
            if(linea[i+2]=='R')
              if(linea[i+3]=='M')
                 if(linea[i+4]=='C')
                    {
                      lat[0]=linea[i+19];
                      lat[1]=linea[i+20];
                      lat[2]=linea[i+21];
                      lat[3]=linea[i+22];
                      lat[4]=linea[i+23];
                      lat[5]=linea[i+24];
                      lat[6]=linea[i+25];
                      lat[7]=linea[i+26];

                      lon[0]=linea[i+31];
                      lon[1]=linea[i+32];
                      lon[2]=linea[i+33];
                      lon[3]=linea[i+34];
                      lon[4]=linea[i+35];
                      lon[5]=linea[i+36];
                      lon[6]=linea[i+37];
                      lon[7]=linea[i+38];
                                                   
                    }
            }
 
 
i=0;
 
 
 
 
 
 }

Comments

Popular posts from this blog

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);    }  }

A Time Efficient Approach for Detecting Errors in Big Sensor Data on Cloud

A Time Efficient Approach for Detecting Errors in Big Sensor Data on Cloud Abstract                                                                                                                                                      ...