59. Case 58: Smart Washing Machine#

59.1. Introduction#

With the improvement of people’s living standards and the upgrading of household appliances technology, we rely more and more on the washing machine for this chore, so we learn to make a smart washing machine in this lesson, and we can press different buttons to select different functions, let’s start.

../../_images/58_1.jpg

Materials Required#

Nezha expansion board × 1

micro:bit V2 × 1

RJ11 cable × 1

Bricks × n

Note: If you want all of the above components, you may purchase the Nezha 48 IN 1 Inventor’s Kit.

Assembly Steps#

Component Details

../../_images/58_2.jpg

Build it as the assembly steps suggest:

../../_images/58_3.jpg

../../_images/58_4.jpg

../../_images/58_5.jpg

../../_images/58_6.jpg

../../_images/58_7.jpg

../../_images/58_8.jpg

../../_images/58_9.jpg

../../_images/58_10.jpg

../../_images/58_11.jpg

../../_images/58_12.jpg

../../_images/58_13.jpg

../../_images/58_14.jpg

../../_images/58_15.jpg

../../_images/58_16.jpg

../../_images/58_17.jpg

../../_images/58_18.jpg

../../_images/58_19.jpg

../../_images/58_20.jpg

../../_images/58_21.jpg

../../_images/58_22.jpg

../../_images/58_23.jpg

../../_images/58_24.jpg

../../_images/58_25.jpg

../../_images/58_26.jpg

59.2. Connection Diagram#

Connect the four motors to the M1, M2.

../../_images/58_27.jpg

59.3. MakeCode Programming#

Step 1#

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

../../_images/49_10.png

For programming the servo, we need to add a package. Click “Extensions” at the bottom of the drawer and search with “nezha” to download it.

../../_images/49_11.png

For programming the PIR sensor, we need to add a package. Search with “PlanetX” in the dialogue box and click to download it.

../../_images/49_12.png

Notice: If you met a tip indicating that some codebases would be deleted due to incompatibility, you may continue as the tips say or create a new project in the menu.

Reference#

The program is shown below:

../../_images/58_28.jpg

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

You may also download it directly:

The remote control program is shown below:

../../_images/58_29.jpg

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

Result#

As we can see, we use the remote control to control the speed of rotation of the turntable of the smart washing machine.