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 HC-SR04 | passive speaker KY-006 | Arduino Uno |
!!! Attention!!!
When you use an analog of Arduino Wavgat, firstly you must install the appropriate driver on your computer.
Link 1, Link 2
and USB port driver is for CH341
Link
CONNECTION DIAGRAM
KY-006 | HC-SR04 |
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
EXERCISES 2.1
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.
EXERCISES 2.2
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.
EXERCISES 2.3
Send a sound signal of any tone with 1 second duration through the passive sound emitter KY-006.
EXERCISES 2.4
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.
7. Results
8. Form and conditions of delivery / acceptance of work.
Translated by Pavel Kalinin