14. Project 9: Kitchen Safety¶
Level:
14.1. Part List¶
Town gas sensor x 1
Mono-tone buzzer X1 (placed on Multiple Actuators for smart house)
Motor fan x 1
Multiple Sensors for smart house X1
Multiple Actuators for smart house X1
Connecting Wire X1
micro:bit X1
USB Cable X1
14.2. Description¶
In project 9, you can learn how to use micro:bit to make Kitchen safety system. If the town gas leakage happened, the buzzer and motor fan will be turned on.
14.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 town gas”; “=” to “<”; “0” to “200”)
For then: House (Add block Set Buzzer to intensity 0)
For then: House (Add block Set Motor fan anti-clockwisely to intensity 0)
For else: House (Add block Set Buzzer to intensity 0, change 0 to 1023)
For else: House (Add block Set Motor fan anti-clockwisely to intensity 0, change 0 to 900)
Basic (Add block pause (ms) 100)
14.4. Hardware¶
Download the code and transfer to micro:bit
Plug the micro:bit into Multiple Sensors
Connect Multiple Sensors and Multiple Actuators by connecting wire
Connect the Motor Fan module to motor port of the Multiple Actuators and install it in the kitchen
You can test it by lighter * Try to adjust different speed of the motor fan.