Microbit Tutorial 3.3 Lesson 19 “Automatic door”
After you download the program,please the ultrasonic module on the side of the door. If the ultrasonic module is blocked by hand (simulating someone standing in front of the door), the servo will rotate 90 degrees to open the door. After two seconds, the door will automatically close. Let's try it together.
- 1 x Micro:bit Board
- 1 x Micro:bit expansion board
- 1 x servo kit
- 1 x Ultrasonic
- 1 x door ( Owned )
- 4 x DuPont line female to male
- 3 x DuPont line male to male
- 1 x Power module
- 1 x Breadboard
- 1 x PC
- 1 x USB Cable
Then the micro:bit is connected to the computer through USB, and the computer will pop up a U disk and click the URL in the U disk to enter the programming interface.Input this URL https://github.com/lzty634158/yahboom_mbit_en to get the package.
In this lesson we will use the servos and ultrasonic module. Both VCCs must be connected to 5V.
How to distinguish the positive and negative of the servo?
The brown line of servo is the negative pole, the red line of servo is the positive pole, and the yellow line of servo is connected to P2. Ultrasonic TRIG is connected to P0, ECHO is connected to P1, and everyone can use the charging treasure to supply power to the 5v power supply module. The servo, ultrasonic and micro:bit negative (GND) must be connected to the GND of the power supply.
4.Search for blocks
The code of the experiment: Lesson 19 Automatic door_distance.rar
- Yahboom Microbit Starter Learning Kit for Kids BBC Micro bit Science Set Tutorial
- Last Tutorial>> Microbit Tutorial 3.2 Lesson 18 "Ball small light"
- Next Tutorial>>Microbit Tutorial 3.4 Lesson 20 “Colorful gesture lights”