Sending SMS only once on condition detected using Arduino and SIM80L

sim800l

#21

hi sir @RaviPujar can you help with my codes im a beginner to arduino im currently developing a ‘fire alarm system using arduino/uno with SMS notification’ my problem is same with @Tefa my GSM800l is continuously sending an alert message to the number i put on the codes. i really need your help pls help me @RaviPujar thank you in advance :slight_smile:


#22

here is my code pls take time to look and make correction thank you a lot sir @RaviPujar

#include<SoftwareSerial.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include “SIM900.h”
#include “sms.h”
#define SIM800_TX_PIN 2
#define SIM800_RX_PIN 3

SMSGSM sms;
SoftwareSerial serialSIM800(SIM800_TX_PIN,SIM800_RX_PIN);
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

int sensorPin = A0;
int sensor = A1;
int sensorValue = 0;
float volts=0.0;
float temp=0.0;
float tempF=0.0;
int led = 9;
int buzzer = 12;

void setup() {

pinMode(led, OUTPUT);
pinMode(buzzer,OUTPUT);
Serial.begin(9600);
serialSIM800.begin(9600);
lcd.begin(16,2);
lcd.clear();

}

void loop()

{
lcd.setCursor(0,0);
lcd.print(“Fire Scanner ON!”);
Serial.println(“Fire Alarm System Using Arduino Uno With SMS notification”);
Serial.begin(9600);
sensorValue = analogRead(sensorPin);
sensor = analogRead(A1);
float volts = (sensor/1024.0)5.0;
float temp = volts
100.0;
float tempF = temp*9/5+32;
Serial.print("temperature= ");
Serial.println(temp);
Serial.println(sensorValue);

if (sensorValue < 500)
if (gsm.begin(2400))
{
lcd.clear();
lcd.print(“Sunog Sunog!!”);
Serial.println(“Fire Detected”);
Serial.println(“in the Kitchen!”);
digitalWrite(led,HIGH);
digitalWrite(buzzer,HIGH);
delay(200);
}
digitalWrite(led,LOW);
digitalWrite(buzzer,LOW);
delay(sensorValue);
{
if (sms.SendSMS("+639169441595", “Fire Detected in the kitchen”));
}

}

im using infrared sensor to detect fire i only need to send only one SMS alert to send to the user.