X
Home > Blog > STEM for Arduino > HOW to Make a Manual Control Fan with Kidsuno

HOW to Make a Manual Control Fan with Kidsuno

By r October 14th, 2024 41 views
In this project, we adopt a capacitive touch sensor and an 130 motor to combine a fan in manual mode. We can control the startup of the fan by the capacitive touch sensor.

Flow

4401

Assembly

line1

Required Components

44_00

line1

Step 1

44_01

line1

Step 2

44_02

line1

Step 3

44_03

line1

Step 4

44_04

line1

Step 5

44_05

line1

Step 6

44_06

line1

Step 7

44_07

line1

Completed

44_08

line1

Wiring Diagram

4402

Test Code

Open KidsBlock and connect the board to computer. Choose File –> Load from your computer.

3111

Choose path D:\Code\1.Code_kidsuno and open 4.4Manual mode.sb3.

4403

Click 3209 to connect to port and then 2210.

Explanations

5top

Code Blocks

Blocks

Code block

Events

begin

P

setmode

P

readdigital

Vari

variablename

Vari

setvariable

Vari

variable

Operators

=

Operators

and

Motor

Motor_analogWrite

Control

forever

Control

if

Control

wait

line5

Build blocks:

Click add to import library DC Motor.

3907

  1. Initialization

    Set the sensor pin to D2. Define a variable press with an initial value of 0 to monitor the state of motor.

    4404

line3

  1. Main Code

    Loop:

    • When the module is touched (D2 reads 1) and press = 0, the fan rotates, and press will be reassigned to 1.

    • When the module is touched (D2 reads 1) and press = 1, the fan stops, and press will be reassigned to 0.

    4405

5bottom

Test Result
4top
After uploading code, touch the module and the fan starts to work. Touch it again, and the fan will stop.
4403
4bottom
HOW to Make a Remote Control Fan with Kidsuno
Previous
HOW to Make a Remote Control Fan with Kidsuno
Read More
Comprehension! HOW to Monitor Smart Home Environment with ESP32
Next
Comprehension! HOW to Monitor Smart Home Environment with ESP32
Read More
Message Us