X
Home > Blog > STEM for Arduino > HOW to Simulate a Fire Alarm with Kidsuno

HOW to Simulate a Fire Alarm with Kidsuno

By r October 31st, 2024 45 views
The fire alarm system of the station can effectively prevent and deal with forest fires.
In this experiment, we build a fire alarm with a flame sensor and a passive buzzer. When flame is detected, the buzzer will emit sounds for alarming.

Flow

4201

Assembly

line1

Required Parts

42_00

line1

Step 1

42_01

line1

Step 2

42_02

line1

Step 3

42_03

line1

Step 4

42_04

line1

Step 5

42_05

line1

Step 6

42_06

line1

Step 7

42_07

line1

Step 8

42_08

line1

Completed

42_09

line1

Wiring Diagram

4202

Test Code

Open KidsBlock and connect the board to your computer. Click File –> Load from your computer.

3111

Choose D:\Code\1.Code_kidsuno to open 4.2Fire alarm.sb3 file.

4203

Click Unconnectedto connect to port and then 2210.

Explanations

5top

Conceive:

Set a threshold of voltage to determine whether there is flame. When the sensor detects flame, the voltage is lower than the threshold, and the buzzer alarms. The buzzer will stop alarming when the voltage exceeds the threshold (the sensor detects no flame).

line2

Code structure:

  1. Initialization. Set the pins of the flame sensor and the passive buzzer, set the voltage value of a single scale, and set the frequency of the passive buzzer.

    3603

  2. Loop.

    Print the analog value and voltage of the flame sensor.

    Determine whether the voltage is lower than 4 (Herein, we set 4 as the threshold, which is adjustable according to needs).

    • voltage < 4: buzzer alarms.

    • voltage ≥ 4: buzzer does not emit sounds.

    4204

5bottom

Test Result
4top
Upload the code. When the flame sensor detects flame, the voltage will lower than 4, and the buzzer will alarm. If not, the buzzer will not emit sounds.
4205
4bottom
HOW to Simulate Rainwater Detection with Kidsuno
Previous
HOW to Simulate Rainwater Detection with Kidsuno
Read More
HOW to Make a Track Alarm with KidsIOT
Next
HOW to Make a Track Alarm with KidsIOT
Read More
Message Us