Case 11: Following a car with a fixed distance
Introduction
This course aims to guide students to create a case of following a car with a fixed distance, combining the functions of micro:bit to create the case.
Teaching objectives
Understand the principle of following a car with a fixed distance: learn how to monitor the distance of the car in front through sensors and adjust the speed of the car according to this distance.
Teaching preparation
Before starting teaching, please make sure you have prepared the following necessary materials:
Picture | Name | Number | Note |
---|---|---|---|
TPbot Edu | 1 | ||
USB Cable | 1 | ||
micro:bit | 1 | Prepare Yourself | |
PC | 1 | Prepare Yourself |
Course Introduction
Welcome to our latest course - Fixed Distance Following Technology. In this course, we will explore how to make our car automatically maintain a safe distance from the car in front of it during driving, just like an experienced driver. This is a practical and challenging technology that involves sensor application, data processing, and intelligent decision-making.
Exploration Activities
What are the application scenarios of ultrasonic sensors?
Software
Programming
Click Advanced
in the code drawer of MakeCode to view more code options.
In order to program TPbot Edu, we need to add an extension library. Find Extensions
at the bottom of the code drawer and click it. A dialog box will pop up, search for tpbot
, and then click to download this code library.
Sample program
Program
Please refer to the program link: https://makecode.microbit.org/_0pwh2iHkLhLq
You can also download the program directly from the following website.
Conclusion
The car automatically maintains the distance from the car in front.
Extended knowledge
Application of ultrasonic sensors in life Ultrasonic sensors have been widely used in various fields due to their non-contact measurement, high accuracy, and fast response. The following are some examples of the application of ultrasonic sensors in life:
Automobile assisted driving system Ultrasonic sensors are widely used in automobile assisted driving systems, such as reversing radar. They help drivers perceive the surrounding environment through multiple probes installed around the vehicle, provide blind spot detection, and remind drivers when someone is in the blind spot.
Industrial automation In the field of industrial automation, ultrasonic sensors are used to detect the position and distance of products to ensure the accuracy and safety of the production process, including material handling and positioning control on assembly lines.
Liquid level monitoring Ultrasonic sensors are suitable for real-time monitoring of liquid height in various storage tanks, and are widely used in liquid level monitoring of reservoirs, water tanks, and chemical tanks.
Smart home Ultrasonic sensors are also widely used in smart homes, such as automatic doors, smart trash cans, and anti-theft systems, providing a convenient and safe home environment.