Site icon Circuit Ideas for You

Simple Flame Sensor Circuit using Arduino

Flame sensor is very important for many uses like industry machines, safety check and fire alarm.

In this post for Simple Flame Sensor Circuit using Arduino shows how to connect flame sensor to Arduino to find fire.

This project is cheap and works well for real-life fire detection.

Coding:

Code for Flame Sensor Digital (D0) Output:

// Pin Definitions
const int BUZZER_PIN = 13; // Pin connected to the buzzer
const int FLAME_SENSOR_PIN = 2; // Pin connected to the flame sensor

void setup() {
  // Set pin modes
  pinMode(BUZZER_PIN, OUTPUT);
  pinMode(FLAME_SENSOR_PIN, INPUT);

  // Initialize serial communication
  Serial.begin(9600);
}

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

  // Check if flame is detected
  if (flameDetected == HIGH) {
    Serial.println("Flame Detected!");
    digitalWrite(BUZZER_PIN, HIGH); // Turn on the buzzer
  } else {
    Serial.println("No Flame");
    digitalWrite(BUZZER_PIN, LOW); // Turn off the buzzer
  }

  // Add a small delay for stability
  delay(100);
}

Code for Flame Sensor Analog (A0) Output:

// Pin Definitions
const int ANALOG_PIN = A0;      // Flame sensor connected to analog input pin A0
const int BUZZER_PIN = 13;      // Buzzer connected to pin 13
const int THRESHOLD = 400;      // Flame detection threshold

void setup() {
  pinMode(BUZZER_PIN, OUTPUT);  // Set the buzzer pin as an output
  Serial.begin(9600);           // Initialize serial communication
}

void loop() {
  // Read the value from the flame sensor
  int analogValue = analogRead(ANALOG_PIN);
  Serial.print("Flame Sensor Value: ");
  Serial.println(analogValue); // Print the sensor value for debugging

  // Check flame levels
  if (analogValue > THRESHOLD) {
    digitalWrite(BUZZER_PIN, HIGH);  // Activate buzzer
    Serial.println("High Flame Detected!");
  } 
  else if (analogValue == THRESHOLD) {
    digitalWrite(BUZZER_PIN, HIGH);  // Activate buzzer briefly
    Serial.println("Low Flame Detected!");
    delay(400);                      // Short delay to indicate low flame
    digitalWrite(BUZZER_PIN, LOW);   // Deactivate buzzer
  } 
  else {
    digitalWrite(BUZZER_PIN, LOW);   // Deactivate buzzer
    Serial.println("No Flame Detected.");
  }

  // Small delay to stabilize sensor readings
  delay(100);
}

Circuit Working:

Simple Flame Sensor Circuit Diagram using Arduino

Parts List:

ComponentQuantity
IC 78091
Arduino Uno1
Flame Sensor Module 4 pin1
Buzzer1

Circuit working is mentioned below:

This post shows how to use IC 7809 to keep voltage steady at 9V.

It is helpful when our power is more or not stable like 12V battery or unregulated power.

This gives safe voltage to Arduino and flame sensor using step down.

Flame sensor sees infrared light from fire and gives analog value which is more fire and higher value.

It also has digital pin with HIGH or LOW depending on fire level.

Arduino keeps checking the sensor.

If fire level is too high then buzzer turns ON to warn user.

Also shows fire level on Serial Monitor for checking or logging.

When flame is found then buzzer makes sound to alert.

Uses of Flame sensors:

Fire alarm are used in homes and offices

It watches for fire danger in labs and in kitchens

Keep fire based machines like furnace and kiln safe

Formula:

Analog-to-Digital Conversion (ADC):

Arduino uses built-in ADC to change analog signal from flame sensor to digital value.

Formula:

Vin = (ADC Value × Vref) / 1023

where:

This formula helps us convert sensor reading to real voltage.

How to Build:

To build a Simple Flame Sensor Circuit using Arduino follow the below mentioned steps for connections:

Conclusion:

This Simple Flame Sensor Circuit using Arduino is simple but works well.

Using just Arduino, sensor and buzzer we can build a flame detection system.

It shows how small sensors can solve real problems with microcontrollers.

References:

High Voltage Flame Sensor and An Arduino

Exit mobile version