INTRODUCTION

场景图

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.

PARTS NEEDED

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.

接线实物图/表格

火焰传感器接p2

led传感器接P1

无源蜂鸣器接p0

电机模块接P3

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.

PROGRAM

If you are not familiar to make code, don’t worry. Firstly, you can enter this link:https://makecode.microbit.org/reference to know more about microbit blocks.
Then you can directly enter the https://makecode.microbit.org/ 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.