1. Job title
Ultrasonic rangefinder and passive speaker
2. Target of work
The target of the work is to acquire practical skills in measuring distance using an ultrasonic rangefinder and generating sound signals through a speaker.
3. Tasks of work:
- have a look with the methods of distance measurements using the ultrasonic rangefinder HC-SR04;
- have a look how to generate sound pulses using the passive speaker KY-006;
- create an algorithm for the programs in accordance with the tasks of paragraph 6;
- write the programs code according to the setting algorithm in paragraph 3.
4. List of laboratory work
|ultrasonic rangefinder |
|passive speaker |
and USB port driver is for CH341
|S -> Arduino D10|
+ -> +5v
– -> Gng
|Gnd -> Gng|
Echo -> Arduino D12
Trig -> Arduino D11
Vcc -> +5v
5. Input data and materials
Article is devoted to working with ultrasonic sensor HC-SR04
Article is devoted to working with module with passive sound emissions KY-006
6. Exercises for laboratory work
Display in the Serial monitor the distance from the ultrasonic sensor HC-SR04 to a handicap (hand, phone, book, etc.) when the signal is received from this sensor. Display distance in centimeters.
The message “Collision hazard!” is displayed in the Serial monitor if the distance from the handicap to the ultrasonic sensor HC-SR04 is less than 15cm.
Send a sound signal of any tone with 1 second duration through the passive sound emitter KY-006.
When the handicap approaches the ultrasonic sensor HC-SR04 at the distance closer than 20 centimeters, a signal should sound in the form of three successive sounds of different tonality, each 0.5 seconds long from the passive sound emitter KY-006.
8. Form and conditions of delivery / acceptance of work.
Translated by Pavel Kalinin