Skip to main content

garbage monitoring using arduino code with gsm

#include <SoftwareSerial.h>

#include <LiquidCrystal.h>

//LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

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

SoftwareSerial mySerial(0,1);

#define trigPin 2
#define echoPin 3

#define PIR_sensor 4
#define m11 5
#define m12 6

void setup()
{
   lcd.begin(16, 2);
   lcd.print("    Garbage    ");
   Serial.println("garbage ");
  lcd.setCursor(0,1);
  lcd.print("   Open Close    ");
  Serial.println(" open close");
  delay(3000);
  lcd.clear();
  //lcd.print(" ");
  delay(2000);
mySerial.begin(9600); // Setting the baud rate of GSM Module
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
 pinMode(m11, OUTPUT);
  pinMode(m12, OUTPUT);
 

}
void loop()
{
 readPIR();
 pingDist();
 SendMessage();
}


void pingDist ()
  {
   
long duration, distance;
int max = 80; // Let consider as Height of the Garbage Bin is = 80 cm.
float diff, perc;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
diff = max - distance; // 'diff' variable tells u that, how much the Garbage Bin is Left to fill.
perc = (diff/max)*100; // 'perc' variable tells u that, how much percentage the Garbage Bin is filled.

if (perc>=10)
{
 
Serial.println("Garbage Bin is FULL."); // When the Garbage Bin is filled more than 90%, then this Error Message will Displayed.
lcd.print("Garb Bin full.");
lcd.setCursor(2,1);
// Call the Function of Send SMS.
SendMessage(); // Send Message Function Call.
}

else
{
Serial.print("Garbage Bin is Filled ");
lcd.setCursor(0,1);
//lcd.print("Garb Bin filled");
Serial.print(perc);
Serial.print("     %."); // These 3 Lines are print, that how much the Garbage
lcd.setCursor(0,0);
lcd.print("perc:");
lcd.print("    %.");
lcd.setCursor(5, 0);
//Bin is Filled...Ex. "Garbage Bin is Filled 70%.".
}


if (distance >= 200 || distance <= 2)
{
Serial.println("Out of range");
lcd.print("Out of range");
lcd.setCursor(0,1);
}
else
{
Serial.print(distance);
Serial.println(" cm");
//lcd.print("  ");
//lcd.print(" cm");
lcd.setCursor(9,1);
}

delay(500);
}
void SendMessage()
{
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
//lcd.print("AT+CMGF=1");
//lcd.setCursor(0,1);

delay(1000); // Delay of 1000 milli seconds or 1 second

mySerial.println("AT+CMGS=\"+919003413525\"\r"); // Replace x with mobile number

//lcd.print("AT+CMGS=\"+919003413525\"\r");

lcd.setCursor(0,1);

//delay(1000);

mySerial.println("Garbage Bin is Full."); // The SMS text you want to send
//lcd.print("Garb.BinisFull");

//delay(1000);

mySerial.println((char)26); // ASCII code of CTRL+Z

//delay(1000);

}

void readPIR()
{

 if(digitalRead(PIR_sensor))
  {
    lcd.setCursor(0,0);
    lcd.print("Movement Detected");
    Serial.println("Movement Detected");
    lcd.setCursor(0, 1);
    lcd.print("    Gate Opened    ");
    Serial.println("Gate Opened ");
    digitalWrite(m11, HIGH);         // gate opening
    digitalWrite(m12, LOW);
    delay(1000);
    digitalWrite(m11, LOW);          // gate stop for a while
    digitalWrite(m12, LOW);
    delay(1000);
    lcd.clear();
    lcd.print("   Gate Closed    ");
    digitalWrite(m11, LOW);           // gate closing
    digitalWrite(m12, HIGH);
    delay(1000);
    digitalWrite(m11, LOW);            // gate closed
    digitalWrite(m12, LOW);
    delay(1000);
  }
}

Comments

Popular posts from this blog

IDENTITY-BASED PROXY-ORIENTED DATA UPLOADING AND REMOTE DATA INTEGRITY CHECKING IN PUBLIC CLOUD report

IDENTITY-BASED PROXY-ORIENTED DATA UPLOADING AND REMOTE DATA INTEGRITY CHECKING IN PUBLIC CLOUD ABSTRACT More and more clients would like to store their data to PCS (public cloud servers) along with the rapid development of cloud computing. New security problems have to be solved in order to help more clients process their data in public cloud. When the client is restricted to access PCS, he will delegate its proxy to process his data and upload them. On the other hand, remote data integrity checking is also an important security problem in public cloud storage. It makes the clients check whether their outsourced data is kept intact without downloading the whole data. From the security problems, we propose a novel proxy-oriented data uploading and remote data integrity checking model in identity-based public key cryptography: IDPUIC (identity-based proxy-oriented data uploading and remote data integrity checking in public cloud). We give the formal definition, system model and se

A LOCALITY SENSITIVE LOW-RANK MODEL FOR IMAGE TAG COMPLETION

A LOCALITY SENSITIVE LOW-RANK MODEL FOR IMAGE TAG COMPLETION ABSTRACT Many visual applications have benefited from the outburst of web images, yet the imprecise and incomplete tags arbitrarily provided by users, as the thorn of the rose, may hamper the performance of retrieval or indexing systems relying on such data. In this paper, we propose a novel locality sensitive low-rank model for image tag completion, which approximates the global nonlinear model with a collection of local linear models. To effectively infuse the idea of locality sensitivity, a simple and effective pre-processing module is designed to learn suitable representation for data partition, and a global consensus regularizer is introduced to mitigate the risk of overfitting. Meanwhile, low-rank matrix factorization is employed as local models, where the local geometry structures are preserved for the low-dimensional representation of both tags and samples. Extensive empirical evaluations conducted on three

LIFI

LIFI Prof . Harald Haas is a technology of high brightness light emitting diodes(LED).It is bidirectional ,high speed and fully networked wireless communication.    LiFi is designed to use LED light bulbs similar to those currently in use in many energy-conscious homes and offices. However, LiFi bulbs are outfitted with a   chip   that modulates the light imperceptibly for optical data transmission. LiFi data is transmitted by the LED bulbs and received by photoreceptors. LiFi's early developmental models were capable of 150 megabits-per-second ( Mbps ). Some commercial kits enabling that speed have been released. In the lab, with stronger LEDs and different technology, researchers have enabled 10   gigabits -per-second (Gbps), which is faster than   802.11ad .  Benefits of LiFi: ·         Higher speeds than  Wi-Fi . ·         10000 times the frequency  spectrum  of radio. ·         More secure because data cannot be intercepted without a clear line of si