Arduino UNO Fire and Gas Detecting Robot with SIM800L SMS and Call Alerts
View and Edit Project In Cirkit Designer
Fire and Gas Detecting Robot with Call and SMS Alert
Summary
This project involves a fire and gas detecting robot that uses various sensors to detect hazards. Upon detection, it sends an SMS and makes a call using the SIM800L module. The robot also controls motors for movement and activates a water pump via a relay in case of fire. The system is controlled by an Arduino UNO microcontroller.
Component List
Motor with reducer
- Pins: 3 - 6 VCC, GND
- Description: Motor with a built-in reducer for controlled speed.
Motor amarillo motorreductor hobby
- Pins: vcc, GND
- Description: Hobby motor with a built-in reducer.
5V Battery
- Pins: positive, negative
- Description: Power source for the circuit.
5V Mini Water Pump
- Pins: positive pin, negative pin
- Description: Water pump activated in case of fire.
1 Channel 5V Relay Module
- Pins: VCC+, VCC- (GND), IN, N.O., COM, N.C.
- Description: Relay module to control the water pump.
7.4V Battery
- Pins: +, -
- Description: Additional power source for the circuit.
SIM800L
- Pins: NFT, RING, VCC, DTR, RST, MIC +, RXD, MIC-, TXD, SPK+, GND, SPK-
- Description: GSM module for sending SMS and making calls.
Arduino UNO
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
- Description: Microcontroller to control the entire system.
L293 Motor Driver
- Pins: A1, A2, EN_A, VCC, GND, EN_B, B2, B1, MA 2, MA1, -V, +V, MB1, MB2
- Description: Motor driver to control the motors.
KY-026 Flame Sensor
- Pins: AO, GND, VCC, DO
- Description: Sensor to detect flames.
Buck Converter
- Pins: IN+, IN-, OUT+, OUT-
- Description: Voltage regulator to step down voltage.
MQ-2
- Pins: GND, VCC, ANALOG, Digital
- Description: Gas sensor to detect gas leaks.
Micro Servo 9G
- Pins: GND, +5V, PWM
- Description: Servo motor for additional mechanical control.
Wiring Details
Motor with reducer
- 3 - 6 VCC connected to l293 motor driver MA 2
- GND connected to l293 motor driver MA1
Motor amarillo motorreductor hobby
- vcc connected to l293 motor driver MB2
- GND connected to l293 motor driver MB1
5V Battery
- positive connected to 1 Channel 5V Relay Module COM
- negative connected to 5V Mini Water Pump negative pin
5V Mini Water Pump
- positive pin connected to 1 Channel 5V Relay Module N.C.
- negative pin connected to 5V Battery negative
1 Channel 5V Relay Module
- VCC+ connected to Arduino UNO 5V
- VCC- (GND) connected to Arduino UNO GND
- IN connected to Arduino UNO D12
- N.O. connected to 5V Mini Water Pump positive pin
- COM connected to 5V Battery positive
7.4V Battery
- + connected to l293 motor driver +V
- - connected to l293 motor driver -V
SIM800L
- VCC connected to Arduino UNO 5V
- GND connected to Arduino UNO GND
- RXD connected to Arduino UNO D3
- TXD connected to Arduino UNO D2
Arduino UNO
- 5V connected to SIM800L VCC, MQ-2 VCC, KY-026 Flame Sensor VCC, 1 Channel 5V Relay Module VCC+, Buck converter OUT+, Micro servo 9G +5V
- GND connected to SIM800L GND, MQ-2 GND, KY-026 Flame Sensor GND, 1 Channel 5V Relay Module VCC- (GND), Buck converter OUT-, Micro servo 9G GND
- Vin connected to l293 motor driver VCC
- D13 connected to Micro servo 9G PWM
- D12 connected to 1 Channel 5V Relay Module IN
- D11 connected to l293 motor driver B1
- D10 connected to l293 motor driver B2
- D9 connected to l293 motor driver A2
- D8 connected to l293 motor driver A1
- D7 connected to MQ-2 ANALOG
- D6 connected to KY-026 Flame Sensor DO
- D5 connected to KY-026 Flame Sensor DO
- D4 connected to KY-026 Flame Sensor DO
- D3 connected to SIM800L RXD
- D2 connected to SIM800L TXD
L293 Motor Driver
- GND connected to Arduino UNO GND
- VCC connected to Arduino UNO Vin
- A1 connected to Arduino UNO D8
- A2 connected to Arduino UNO D9
- B1 connected to Arduino UNO D11
- B2 connected to Arduino UNO D10
- MA 2 connected to Motor with reducer 3 - 6 VCC
- MA1 connected to Motor with reducer GND
- MB2 connected to Motor amarillo motorreductor hobby vcc
- MB1 connected to Motor amarillo motorreductor hobby GND
- +V connected to 7.4V Battery +
- -V connected to 7.4V Battery -
KY-026 Flame Sensor
- VCC connected to Arduino UNO 5V
- GND connected to Arduino UNO GND
- DO connected to Arduino UNO D6, D5, D4
Buck Converter
- IN+ connected to 7.4V Battery +
- IN- connected to 7.4V Battery -
- OUT+ connected to Arduino UNO 5V
- OUT- connected to Arduino UNO GND
MQ-2
- VCC connected to Arduino UNO 5V
- GND connected to Arduino UNO GND
- ANALOG connected to Arduino UNO D7
Micro Servo 9G
- GND connected to Arduino UNO GND
- +5V connected to Arduino UNO 5V
- PWM connected to Arduino UNO D13
Code Documentation
/*
* Fire and Gas Detecting Robot with Call and SMS Alert
*
* This code integrates fire and gas sensors to detect hazards. Upon detection,
* it sends an SMS and makes a call using the SIM800L module. It also controls
* motors for movement and activates a water pump via a relay in case of fire.
*/
#include <Servo.h>
// Pin definitions
const int flameSensor1Pin = 4;
const int flameSensor2Pin = 5;
const int flameSensor3Pin = 6;
const int gasSensorPin = 7;
const int relayPin = 12;
const int motorA1Pin = 8;
const int motorA2Pin = 9;
const int motorB1Pin = 10;
const int motorB2Pin = 11;
const int servoPin = 13;
const int sim800lRxPin = 2;
const int sim800lTxPin = 3;
Servo myservo;
void setup() {
// Initialize serial communication
Serial.begin(9600);
// Initialize pins
pinMode(flameSensor1Pin, INPUT);
pinMode(flameSensor2Pin, INPUT);
pinMode(flameSensor3Pin, INPUT);
pinMode(gasSensorPin, INPUT);
pinMode(relayPin, OUTPUT);
pinMode(motorA1Pin, OUTPUT);
pinMode(motorA2Pin, OUTPUT);
pinMode(motorB1Pin, OUTPUT);