1.Teaching objectives (knowledge preparation)
Get to know rotary potentiometers and motors, and understand their specifications and parameters.
Implement fan rotation through programming and understand the control logic of motor speed using a rotary potentiometer.
Being able to combine real-life application scenarios and apply project devices to achieve intelligent application scenarios in daily life.
2.Teaching tasks
Build an automatic fan with manually adjustable fan speed.

3,Preparation of teaching environment and equipment
Equipment List: Image (with label number 123456)
Equipment Serial Number Table
| Serial number | number | equipment | Specifications | quantity |
| 1 | rotary potentiometer | 1 | ||
| 2 | motor. | 1 | ||
| 1 |
Software: Smart Code programming software.
Hardware: SMART Code kit: rotary potentiometer, motor.
Other: Several building block devices.
Detailed List of Structural Components
| Serial number | number | equipment | Specifications | quantity |
| 1 | 3-hole beam | 12 | ||
| 2 | 7-hole beam | 4 | ||
| 3 | 13-hole beam | 4 | ||
| 4 | T-shaped beam | 4 | ||
| 5 | Black sales | 36 |
Note: Materials required to fix a set of sensors: 6 3-hole beams, 2 7-hole beams, 2 13 hole beams, 2 T-shaped beams, and 18 black pins.
4.Project Practice Process
(Summary of Knowledge Points: 1. Components. 2. Program Modules. 3. Program Design)
1.Project video (in video format)
2.Project Steps
Assemble the automatic fan using a rotary potentiometer and motor. The fan switch and fan speed are controlled by the value of the rotary potentiometer.
Use SMART Code software to program and control devices.
Firstly, create the main program entrance. The example code is as follows:
Then, create a variable value to store the value of the rotary potentiometer. The example code is as follows:
Then, based on the value of the rotary potentiometer, determine the switch of the motor. When the value is less than 10, control the motor to stop rotating. The example code is as follows:
Then, after the motor rotates, control the motor rotation speed based on the value of the rotary potentiometer. The example code is as follows:
Then, divide the values of the rotary potentiometer into two gears, low speed and tell the corresponding values of the rotary potentiometer to be 10-55 and 55-100, and continue to rotate for 3 seconds. The example code is as follows:
Then, based on the value of the rotary potentiometer, the motor speed control is completed. When the value of the rotary potentiometer is greater than or equal to 10 and less than 55, the motor turns forward at a speed of 20. When the value of the rotary potentiometer is greater than or equal to 55, the motor turns forward at a speed of 100. The example code is as follows:
Finally, complete the entire logic of the automatic fan. The example code is as follows:

3.Optimization and improvement plan.
4.Interesting thinking:
3.Reflection and discussion: What factors affect the accuracy of decibel measuring instruments?
Experimental results
Data records: Table 1 and Table 2
Experimental conclusion:
5.Extension and Expansion
Reflection and exploration:
Question 1:
Question 2:
