π₯ 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.