3.13 Fan/Motor Module
3.13.1 Overview
The motor adopts HR1124S motor control chip that is a single channel H-bridge driver chip used in DC motors. The H-bridge drive uses PMOS and NMOS power tubes with low on-resistance, ensuring lower power loss and longer safe working time. In addition, its standby and static working current are both low, so it is commonly used in toys.
3.13.2 Schematic Diagram

Motor control logic table:
IO18 |
IO17 |
motor state |
|---|---|---|
HIGH |
LOW |
forward rotate |
LOW |
HIGH |
reverse rotate |
HIGH |
HIGH |
stop (a gradual stop) |
LOW |
LOW |
brake (a brake stop) |
3.13.3 Code Blocks

This block controls the rotation of the motor. You only need to set motor pins and output levels of the pins.
3.13.4 Test Code
3.13.4.1 Build Code
There are two ways to upload the code: directly open the code file we provide; or manually build blocks.
Directly open the code file we provide:
Click
and choose Load from your computer

We have already downloaded the codes on computer desktop, so open the file and choose
3-13-fan.sb3
Manually build blocks:
In
, find
block.In
, find and place
block under
.

In
, put
into
, and set pin IO17 to output LOWand pin IO18 to outputHIGH.Add a delay of 2S.

Duplicate the above code and modify pin IO17 to
HIGHand IO18 toLOW.Duplicate again and set both IO17 and IO18 to
LOW.
Complete Test Code

3.13.4.2 Test Result
After uploading code, you will see the fan forward rotates for 2s and then reverses for another 2s. Then it stops. These actions repeat.