Skip to main content

Case 08 Intelligent obstacle avoidance

Introduction

This course is designed to introduce students to graphical programming and the application of ultrasonic sensors. Students will learn how to program the car to avoid obstacles. Through this case, students will deepen their understanding of knowledge points such as judgment, branching, and or not in program design, and understand the working principle of ultrasonic sensors.

Teaching Objectives

Understand the relevant knowledge points such as judgment, branch, and or not of graphical programming.

Learn how ultrasonic sensors work and their applications.

Master how to use ultrasonic sensors to detect obstacles, and write corresponding programs for obstacle avoidance.

Teaching Preparation

Cutebot Pro × 1

micro:bit × 1

Teaching Process

Course Introduction

In this lesson, we will use Cutebot Pro smart racing car to make a car that can automatically avoid obstacles. Through this project, we will learn how to use graphical programming and sensor technology to control the behavior of the car.

We will learn how to use ultrasonic sensors to detect obstacles and write the corresponding code to control the actions of the car.

Are you ready for this fun challenge? let's start!

Inquiry Activities

How to detect obstacles using an ultrasonic sensor?

How to write a program to let the car automatically turn to avoid collision when encountering obstacles?

Sample Code

Link:https://makecode.microbit.org/_KgLeP413s4yf

You can also download the program directly from the following web page.

Teamwork and Presentation

Students are divided into groups to complete the production and programming of the car together.

Students are encouraged to collaborate, communicate and share experiences with each other.

Each team has the opportunity to present the smart car they built to the other teams.

Summary and Reflection

Review course content to remind students of what knowledge and skills they have acquired.

Guide students to discuss the problems and difficulties they encountered in the production process, and how to solve these problems.

Guide students to think about other applications of the car ultrasonic sensor in life.