LKKK
LKKK
#include <SoftwareSerial.h>
const int fireThreshold = 600; // Set this value according to your sensor
void setup() {
Serial.begin(9600);
pinMode(fireSensorPin, INPUT);
delay(1000);
}
void loop() {
Serial.println(fireLevel);
callEmergencyNumber();
} else {
void callEmergencyNumber() {
delay(1000);
gsmSerial.println("ATH"); // Hang up after a delay (you can leave out if you want to auto-end)
delay(1000);
}
Explanation of the Code:
After uploading the code, monitor the serial output in the Arduino IDE to check if the fire
sensor is working properly.
You may need to tweak the threshold value depending on how sensitive your fire sensor
is and the conditions in which you're testing it.
Important Notes:
Power Supply: The GSM module requires a stable power supply, so make sure you are
using a dedicated power source if needed (e.g., a separate 5V supply).
GSM Module Activation: Some GSM modules might need to initialize the network
before dialing. You might need to include additional AT commands (like AT+CSQ to
check signal strength) depending on your module's behavior.