Wet & Dry Waste Smart Dustbin for House | Best science Project | Harish Projects

Image
 Watch Full Detailed video 👇🏻 Diagram in Video👆 //Arduino Code// //YouTube: Harish Projects //Order Electronic Parts & Project kit:  HarishProjects.com // #include <Servo.h> Servo servo1; const int trigPin = 12; const int echoPin = 11; long duration; int distance=0; int potPin = A0; //input pin int soil=0; int fsoil; void setup()  {   Serial.begin(9600); //Serial.print("Humidity"); pinMode(trigPin, OUTPUT);  pinMode(echoPin, INPUT);  servo1.attach(8); } void loop()  { //YouTube: Harish Projects //Order Electronic Parts & Project kit:  HarishProjects.com //      int soil=0;   for(int i=0;i<2;i++)   { digitalWrite(trigPin, LOW); delayMicroseconds(7); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); delayMicroseconds(10); duration = pulseIn(echoPin, HIGH); distance= duration*0.034/2+distance; delay(10);   }   distance=distance/2;   Serial.println(distance); if ...

Automatic Emergency Call & SMS when Fire Alert | GSM Based Arduino Project | Harish Projects


 Watch full Detailed video....


Order science Projects kit & Electronics components..

Click here - https://harishprojects.com/product-category/science-projects/


Circuit Diagram by Harish Projects..


Project Arduino Code...

#include <SoftwareSerial.h>

//Order Electronics parts & Science Projects kit from HarishProjects.com
//HarishProjects.com - https://harishprojects.com/
//YouTube - Harish Projects - https://www.youtube.com/@HarishProjects
const String PHONE_1 = "+91..........";
const String PHONE_2 = ""; //optional
const String PHONE_3 = ""; //optional

#define rxPin 4
#define txPin 3
SoftwareSerial sim800L(rxPin,txPin);

#define flame_sensor_pin 2

boolean fire_flag = 0;

#define buzzer_pin 5


void setup()
{

//Order Electronics parts & Science Projects kit from HarishProjects.com
//HarishProjects.com - https://harishprojects.com/
//YouTube - Harish Projects - https://www.youtube.com/@HarishProjects
 
  Serial.begin(115200);
 
 
  sim800L.begin(9600);
 
 
  pinMode(flame_sensor_pin, INPUT);
 
 
  pinMode(buzzer_pin, OUTPUT);
  digitalWrite(buzzer_pin,LOW);
 
 
  Serial.println("Initializing...");
 
  sim800L.println("AT");
  delay(1000);
  sim800L.println("AT+CMGF=1");
  delay(1000);
 
}

//Order Electronics parts & Science Projects kit from HarishProjects.com
//HarishProjects.com - https://harishprojects.com/
//YouTube - Harish Projects - https://www.youtube.com/@HarishProjects

void loop()
{
  while(sim800L.available()){
  Serial.println(sim800L.readString());
  }
 
  int flame_value = digitalRead(flame_sensor_pin);
 
 
  if(flame_value == LOW)
  {
    digitalWrite(buzzer_pin,HIGH);
   
    if(fire_flag == 0)
    {
      Serial.println("Fire Detected.");
      fire_flag == 1;
      send_multi_sms();
      make_multi_call();
    }
   
  }
 
  else
  {
    digitalWrite(buzzer_pin,LOW);
    fire_flag = 0;
  }
 
}

//Order Electronics parts & Science Projects kit from HarishProjects.com
//HarishProjects.com - https://harishprojects.com/
//YouTube - Harish Projects - https://www.youtube.com/@HarishProjects


void send_multi_sms()
{
  if(PHONE_1 != ""){
    Serial.print("Phone 1: ");
    send_sms("Fire is Detected", PHONE_1);
  }
  if(PHONE_2 != ""){
    Serial.print("Phone 2: ");
    send_sms("Fire is Detected", PHONE_2);
  }
  if(PHONE_3 != ""){
    Serial.print("Phone 3: ");
    send_sms("Fire is Detected", PHONE_3);
  }
}

//Order Electronics parts & Science Projects kit from HarishProjects.com
//HarishProjects.com - https://harishprojects.com/
//YouTube - Harish Projects - https://www.youtube.com/@HarishProjects

void make_multi_call()
{
  if(PHONE_1 != ""){
    Serial.print("Phone 1: ");
    make_call(PHONE_1);
  }
  if(PHONE_2 != ""){
    Serial.print("Phone 2: ");
    make_call(PHONE_2);
  }
  if(PHONE_3 != ""){
    Serial.print("Phone 3: ");
    make_call(PHONE_3);
  }
}

//Order Electronics parts & Science Projects kit from HarishProjects.com
//HarishProjects.com - https://harishprojects.com/
//YouTube - Harish Projects - https://www.youtube.com/@HarishProjects

void send_sms(String text, String phone)
{
    Serial.println("sending sms....");
    delay(50);
    sim800L.print("AT+CMGF=1\r");
    delay(1000);
    sim800L.print("AT+CMGS=\""+phone+"\"\r");
    delay(1000);
    sim800L.print(text);
    delay(100);
    sim800L.write(0x1A); //ascii code for ctrl-26 //Serial2.println((char)26); //ascii code for ctrl-26
    delay(5000);
}

//Order Electronics parts & Science Projects kit from HarishProjects.com
//HarishProjects.com - https://harishprojects.com/
//YouTube - Harish Projects - https://www.youtube.com/@HarishProjects

void make_call(String phone)
{
    Serial.println("calling....");
    sim800L.println("ATD"+phone+";");
    delay(20000); //20 sec delay
    sim800L.println("ATH");
    delay(1000); //1 sec delay
}

Comments

Student said…
Can we use 4G sim
shiv keshri said…
Par iasma Sim800L Code Diya Gaya Hai Or Video Ma 900A GSM Bolo Gaya Hai Please Update Code
Ishant said…
Plz update the code

Popular posts from this blog

Smart Bridge - Automatic Hight increase when flooding | Best science Project

How to make Phone control RC car using Arduino #phoneControlCar

Inspire Award Project | Train accident Prevention project | Best science Project / Harish Projects