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, a warning light, a speaker and a fan in those places that easily break out a fire. When the flame sensor detects a fire, the speaker and the warning light will alarm people, the fan will quickly to put out the fire.

So in this project, you will learn how to use a flame sensor, a passive buzzer module, a LED module and a motor module to simulate the fire alarm system.


You will need the following parts:

Hardware Hookup

Ready to start hooking everything up? Check out the wiring diagram and hookup table below to see how everything is connected.






Insert micro:bit into the edge connector of the expansion board.
Note:micro:bit will always stay attached to the expansion board in the following sessions.


If you are not familiar to make code, don’t worry. Firstly, you can enter this link: to know more about microbit blocks.
Then you can directly enter the to edit your project program. Below is an example code we have done for you.

Example Result

Done wiring and powered up, send the code to MICROBIT. When flame sensor detects the fire nearby, the buzzer module will sound immediately, the LED will light up and the fan will turn. If no fire detected,their states are: buzzer will not sound, LED will remain extinguished, fan will not rotate.


Timely and effective fire alarm can reduce property losses and ensure personal safety. Everyone of us should learn to protect ourselves and family members when confronted with fire alarm.