Case 10: Sound Control
Introduction
This course aims to guide students to make a case of a voice-controlled car, combining the functions of micro:bit to make the case.
Teaching Objectives
Combining the functions of micro:bit to achieve more extended cases
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
Hello everyone! Welcome to this creative and challenging course. Today we will explore how to use sound to control the speed of the car. Imagine that your car can respond to the sound around it. The louder the volume, the faster it runs; the quieter the volume, the slower it runs. This is not only a programming project, but also an interesting exploration of the relationship between sound and movement.
Exploration Activities
Learn how to use sound sensors to detect ambient volume.
Programming Logic: Master how to write programs to control the speed of the car according to changes in volume.
Software
Programming
Click Advanced
in the code drawer of MakeCode to view more code options.
In order to program the TPbot Edu car, 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/_1pJXAKfkw3C7
You can also download the program directly from the following website.
Conclusion
The car automatically adjusts its speed based on the loudness of the sound.
Extended Knowledge
How Sound Propagates Sound is a mechanical wave that propagates through a medium, such as air, water, or solids. Here are the basic principles of sound propagation:
Vibration of the sound source The propagation of sound begins with the vibration of the sound source. When an object vibrates, it causes the surrounding medium, such as air molecules, to vibrate as well. These vibrations spread outward in the form of waves.
Propagation in a medium Sound requires a medium to propagate because sound waves are interactions between particles in the medium. In gases, such as air, these particles are separated, while in liquids and solids, the particles are more closely connected.
Compression and rarefaction When a sound source vibrates, it causes the particles in the medium to be compressed (pushed closer) and rarefaction (pulled farther apart). This pattern of compression and rarefaction forms a sound wave.
Longitudinal waves A sound wave is a longitudinal wave, which means that the vibration direction of the medium particles is the same as the direction of the wave's propagation. For example, in air, when sound waves travel, the air particles vibrate up and down, while the sound waves travel forward.
Wave Speed and Frequency The speed at which sound waves travel depends on the properties of the medium, such as density and elasticity. Sound waves travel fastest in solids, followed by liquids, and slowest in gases. The frequency of a sound wave determines the pitch of the sound; the higher the frequency, the higher the pitch.
Reflection, Refraction, and Diffraction When sound waves encounter obstacles or pass through the boundaries of different media, they can be reflected, refracted, or diffracted. Reflection is the phenomenon that sound waves bounce back after encountering obstacles; refraction is the phenomenon that sound waves change direction when they change speed when they enter from one medium into another; and diffraction is the phenomenon that sound waves continue to propagate around small holes or obstacles when they encounter them.
Human Ear Perception When sound waves reach the human ear, they cause the eardrum to vibrate. These vibrations are transmitted to the inner ear through the bones and fluid in the ear, stimulating hair cells, and ultimately converted into nerve signals that are recognized as sound by the brain.
The propagation of sound is a complex process that involves multiple physical, physiological, and psychological levels. Understanding how sound travels helps us better understand sound technology, such as speakers, microphones, and sonar systems.