配合Ultrasonic Sensor制作一個智能洗手間
你有想過洗手間會自行進行消毒和淨化空氣嗎?
以下是一個智能洗手間的模型,
當沒人在用馬桶時(Ultrasonic Sensor感應的距離 < 2cm ),上方的藍燈便會開啟以表示正在消毒.
而當有人在用的時候,抽氣扇便會開啟以淨化空氣.

需要用到的配件(不包括模型配件) :
- micro:bit x 1
- I/O board x 1
- Ultrasonic sensor x 1
- motor x 1
- light lamp x 1
電線接駁方法 :
Ultrasonic Sensor :
紅線 --> 3.3V (+)
綠線 --> 3.3V (GND)
藍線 --> P0 (Echo)
黑線 --> P1 (Trig)
馬達 : P13
燈 : P15

Coding 教學 :

關於如何編寫ultrasonic sensor coding 請看此 : here
示範影片 :