In this tutorial, we are going to interface a buzzer and flame sensor with Surilli WiFi. Whenever a flame is detected, a buzzer starts beeping.
What Is a Flame Sensor?The flame sensor is a rather simple device located at the burner assembly. It's not much more than a thin, usually bent, metallic rod that sits in front of the flame stream inside the furnace. The purpose of the flame sensor is to confirm to the system that whenever the gas valve is open, a fire is actually present.
Flame sensor to Surilli WiFi:
VCC -> USB
GND-> GND
A0 -> ADC
Led interfacing to Surilli WiFi:
LED +ve is connected to PIN 13 of Surilli WiFi.
LED -ve is connected to GND pin of Surilli WiFi.
Buzzer interfacing to Surilli WiFi:
Buzzer +ve is connected to PIN12 of Surilli WiFi.
Buzzer -ve is connected to GND pin of Surilli WiFi.
Step 2: The Circuitryint sensorPin = A0; // select the input pin for the LDR
int sensorValue = 0; // variable to store the value coming from the sensor
int led = 13; // Output pin for LED
int buzzer = 12; // Output pin for Buzzer
void setup() {
// declare the ledPin and buzzer as an OUTPUT:
pinMode(led, OUTPUT);
pinMode(buzzer,OUTPUT);
Serial.begin(9600);
}
void loop()
{
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
if (sensorValue < 200)
{
Serial.println("Fire Detected");
Serial.println("LED ON");
digitalWrite(led,HIGH);
digitalWrite(buzzer,HIGH);
delay(1000);
}
else
{
Serial.println("Fire Not Detected");
Serial.println("LED OFF");
digitalWrite(led,LOW);
digitalWrite(buzzer,LOW);
delay(1000);
}
}
Open Arduino IDE and make sure that you have selected the right board and port. Now copy and paste the Arduino IDE sketch from down below.
That's it! After uploading this code on you Surilli board, the sensor will start working, and whenever a flame is detected, the buzzer will produce a beep.
If you have any queries, feel free to contact us at surilli.io.
Comments
Please log in or sign up to comment.