Aniket Singh

Aniket Singh

|

@aniketxai

I’m a Full Stack Developer and IoT/Arduino Innovator. I build smart web apps and intelligent devices. On this site, I share coding tutorials, tech projects, and blogs related to web dev, embedded systems, and startup building.

🚀 View Projects
MERN Web Dev Arduino JavaScript Java DSA

Skills

HTML/CSS
JavaScript
React/MERN
IoT & Arduino

Smoke sensing and call setup in GSM 800l module in Arduino

  


   Hello Guys,In this post we learn how to make smoke detector using gsm module and ardunio in easy way.

Let Start it:-

*Parts Required

S.N.COMPONENTS NAMEDESCRIPTIONQUANTITY
1Arduino BoardArduino UNO R3 Development Board1
2LCD DisplayJHD162A 16x2 LCD Display1
3GSM ModuleSIM800/900 UART GSM Module1
4Gas SensorMQ-135/MQ7/MQ6/MQ5/MQ21
5Arduino Power Supply5V DC Adapter1
6GSM Power Supply12V DC Adapter1
7Potentiometer10K1
8Breadboard-1
9Connecting WiresJumper Wires20

*Schematics & Diagrams


-do all the connection according to this diagram.
*Coding

by-techgyancreative
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
#include <SoftwareSerial.h>
 
SoftwareSerial mySerial(9, 10);
 
int gasValue = A0; // smoke / gas sensor connected with analog pin A1 of the arduino / mega.
int data = 0;
 
void setup()
{
randomSeed(analogRead(0));
mySerial.begin(9600); // Setting the baud rate of GSM Module
Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)
lcd.begin(16,2);
pinMode(gasValue, INPUT);
lcd.print (" Gas Leakage ");
lcd.setCursor(0,1);
lcd.print (" Detector Alarm ");
delay(3000);
lcd.clear();
}
 
void loop()
{
 
data = analogRead(gasValue);
 
Serial.print("Gas Level: ");
Serial.println(data);
lcd.print ("Gas Scan is ON");
lcd.setCursor(0,1);
lcd.print("Gas Level: ");
lcd.print(data);
delay(1000);
 
if ( data > 500) //
{
SendMessage();
Serial.print("Gas detect alarm");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Gas Level Exceed");
lcd.setCursor(0,1);
lcd.print("SMS Sent");
delay(1000);
 
}
else
{
Serial.print("Gas Level Low");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Gas Level Normal");
delay(1000);
}
 
lcd.clear();
}
 
void SendMessage()
{
Serial.println("I am in send");
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"+91900xxxxxxx\"\r"); // Replace x with mobile number
delay(1000);
mySerial.println("Excess Gas Detected. Open Windows");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}

-copy and paste code in ardunio ide.
-choose your com port and board type.
-upload the code.
*message view

-Enjoy

Post a Comment