شحن مجاني للأوردرات فوق
1000 ج
رمضان كريم
Fire Detection Solution for Arduino and Raspberry Pi Projects
The 4-PIN IR Flame Sensor is a specialized module that detects infrared light emitted by flames in the 760nm-1100nm wavelength range. This compact sensor provides both digital and analog outputs, making it ideal for fire detection systems, smart home devices, and robotics projects.

760nm-1100nm wavelength range
Digital (TTL) and Analog signals
Sensitivity potentiometer
4-pin connection (VCC, GND, DO, AO)
| Detection Range | 0.8m (standard lighter flame) |
|---|---|
| Detection Angle | ≈60° |
| Operating Voltage | 3.3V – 5V DC |
| Output Signals | Digital (TTL) + Analog |
| Response Time | <100ms |
| Dimensions | 32mm × 14mm |

| Pin | Label | Description | Connection |
|---|---|---|---|
| 1 | VCC | Power (3.3V-5V) | 5V |
| 2 | GND | Ground | GND |
| 3 | DO | Digital Output | Digital Pin |
| 4 | AO | Analog Output | Analog Pin |
// Basic Connections:
// VCC → 5V
// GND → GND
// DO → D2 (Digital Input)
// AO → A0 (Analog Input)
// For best results, position sensor 30-50cm from detection area
// Digital Output Example
const int flameDigital = 2;
void setup() {
pinMode(flameDigital, INPUT);
Serial.begin(9600);
}
void loop() {
if (digitalRead(flameDigital) {
Serial.println("Flame detected!");
// Add your response code here
}
delay(100);
}
// Analog Output Example
const int flameAnalog = A0;
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(flameAnalog);
Serial.print("Flame intensity: ");
Serial.println(sensorValue);
if (sensorValue > 500) { // Adjust threshold as needed
Serial.println("Danger! Strong flame detected");
}
delay(200);
}
// Automatic baseline calibration
int baseline = 0;
void calibrate() {
for(int i=0; i<10; i++) {
baseline += analogRead(A0);
delay(100);
}
baseline = (baseline/10) + 50; // Add safety margin
}
// Visual flame alert
void loop() {
int val = analogRead(A0);
if(val > baseline) {
digitalWrite(LED_PIN, HIGH);
tone(BUZZER_PIN, 1000, 500);
} else {
digitalWrite(LED_PIN, LOW);
}
}
// ESP8266 WiFi Alert
if(analogRead(A0) > threshold) {
WiFiClient client;
if(client.connect(server, 80)) {
client.print("GET /alert?flame=detected");
}
}
// Fire-fighting robot
if(digitalRead(FLAME_PIN)) {
stopMotors();
activateWaterPump();
delay(3000);
}
No account yet?
Create an Account
Recent Comments