# Case 20: The Smart Airer ## Purpose --- To make a smart arier. ![](./images/case-20-01.png) ## Link: --- [micro:bit Wonder Building Kit](https://shop.elecfreaks.com/products/elecfreaks-micro-bit-32-in-1-wonder-building-kit-without-micro-bit-board?_pos=5&_sid=2094afd2f&_ss=r) ## Materials Required --- ![](./images/case-20-02.png) Video link: [https://youtu.be/ZjROexNQT1I](https://youtu.be/ZjROexNQT1I) ## 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) ## Installation Mthods of Hardwares Install the water level sensor with the bricks. ![](./images/Wonder-Building-Kit-step-water-level-sensor.png) ## Hardware Connection Connect two [motors](https://www.elecfreaks.com/geekservo-motor-2kg-compatible-with-lego.html) to M1 and M2, the [servo](https://www.elecfreaks.com/geekservo-2kg-360-degrees-compatible-with-lego.html) to S1 and the [water level sensor](https://www.elecfreaks.com/octopus-water-level-sensor.html) to P1 ports on [Wukong breakout board](https://www.elecfreaks.com/wukong-board-with-lego-holder-for-micro-bit.html). ![](./images/Wonder-Building-Kit-case-20-06.png) ## Software Platform --- [MakeCode](https://makecode.microbit.org/) ## 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](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.