Download the program to micro:bit to see what happens.
5. If the value of dis more than 10, clear the matrix LEDs, stop melody and turn two LEDs off.
6. Loop in forever block.
When summer comes, you will find it great and convenient to have a remote control fan. With it,
we no longer need to manually turn on and off the fans, especially when you are too hot to want
to move. When you finish this experiment, you will get your own mini micro: bit remote fan! Let's
get started.
Experiment 19 – Remote control fan
Instruction
Connect Crowtail-IR Receiver to P1 port of Crowtail-Base shield for Micro:bit. Connect
Crowtail-Relay to P8 port of Crowtail-Base shield for Micro:bit. Loosen the screws of the relay,
connect one end of the jumper to the 3V3 port of the Base Shield and the other end of the
jumper to the COM port of the Relay. Connect the two wires of the motor to the NO port of the
relay and the GND port of the Base Shield.
Note that the power consumed by the motor is large,
Make your own mini remote control fan.
Target
Micro:bit x1
Crowtail-Base shield for Micro:bit x1
Crowtail-IR Receiver x1
Crowtail-Relay x1
Crowtail-Cable x2
Infrared Remote Control x1
DC Motor x1
USB cable x1
Jumper Wire x1
Required Parts
Hardware learning and connection
When the distance detected by the ultrasonic sensor is less than 10cm, the
matrix LEDs on the micro: bit will display a heart icon, the buzzer will play the
melody, and two LEDs will light up. When the ultrasonic sensor detects a
distance greater than 10cm, the micro: bit will clear the matrix LEDs display,
immediately stop the buzzer to play the melody and turn off the two LEDs.
Result
How can we use this project to make our own songs to welcome others or pranks?
44