Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Fire Detection and Safety System with Relay-Controlled Water Pump

View and Edit Project In Cirkit DesignerImage of Arduino UNO Fire Detection and Safety System with Relay-Controlled Water Pump

Circuit Documentation

Summary

The circuit is designed to detect the presence of a flame using a Sensor SHT113 Flame and then activate a series of safety devices including a buzzer, a siren, and a fan. A KY-019 Relay module is used to control the power to a water pump. The Arduino UNO serves as the central controller, reading the flame sensor's output and controlling the relay, buzzer, and fan accordingly. The circuit is powered by two 5V batteries, one for the Arduino and its peripherals, and the other exclusively for the water pump through the relay.

Component List

Sensor SHT113 Flame

Arduino UNO

Buzzer

Siren

KY-019 Relay Module 1 Channel

Water Pump

5V Battery

Fan

Wiring Details

Sensor SHT113 Flame

Arduino UNO

Buzzer

Siren

KY-019 Relay Module 1 Channel

Water Pump

5V Battery

Fan

Documented Code

// Define pin numbers
int flameSensor = 2;  // Flame sensor input pin
int relayPin = 7;     // Relay module control pin
int buzzerPin = 8;    // Buzzer control pin
int fanPin = 9;       // Fan or LED control pin

void setup() {
  // Initialize the pins
  pinMode(flameSensor, INPUT);
  pinMode(relayPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  pinMode(fanPin, OUTPUT);
  
  // Initially turn off the relay, buzzer, and fan
  digitalWrite(relayPin, LOW);
  digitalWrite(buzzerPin, LOW);
  digitalWrite(fanPin, LOW);
  
  Serial.begin(9600);  // Start the serial communication for debugging
}

void loop() {
  int flameDetected = digitalRead(flameSensor);  // Read the flame sensor value

  if (flameDetected == LOW) {  // Fire detected (assuming LOW means detection)
    Serial.println("Fire detected! Activating safety devices...");
    
    // Turn on relay, buzzer, and fan
    digitalWrite(relayPin, HIGH);
    digitalWrite(buzzerPin, HIGH);
    digitalWrite(fanPin, HIGH);
  } else {
    Serial.println("No fire detected.");
    
    // Turn off relay, buzzer, and fan
    digitalWrite(relayPin, LOW);
    digitalWrite(buzzerPin, LOW);
    digitalWrite(fanPin, LOW);
  }

  delay(1000);  // Check every second
}

The code is written for the Arduino UNO microcontroller. It initializes the pins connected to the flame sensor, relay, buzzer, and fan. In the main loop, it checks the flame sensor's output. If a flame is detected, it activates the relay (which powers the water pump), the buzzer, and the fan. If no flame is detected, it ensures that these devices are turned off. The system checks for a flame once every second.