Free Shipping Over $119



Microbit Tutorial 3.3 Lesson 19 “Automatic door”

Posted by Fiona Su on

Microbit Tutorial 3.3 Lesson 19 “Automatic door”

1.Learning goals

image.png  image.png

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.

2.Preparation

Hardware:

  • 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.

3.handmade

image.png 

image.png 

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

image.png 

image.png 

image.png 

image.png 

image.png 

5.Combine blocks

image.png 

image.png 

The code of the experiment: Lesson 19 Automatic door_distance.rar

Tutorial

Buy Yahboom Microbit Starter Learning Kit for Kids BBC Micro bit Science Set

0 comments

Leave a comment

Please note, comments must be approved before they are published