Flame Sensor Interfacing Raspberry Pi

 1. Introduction

A flame sensor is used to detect fire or flame using infrared light emitted by fire. It is commonly used in fire detection and safety systems. This sensor helps in early fire detection and alert systems.


2. Components

  • Raspberry Pi
  • Flame Sensor Module
  • LED
  • 220Ω Resistor
  • Breadboard
  • Jumper Wires

3. Circuit and connections

Raspbery Pi
Raspberry Pi Pinout Diagram

Pinout Diagram Flame Sensor
Pinout Diagram Flame Sensor
Connections:

  • VCC → 3.3V (Pin 1)
  • GND → GND (Pin 6)
  • DO → GPIO17 (Pin 11)
  • LED + → GPIO18 (Pin 12)
  • LED – → GND (via 220Ω resistor)

4. Detailed Step By Step Circuit working

  1. Flame sensor detects infrared light from fire
  2. When flame is present → sensor output changes
  3. Digital output (DO) becomes LOW (in most modules)
  4. Raspberry Pi reads signal from GPIO17
  5. When flame detected → LED turns ON
  6. When no flame → LED OFF

5. Libraries to be included

import RPi.GPIO as GPIO
import time

6. Code

import RPi.GPIO as GPIO
import time

flame = 17
led = 18

GPIO.setmode(GPIO.BCM)
GPIO.setup(flame, GPIO.IN)
GPIO.setup(led, GPIO.OUT)

while True:
if GPIO.input(flame) == 0: # Flame detected
GPIO.output(led, True)
print("Flame Detected!")
else:
GPIO.output(led, False)
time.sleep(0.1)

7. Detailed Step By Step Code working

  1. Import GPIO and time libraries
  2. Assign flame sensor to GPIO17
  3. Assign LED to GPIO18
  4. Set GPIO mode to BCM
  5. Set flame sensor as input
  6. Set LED as output
  7. Read sensor value using GPIO.input()
  8. If LOW → flame detected → LED ON
  9. Else → LED OFF
  10. Add delay for stability

8. Tips

  • Adjust sensitivity using onboard potentiometer
  • Avoid sunlight interference
  • Test with safe flame (like candle)
  • Keep proper distance from flame

9. Uses

  • Fire alarm systems
  • Industrial safety systems
  • Fire detection robots
  • Smart safety devices

10. Conclusion

The flame sensor is a useful safety component for detecting fire. This project helps in building simple fire alert systems using Raspberry Pi.

തുടക്കക്കാർക്കായുള്ള ഇലക്ട്രോണിക്സ് ലളിതമായി പഠിക്കാം.

Empowering students in Kerala with hands-on technical skills.