The flame detection systems are specially designed to react quickly to any appearance of flame. When it comes to protecting areas where flammable products are present, the speed of reaction is crucial to protect the installations in a concept of total safety.
In this project we will realize an intelligent fire detection system with the ESP32 card connected to the Internet network.
It mainly uses KY-026 flame sensor and buzzer.
When the flame sensor detects a flame, the ESP32 card gives the order for the buzzer to sound and sends an alert email via WIFI.
KY-026 flame detector
To perform the assembly, you can connect
the buzzer terminal (+) to pin D4 of the ESP32 board
the buzzer terminal (-) to the GND pin of the ESP32 board
the VCC pin of the flame sensor to the 3.3V pin of the ESP32 board
the GND pin of the flame sensor to the GND pin of the ESP32 board
Here is the program of the intelligent fire detection system connected to the Internet:
print('RUN : main.py')
import umail from machine
import Pin, ADC from time
ConnectWifi.connect() #connect to the Internet network by wifi
flamme = ADC(Pin(34))
flamme.atten(ADC.ATTN_11DB) #Full range: 3.3v
flamme_value = flamme.read()
if (flamme_value<4095): #flame detection
buzzer.value(1) # the buzzer starts ringing
smtp = umail.SMTP('smtp.gmail.com', 587,
smtp.to('email@example.com') smtp.send("Fire alarm") # Send an alert email
buzzer.value(0) #the buzzer stops ringing