A flame sensor is an electronic device that detects the presence of a flame or fire, primarily by sensing the infrared (IR) light emitted by the flame. These sensors are widely used in various safety and fire detection systems, including gas stoves, furnaces, and industrial flame monitoring. They can also be integrated into hobbyist projects for fire alarms or robotics, often interfaced with microcontrollers like the Arduino UNO.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Connect to 3.3V-5V power supply |
2 | GND | Connect to ground |
3 | DO | Digital output; connects to a digital pin on a microcontroller |
4 | AO | Analog output; connects to an analog pin on a microcontroller (optional) |
// Define the digital input pin where the flame sensor is connected
const int flameSensorPin = 2;
void setup() {
pinMode(flameSensorPin, INPUT);
Serial.begin(9600);
}
void loop() {
int flameDetected = digitalRead(flameSensorPin);
// If the sensor's digital output goes LOW, a flame is detected
if (flameDetected == LOW) {
Serial.println("Flame detected!");
} else {
Serial.println("No flame detected.");
}
// Wait for a short period before reading again
delay(200);
}
Q: Can the flame sensor detect smoke? A: No, flame sensors are designed to detect IR light from flames, not smoke particles.
Q: What is the maximum distance the sensor can detect a flame? A: This depends on the sensor's sensitivity and the size of the flame, but typically it is within a few feet.
Q: Can I use the flame sensor with a 3.3V system? A: Yes, most flame sensors can operate at 3.3V, but always check the specific sensor's datasheet.
Q: How do I know if the sensor is working? A: You can test the sensor by exposing it to a safe flame source, like a lighter, and observing the output signal.
Remember to always handle flame sensors with care and to use them responsibly in any application. Safety should be your top priority when working with devices that detect fire or flames.