22. Case 20: The Smart Airer#

22.1. Purpose#


To make a smart arier.

../../_images/case-20-01.png

22.3. Materials Required#


../../_images/case-20-02.png

Video link: https://youtu.be/ZjROexNQT1I

22.4. Bricks build-up#


../../_images/step-case-20-01.png

../../_images/step-case-20-02.png

../../_images/step-case-20-03.png

../../_images/step-case-20-04.png

../../_images/step-case-20-05.png

../../_images/step-case-20-06.png

../../_images/step-case-20-07.png

../../_images/step-case-20-08.png

../../_images/step-case-20-09.png

../../_images/step-case-20-10.png

../../_images/step-case-20-11.png

../../_images/step-case-20-12.png

../../_images/step-case-20-13.png

../../_images/step-case-20-14.png

../../_images/step-case-20-15.png

../../_images/step-case-20-16.png

../../_images/step-case-20-17.png

../../_images/step-case-20-18.png

../../_images/step-case-20-19.png

../../_images/step-case-20-20.png

../../_images/step-case-20-21.png

../../_images/step-case-20-22.png

../../_images/step-case-20-23.png

../../_images/step-case-20-24.png

../../_images/step-case-20-25.png

../../_images/step-case-20-26.png

../../_images/step-case-20-27.png

../../_images/step-case-20-28.png

../../_images/step-case-20-29.png

../../_images/step-case-20-30.png

../../_images/step-case-20-31.png

../../_images/step-case-20-32.png

../../_images/step-case-20-33.png

../../_images/step-case-20-34.png

../../_images/step-case-20-35.png

../../_images/step-case-20-36.png

../../_images/step-case-20-37.png

22.5. Installation Mthods of Hardwares#

Install the water level sensor with the bricks.

../../_images/Wonder-Building-Kit-step-water-level-sensor.png

22.6. Hardware Connection#

Connect two motors to M1 and M2, the servo to S1 and the water level sensor to P1 ports on Wukong breakout board.

../../_images/Wonder-Building-Kit-case-20-06.png

22.7. Software Platform#


MakeCode

22.8. Coding#


Add extensions#

Click “Advanced” in the MakeCode to see more choices.

../../_images/case-01-03.png

Search with Wukong in the dialogue box to download it.

../../_images/case-01-04.png

Program#

../../_images/case-20-05.png

Link:https://makecode.microbit.org/_diR3FMErAfWF

Result#

when button A is pressed, the two windows open outward and the airer extends outward. When button B is pressed, the airer retracts inward and the two windows close inward. When button A is pressed, the two windows open outward and the airer extends outward, the water level sensor will detect the current rain value, and when the rain value is greater than 10, the airer will automatically retract and the two windows will automatically close.