How to Simulate Fire Alarm System with Micro:bit?
Overview
In daily life, it is often seen that a fire broke out without any precaution. It will cause great economic and human loss. So how can we avoid this situation? Right, install a flame sensor and a speaker in those places that easily break out a fire. When the flame sensor detects a fire, the speaker will alarm people quickly to put out the fire.
So in this project, you will learn how to use a flame sensor and an active buzzer module to simulate the fire alarm system.

Component Introduction
Flame Sensor:
This flame sensor can be used to detect fire or other light sources with wavelength stands at 760nm ~ 1100nm. Its detection angle is about 60°. You can rotate the potentiometer on the sensor to control its sensitivity. Adjust the potentiometer to make the LED at the critical point between on and off state. The sensitivity is the best.
In the fire-fighting robot game, the flame sensor plays an important role in probing the fire source.
Component Required:
-
Micro:bit main board*1
-
Keyestudio Micro bit Sensor V2 Shield*1
-
USB Cable*1
-
Keyestudio Flame Sensor*1
-
Keyestudio Digital Buzzer Module*1
-
DuPont jumper wire* 6
-
Premium 6-Slot AA Battery Holder *1
-
1.5V AA Battery*6
Connection Diagram

Test Code

Test Results
Done wiring and powered up, send the code to micro:bit. When flame sensor detects the fire nearby, the buzzer module will sound immediately,and micro”bit will display “0”; If no fire is detected, the buzzer doesn’t beep, number 1 will be shown on micro:bit.