10. Project 5: Alarm System

Level: level

10.1. Part List

  1. Motion sensor X1

  2. Mono-tone buzzer X1 (placed on Multiple Actuators for smart house)

  3. Multiple Sensors for smart house X1

  4. Multiple Actuators for smart house X1

  5. Connecting Wire X1

  6. micro:bit X1

  7. USB Cable X1

10.2. Description

In project 5, you can learn how to use motion sensor and buzzer to design an alarm system to maintain the house security.

10.3. Steps

  1. Basic (Add block on start) > House (Add block Initialize Smarthon multiple-sensor)

  2. Basic (Add block forever) > Logic (Add block if…then…else) > For if : Logic (Add block 0 = 0, change “0” to House “Get motion”; “=” to “>”; “0” to “200”)

  3. For then: House-More (Add block Set Buzzer to intensity 0, change “0” to “1023”) > Basic (Add block show leds – create a telephone symbol)

  4. For else: House-More (Add block Set Buzzer to intensity 0)

  5. Basic (Add block pause (ms) 100) auto_fit

10.4. Hardware

  1. Connect the Motion sensor to Motion Trigger port of Multiple Sensors

  2. Download the code and transfer to micro:bit

  3. Plug the micro:bit into Multiple Sensors

  4. Connect Multiple Sensors and Multiple Actuators by connecting wire

  5. Try shake your hand nearby the motion sensor to test auto_fit * Try to use other actuators, such as LED lights (green and red) to make an alarm system.