### Project 20: Fan
#### **(1)Description:**

This fan module uses a HR1124S motor-controlling chip, a single-channel H-bridge driver chip containing a low-conductivity resistance PMOS and NMOS power tubes. The low-conducting resistance can ease the power consumption, contributing to the safe work of the chip for longer time.
In addition, its low standby current and low static working current makes itself apply to toys. We can control the rotation direction and speed of the fan by outputting IN + and IN- signals and PWM signals.
#### **(2)Parameters:**
- Working voltage: 5V
- Current: 200mA
- Maximum power: 2W
- Work temperature: -10 ° C to +50 degrees Celsius
- Size: 47.6mm \* 23.8mm
#### **(3)Connection Diagram:**
The fan module needs driving by large current; therefore, we install a battery holder.

The pin GND, VCC, IN+ and IN- of the fan module are connected to pin G, V, 12 and 13 of the shield.
#### **(4)Test Code:**
You can also drag blocks to edit your code, as shown below



**Complete Test Code**
(**Note:** Do not connect the Bluetooth module before uploading the code, because uploading the code also uses serial communication, and there may be conflicts with the Bluetooth serial communication, which can cause the upload to fail.)

#### **(5)Test Results:**
Upload code, wire up components, power on and turn the DIP switch to ON. The small fan will turn clockwise for 2s, stop for 2s and anticlockwise for 2s

#### **(6)Extension Practice:**
We have understood the working principle of the flame sensor. Next, hook up a flame sensor in the circuit , as shown below. Then control the fan to blew out fire with the flame sensor.

You can drag blocs to edit your code, as shown below




**Complete Test Code**
(**Note:** Do not connect the Bluetooth module before uploading the code, because uploading the code also uses serial communication, and there may be conflicts with the Bluetooth serial communication, which can cause the upload to fail.)

After uploading the code, turn on the power switch of the motor drive shield, you can turn on the fan when flame is detected from the left flame sensor of the robot.
