Skip to main content

temparture gas humiditiy arduino code using iot


 #include <string.h>

 #include <ctype.h>

#include <LiquidCrystal.h>

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);


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;


void txs(unsigned char val)
{

int i;

Serial.write(val);

for(i=0;i<4000;i++);

}


 void setup()
 {
 
   Serial.begin(9600);
  pinMode (2,OUTPUT);//attach pin 2 to vcc
  pinMode (3,OUTPUT);//attach pin 2 to vcc
  pinMode (9,INPUT);//attach pin 5 to GND
    lcd.begin(16, 2);
 lcd.print("IOT MONITOR        ");
digitalWrite(2,0);
digitalWrite(3,0);
/*

 Serial.print("AT");
         Serial.write(13);
         Serial.write(10);
                  delay(1000);
            Serial.print("AT+CMGF=1");
         Serial.write(13);
         Serial.write(10);
                  delay(1000);
     
   Serial.print("at+cstt=");
      Serial.write('"');
    Serial.print("airtelgprs.com");
     Serial.write('"');  Serial.write(13);  Serial.write(10);
                  delay(2000);

    Serial.print("at+cgatt=1");
    Serial.write(13); Serial.write(10);
                     delay(2000);


  Serial.print("at+cgdcont=1,");
  txs('"');
  Serial.print("IP");
  txs('"');    
  txs(',');  
  txs('"');
    Serial.print("airtelgprs.com");
  txs('"');
  txs(13);txs(10);
                    delay(2000);


  Serial.print("at+cgact=1,1");
  txs(13);txs(10);
                    delay(2000);


  Serial.print("at+cgreg=2");
  txs(13);txs(10);
                    delay(2000);


  Serial.print("AT+CIICR");
   txs(13);txs(10);
                    delay(3000);

  Serial.print("AT+CIFSR");
   txs(13);txs(10);
                    delay(2000);


  Serial.print("AT+CIPHEAD=1");
  txs(13);txs(10);
                    delay(2000);


  Serial.print("AT+SAPBR=3,1,");
  txs('"');
  Serial.print("Contype");
  txs('"');
  txs(',');
  txs('"');
  Serial.print("GPRS");
  txs('"');
  txs(13);txs(10);
    delay(1000);

  Serial.print("AT+SAPBR=3,1,");
  txs('"');
  Serial.print("APN");
  txs('"');
  txs(',');
  txs('"');
  Serial.print("airtelgprs.com");
  txs('"');
  txs(13);txs(10);
    delay(1000);
*/
       pinMode(2, OUTPUT);
         pinMode(3, OUTPUT);
 
 }
long ll;
char f1,f2,f3,f4;

 void loop() {
   //digitalWrite(ledPin, HIGH);

  lcd.setCursor(0, 0);
  lcd.print("Tm:            ");
  lcd.setCursor(8, 0);
  lcd.print("Hu:            ");
  lcd.setCursor(0, 1);
  lcd.print("Gs:            ");


  sensorValue1 = analogRead(A0)/2;
  sensorValue1 = analogRead(A0)/2;
  lcd.setCursor(3, 0);
  lcd.write((sensorValue1/100)+0x30);    
  lcd.write(((sensorValue1%100)/10)+0x30);    
  lcd.write((sensorValue1%10)+0x30);      

  sensorValue2 = analogRead(A1)/2;
  sensorValue2 = analogRead(A1)/2;
  lcd.setCursor(12, 0);
  lcd.write((sensorValue2/100)+0x30);    
  lcd.write(((sensorValue2%100)/10)+0x30);    
  lcd.write((sensorValue2%10)+0x30);      

  sensorValue3 = analogRead(A2)/2;
  sensorValue3 = analogRead(A2)/2;
  lcd.setCursor(3, 1);
  lcd.write((sensorValue3/100)+0x30);    
  lcd.write(((sensorValue3%100)/10)+0x30);    
  lcd.write((sensorValue3%10)+0x30);      

ll++;

delay(100);

if(ll>50)
  {
  Serial.print("*");
delay(20);
Serial.print("T");
delay(20);
Serial.print("E");
delay(20);
Serial.print("M");
delay(20);
Serial.print("P");
delay(20);
Serial.print("=");
delay(20);
      Serial.write((sensorValue1/100)+0x30);    
      delay(20);
  Serial.write(((sensorValue1%100)/10)+0x30);    
      delay(20);
  Serial.write((sensorValue1%10)+0x30);      
    delay(20);
delay(20);
Serial.print("_");
delay(20);
Serial.print("H");
delay(20);
Serial.print("u");
delay(20);
Serial.print("m");
delay(20);
Serial.print("i");
delay(20);
Serial.print("=");
delay(20);
      Serial.write((sensorValue2/100)+0x30);    
      delay(20);
  Serial.write(((sensorValue2%100)/10)+0x30);    
      delay(20);
  Serial.write((sensorValue2%10)+0x30);      
    delay(20);
    Serial.print("_");
delay(20);
Serial.print("G");
delay(20);
Serial.print("a");
delay(20);
Serial.print("s");
delay(20);
Serial.print("=");
delay(20);
      Serial.write((sensorValue3/100)+0x30);    
      delay(20);
  Serial.write(((sensorValue3%100)/10)+0x30);    
      delay(20);
  Serial.write((sensorValue3%10)+0x30);      
    delay(20);
Serial.print("#");

    /*
  Serial.print("AT+SAPBR=4,1");
  txs(13);txs(10);
    delay(2000);
  Serial.print("AT+SAPBR=1,1");
  txs(13);txs(10);
    delay(2000);
  Serial.print("AT+SAPBR=2,1");
  txs(13);txs(10);
    delay(2000);
  Serial.print("AT+HTTPINIT");
  txs(13);txs(10);
    delay(2000);
  Serial.print("AT+HTTPPARA=");
  txs('"');
  Serial.print("URL");
  txs('"');
  txs(',');
  txs('"');
  Serial.print("http://www.iotclouddata.com/iotlog/spring8.php");
  txs('?');
  txs('A');txs('=');
  txs((sensorValue1/100)+0x30);
  txs(((sensorValue1%100)/10)+0x30);
  txs((sensorValue1%10)+0x30);  
  txs('&');
  txs('B');txs('=');
  txs((sensorValue2/100)+0x30);
  txs(((sensorValue2%100)/10)+0x30);
  txs((sensorValue2%10)+0x30);  
  txs('&');
  txs('C');txs('=');
  txs((sensorValue3/100)+0x30);
  txs(((sensorValue3%100)/10)+0x30);
  txs((sensorValue3%10)+0x30);  
  txs('"');
  txs(13);txs(10);
  delay(2000);
  Serial.print("AT+HTTPPARA=");
  txs('"');
  Serial.print("CID");
  txs('"');
  txs(',');
  txs('1');
  txs(13);txs(10);
    delay(2000);
  Serial.print("AT+HTTPACTION=0");
  txs(13);txs(10);
    delay(4000);
 
*/
  }




 
i=0;
 
 
 
 
 
 }

Comments

  1. Harrah's Cherokee Casino Resort Map & Floor Plans - Mapyro
    Find 화성 출장샵 your way around the casino, find where everything is located with map directions, read customer reviews, 여수 출장안마 and explore detailed information 안동 출장마사지 about 목포 출장샵 the 원주 출장샵

    ReplyDelete

Post a Comment

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

A SHOULDER SURFING RESISTANT GRAPHICAL AUTHENTICATION SYSTEM

A SHOULDER SURFING RESISTANT GRAPHICAL AUTHENTICATION SYSTEM ABSTRACT Authentication based on passwords is used largely in applications for computer security and privacy. However, human actions such as choosing bad passwords and inputting passwords in an insecure way are regarded as”the weakest link” in the authentication chain. Rather than arbitrary alphanumeric strings, users tend to choose passwords either short or meaningful for easy memorization. With web applications and mobile apps piling up, people can access these applications anytime and anywhere with various devices. This evolution brings great convenience but also increases the probability of exposing passwords to shoulder surfing attacks. Attackers can observe directly or use external recording devices to collect users’ credentials. To overcome this problem, we proposed a novel authentication system PassMatrix, based on graphical passwords to resist shoulder surfing attacks. With a one-time valid login indicator and ...

ABSTRACT

MULTI USER GSM BASED DIGITAL SCROLLING LED DISPLAY WITH PASSWORD AND VOICE ABSTRACT The project mainly focuses on transmission of textual data through air interface by the use of GSM through asynchronous serial communication. The data will be processed by the microcontroller it programmed by embedded c language by using KEIL C compiler. The data will be displayed on led display on LED only after entering unique pass key. Existing System: How a reliable and an authentic wireless communication could be easily developed between a mobile phone and microcontroller using GSM (Global System for Mobile Communication) MODEM (Modulator-Demodulator). This technical paper explains GSM based e-notice board which can be widely used for multitude of applications including educational sector, traffic control, banks, and public advertisements, stoke exchanges etc. Proposed System: In this project we not only send the data, but send the data with pass code also. Which enables us to preve...