Course Content
IoT Engineering Course using ESP32 with 12 Real-World Projects

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

Scroll to Top