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

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. ...

Force Sensing Resistor FSR400

Force Sensing Resistor FSR400 This is a small  force sensitive resistor . It has a 0.16" (4 mm) diameter active sensing area. This FSR will vary its resistance depending on how much pressure is being applied to the sensing area. The harder the force, the lower the resistance. When no pressure is being applied to the FSR, its resistance will be larger than 1MΩ, with full pressure applied the resistance will be 2.5kΩ. Two pins extend from the bottom of the sensor with 0.1" pitch making it bread board friendly. These sensors are simple to set up and great for sensing pressure, but they aren't incredibly accurate. Use them to sense if it's being squeezed, but you may not want to use it as a scale. Dimensions: Overall length: 1.75" Overall width: 0.28" Sensing area: 0.3"