Dual Axis Mini CCTV Camera using ESP32 Cam | IOT Based Science Project / Harish Projects

Image
  Purchase Course Video👇 https://harishprojects.graphy.com/ Watch full Detailed Video👇 Project Code👇 #include "esp_camera.h" #include <Arduino.h> #include <WiFi.h> #include <AsyncTCP.h> #include <ESPAsyncWebServer.h> #include <iostream> #include <sstream> #include <ESP32Servo.h> #define PAN_PIN 14 #define TILT_PIN 15 Servo panServo; Servo tiltServo; struct MOTOR_PINS {   int pinEn;     int pinIN1;   int pinIN2;     } ; std::vector<MOTOR_PINS> motorPins = {   { 2 , 12 , 13 } , //RIGHT_MOTOR Pins (EnA, IN1, IN2)   { 2 , 1 , 3 } ,  //LEFT_MOTOR  Pins (EnB, IN3, IN4) } ; #define LIGHT_PIN 4 #define UP 1 #define DOWN 2 #define LEFT 3 #define RIGHT 4 #define STOP 0 #define RIGHT_MOTOR 0 #define LEFT_MOTOR 1 #define FORWARD 1 #define BACKWARD - 1 const int PWMFreq = 1000 ; /* 1 KHz */ const int PWMResolution = 8 ; const int PWMSpeedChannel = 2 ;...

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

How to make Wifi Talking robot with arduino codes and Diagram best science project