10. Project 5: Alarm System¶
Level:
10.1. Part List¶
Motion sensor X1
Mono-tone buzzer X1 (placed on Multiple Actuators for smart house)
Multiple Sensors for smart house X1
Multiple Actuators for smart house X1
Connecting Wire X1
micro:bit X1
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¶
Basic (Add block on start) > House (Add block Initialize Smarthon multiple-sensor)
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”)
For then: House-More (Add block Set Buzzer to intensity 0, change “0” to “1023”) > Basic (Add block show leds – create a telephone symbol)
For else: House-More (Add block Set Buzzer to intensity 0)
Basic (Add block pause (ms) 100)
10.4. Hardware¶
Connect the Motion sensor to Motion Trigger port of Multiple Sensors
Download the code and transfer to micro:bit
Plug the micro:bit into Multiple Sensors
Connect Multiple Sensors and Multiple Actuators by connecting wire
Try shake your hand nearby the motion sensor to test * Try to use other actuators, such as LED lights (green and red) to make an alarm system.