Guide for the 4-PIN IR Infrared Flame Detection Sensor Module

4-PIN IR Infrared Flame Detection Sensor Module
Fire Detection Solution for Arduino and Raspberry Pi Projects
Introduction
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.

Key Features
IR Detection
760nm-1100nm wavelength range
Dual Output
Digital (TTL) and Analog signals
Adjustable
Sensitivity potentiometer
Simple Interface
4-pin connection (VCC, GND, DO, AO)
Technical Specifications
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 Configuration
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 |
Note: The module includes a sensitivity adjustment potentiometer (clockwise to increase sensitivity)
Wiring with Arduino
1 2 3 4 5 6 7 |
<img class="aligncenter size-full wp-image-16240" src="http://ekostra.com/wp-content/uploads/2025/04/arduino-flame-sensor.jpg" alt="" width="1482" height="763" />// Basic Connections: // VCC → 5V // GND → GND // DO → D2 (Digital Input) // AO → A0 (Analog Input) // For best results, position sensor 30-50cm from detection area |
Important: Avoid direct sunlight or strong IR sources to prevent false triggers
Basic Digital Detection
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
// 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 Flame Intensity
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
// 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); } |
Advanced Applications
Auto-Calibration
1 2 3 4 5 6 7 8 9 10 |
// 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 } |
LED Indicator
1 2 3 4 5 6 7 8 9 10 |
// 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); } } |
Wireless Alert
1 2 3 4 5 6 7 |
// ESP8266 WiFi Alert if(analogRead(A0) > threshold) { WiFiClient client; if(client.connect(server, 80)) { client.print("GET /alert?flame=detected"); } } |
Robotic Response
1 2 3 4 5 6 |
// Fire-fighting robot if(digitalRead(FLAME_PIN)) { stopMotors(); activateWaterPump(); delay(3000); } |
Troubleshooting
No Detection
- Adjust sensitivity potentiometer clockwise
- Check flame is within 0.8m range
- Verify wiring connections
False Positives
- Reduce sensitivity (turn CCW)
- Shield from ambient IR sources
- Increase detection threshold in code
Inconsistent Readings
- Ensure stable power supply
- Check for loose connections
- Implement software debouncing