20. The Automatic Laundry Rack

20.1. Introduction

Build an automatic laundry rack with a micro:bit.

../../_images/case_19_01.png

20.2. Quick to Start


Materials


Nezha expansion board × 1

micro:bit × 1

360°servo × 1

Bricks × n

Bricks details

../../_images/Bricks_case_19.png

../../_images/case_19_02.png

Connections Diagram


  • Connect the micro:bit with the Nezha expansion board, connect the servo to S1 port and the soil moisture sensor to J1 port on Nezha expansion board.

../../_images/case_19_03.png

Assembly

  • Assemble it as the pictures suggest:

../../_images/case_19_04.png

../../_images/case_19_05.png

../../_images/case_19_06.png

../../_images/case_19_07.png

Video reference: https://youtu.be/t2mYccra8Vw

20.3. MakeCode Programming


Step 1

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

../../_images/case_01_10.png

We need to add a package for programming. Click “Extensions” in the bottom of the drawer and search with “PlanetX” in the dialogue box to download it.

../../_images/case_01_11.png

We need to add a package for programming. Click “Extensions” in the bottom of the drawer and search with “Nezha” in the dialogue box to download it.

../../_images/case_03_09.png

Note: If you met a tip indicating that the codebase will be deleted due to incompatibility, you may continue as the tips say or build a new project in the menu.

Step 2


Programme as the picture shows:

../../_images/case_19_15.png

Result

  • While rainning, the detected value from the soil moisture sensor is over the setting point, the laundry rack folds back in case of the clothes getting wet; while the sun comes out, the the detected value from the soil moisture sensor is below the setting point, and the the laundry rack stretches out to dry the clothes.