🔥 Lesson 3.2 – Flame Sensor Circuit & ESP32 Connections
In this lesson, we will connect the Flame Sensor with ESP32 and build the hardware setup for our IoT-Based Fire Alert System. We will also connect an LED and a Buzzer that will provide local alerts whenever fire is detected.
🎯 Objective of This Circuit
The purpose of this circuit is to:
✅ Detect the presence of fire using a Flame Sensor
✅ Display alert status using an LED
✅ Generate sound alert using a Buzzer
✅ Send fire detection data to Blynk through ESP32
✅ Build the hardware foundation of the IoT Fire Alert System
🛠️ Components Required
| Component | Quantity |
|---|---|
| ESP32 Development Board | 1 |
| Flame Sensor Module | 1 |
| LED (Red) | 1 |
| 220Ω Resistor | 1 |
| Active Buzzer | 1 |
| Breadboard | 1 |
| Jumper Wires | As Required |
| USB Cable | 1 |
🔌 ESP32 Pin Connections
🔥 Flame Sensor Connection
| Flame Sensor Pin | ESP32 Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| DO | GPIO 27 |
💡 LED Connection
| LED Pin | ESP32 Pin |
|---|---|
| Anode (+) | GPIO 26 |
| Cathode (-) | GND through 220Ω Resistor |
🔔 Buzzer Connection
| Buzzer Pin | ESP32 Pin |
|---|---|
| Positive (+) | GPIO 25 |
| Negative (-) | GND |
📊 Complete Pin Mapping
| Device | ESP32 GPIO |
|---|---|
| Flame Sensor DO | GPIO 27 |
| Alert LED | GPIO 26 |
| Buzzer | GPIO 25 |
🔥 How the Circuit Works
The Flame Sensor continuously monitors the surroundings for fire.
Normal Condition
When no flame is detected:
✅ Sensor output remains HIGH
✅ LED remains OFF
✅ Buzzer remains OFF
✅ Blynk Dashboard shows Safe Status
Fire Detection Condition
When flame is detected:
🔥 Sensor output changes
🔥 ESP32 detects the change
💡 LED turns ON
🔔 Buzzer starts beeping
📱 Fire alert is sent to Blynk
⚙️ Understanding Each Component
🔥 Flame Sensor
The Flame Sensor acts as the input device.
Function
✅ Detects infrared radiation emitted by fire.
Output
Digital Output (DO)
HIGH = No Fire
LOW = Fire Detected
💡 Alert LED
The LED acts as a visual indicator.
Purpose
Normal Condition:
❌ LED OFF
Fire Detected:
✅ LED ON
This helps users quickly identify fire status.
🔔 Buzzer
The buzzer acts as an audio alert device.
Purpose
Normal Condition:
🔇 Silent
Fire Detected:
🔊 Alarm Sound
This immediately alerts nearby people.
🌐 ESP32
ESP32 acts as the brain of the project.
Responsibilities
✅ Read flame sensor data
✅ Control LED
✅ Control buzzer
✅ Connect to Wi-Fi
✅ Send data to Blynk Cloud
✅ Generate IoT alerts
🔄 System Working Flow
Flame Appears
↓
Flame Sensor Detects Fire
↓
ESP32 Reads Sensor Data
↓
LED Turns ON
↓
Buzzer Activates
↓
Data Sent to Blynk
↓
User Receives Alert
⚠️ Important Wiring Precautions
🔹 Check Power Supply
Ensure:
Flame Sensor VCC → ESP32 3.3V
Wrong voltage may damage the sensor.
🔹 Verify Ground Connections
All GND pins must be connected together.
ESP32 GND
Flame Sensor GND
LED GND
Buzzer GND
🔹 Use Resistor with LED
Always connect a 220Ω resistor in series with the LED.
This protects the LED from excessive current.
🔹 Secure Jumper Wires
Loose connections may cause:
❌ False fire detection
❌ Sensor reading errors
❌ Unstable system behavior
🧪 Hardware Testing Before Programming
Before uploading code:
Step 1
Connect ESP32 to the computer.
Step 2
Check the power LED on ESP32.
✅ Should turn ON
Step 3
Check Flame Sensor Power LED.
✅ Should turn ON
Step 4
Verify all wiring connections.
✅ VCC connected correctly
✅ GND connected correctly
✅ GPIO pins connected correctly
Step 5
Confirm there are no loose wires.
📌 Key Points to Remember
✅ Flame Sensor is connected to GPIO 27.
✅ LED is connected to GPIO 26.
✅ Buzzer is connected to GPIO 25.
✅ ESP32 reads fire detection data from the sensor.
✅ LED and buzzer provide local alerts.
✅ ESP32 sends real-time data to Blynk Cloud.
✅ Proper wiring is essential for reliable operation.