Skip to main content

Fire Alarm Device

Introduction

In this project, we will learn how to make a fire alarm device, using the MQ2 smoke sensor to detect smoke. When smoke is detected, it will automatically sound an alarm and spray water to extinguish the fire.

Teaching Objectives

Understand how to use the MQ2 sensor

Understand how to use the OLED display

Teaching Preparation

Before starting the teaching, please make sure you have prepared the following necessary materials:

PictureNameNumberNote
Smart Life Kit1
USB Cable1
micro:bit1Prepare Yourself
PC1Prepare Yourself

These materials will provide you with a complete experience, ensuring that you can smoothly carry out subsequent operations and learning. If you are ready for the above, we can proceed to the next step.

Course Introduction

The purpose of installing an automatic fire alarm system is to detect fires in time, take measures such as fire extinguishing and evacuation in time, and minimize the losses caused by fire. What functions should a fire alarm device include? Can we make a fire alarm device?

Project Production

Hardware Connection

Connect the MQ2 smoke sensor to the P1 interface of the wukong expansion board, the relay to the P2 interface of the wukong expansion board, the water pump to the relay, the collision sensor to the P8 interface of the wukong expansion board, and the OLED display to the IIC interface of the wukong expansion board.

Programming platform

We usually use graphical programming platform makecode to program micro:bit

Programming platform entrance: https://makecode.microbit.org/

Create a new project

Open https://makecode.microbit.org/

New Project

Enter a project name and click Create.

Add software library

Click Extensions in the Toolbox of the MakeCode programming interface.

Search for iot-environment-kit on the pop-up page and click to select the iot-environment-kit software library.

Search for wukong on the pop-up page and click to select the wukong software library.

Write a program

Sample program: https://makecode.microbit.org/_TsohJrKmC60K

You can also download the program directly from the following web page.

How to download the program to micro:bit?

Use a USB cable to connect PC and micro:bit V2.

After the connection is successful, a drive named MICROBIT will be recognized on the computer.

Click in the lower left corner and select Connect Device.

Click

Click

In the pop-up window, select BBC micro:bit CMSIS-DAP, and then select Connect. At this point, our micro:bit has been successfully connected.

Click Downloader.

Result

When the fire alarm device detects smoke or is manually triggered, it will automatically spray water and sound an alarm.

Extended knowledge

What functions should the automatic fire alarm system include?

  1. Trigger device

In the automatic fire alarm system, the device that automatically or manually generates a fire alarm signal is called a trigger device. • Mainly includes fire detectors and manual fire alarm buttons. • Fire detectors are devices that can respond to fire parameters (such as smoke, temperature, flame radiation, gas concentration, etc.) and automatically generate fire alarm signals. • Manual fire alarm buttons are devices that manually generate fire alarm signals and start the automatic fire alarm system.

  1. Fire alarm device

• In the automatic fire alarm system, the control indicating device used to receive, display and transmit fire alarm signals, and can send control signals and have other auxiliary functions is called a fire alarm device. • The fire alarm controller is responsible for providing a stable working power supply for the fire detector; monitoring the working status of the detector and the system itself. • Receive, convert and process the alarm signal output by the fire detector.

  1. Linkage output device

• A device that sends out fire alarm signals that are different from ambient sound and light is called a fire alarm device. • It sends out fire alarm signals to the alarm area in the form of sound, light and audio to warn people to quickly take safe evacuation measures and take fire-fighting and disaster relief measures.