Distance Calculation with Ultrasonic Sensor. How Deep is the Ocean?

This activity took place from 4th of March to 1st of April at Kareas High School with approximately 220 students aged 12-15 years old in the ICT lesson, which is one hour a week with each class. In some classes 2 teaching hours were required to finish and in some others 3.

These lessons followed on from an earlier activity we did this year with an infrared sensor, which came out of an idea of one of our students for making a safety device. We discussed and investigated the matter and we started with a prototype application with an infrared sensor.

Summary
In this activity, students learn about how ultrasonic sensors work and identify where else in nature they are found. For example, bats and dolphins use ultrasound waves to estimate distance, to move and find their food. Students identify other uses of sonar such as mapping the seabed and measuring the depth of the ocean. They also build an application with an ultrasonic sensor and program the micro:bit to show the distance from an object on the LED matrix of the micro:bit. They also build a model of a car parking application.

Areas involved: Biology, Computer Science, Science and Technology.

Required Knowledge:

• Basic programming, repetitions, if statements, variables.
• The formula of the average speed
• Electric power source, grounding, open and closed electric circuit

Learning objectives

With the completion of this activity, the students will be able to:

• Describe what is ultrasound and how ultrasonic sensors work.
• Identify other species that use ultrasound to communicate, move and find their food.
• Program an application with the micro:bit that uses an ultrasonic sensor.
• Provide a basic explanation of how sensors are integrated into robots via programming.
• Explain other uses of ultrasonic sensors such as measuring the ocean depth, mapping the seabed and car parking sensors.
• Name and explain the different ways of measuring the distance

An ultrasonic sensor generates sound waves to detect and measure the distance to objects.

In this project we have used an Ultrasonic Sensor to determine the distance of an obstacle from the sensor.

https://www.hackster.io/arbazhussain/distance-calculation-with-ultrasonic-sensor-26d63e

When bats navigate at night, they are dependent on their ears and sound rather than on sight. When the bat flies, it will emit a noise, an ultrasonic signal that humans cannot hear because of its high audio frequency. If these ultrasonic signals hit other objects on the flight path, they will be reflected back immediately. After receiving the returned information, the bats complete the whole process of listening, “seeing”, calculating and bypassing obstacles during the flight.

The principle of the ultrasonic sensor is as the same as the above principle.

https://wiki.keyestudio.com/Ks0356_keyestudio_Micro:bit_Mini_Smart_Robot_Car

To help robots identify objects, engineers have created ultrasonic sensors that operate using the same principles.
https://www.microsoft.com/en-us/education/oceans/lessons/measuring-ocean-depth/default.aspx

How does an Ultrasonic Distance Sensor work?
The Ultrasonic Sensor sends out a high-frequency sound pulse and then times how long it takes for the echo of the sound to reflect back. The sensor has 2 openings on its front. One opening transmits ultrasonic waves, (like a tiny speaker), the other receives them, (like a tiny microphone).
The speed of sound is approximately 341 meters (1100 feet) per second in air. The ultrasonic sensor uses this information along with the time difference between sending and receiving the sound pulse to determine the distance to an object. It uses the following mathematical equation:
Distance = Time x Speed of Sound divided by 2

It offers excellent non contact range detection with high accuracy and stable readings from 2ch to 400cm. Its operation is not affected by sunlight or black material, although acoustically soft materials like cloth can be difficult to detect. On the front of the ultrasonic range finder there are two metal cylinders. These are transducers. Transducers convert mechanical forces into electrical signals, one is a transmitting transducer and the other is a receiving transducer. The transmitting transducer converts an electrical signal into the ultrasonic pulse, and the receiving transducer converts the reflected ultrasonic pulse back into an electric signal.

Why/When to use Ultrasonic Sensors ?

1. Ideally suited to accurate, automatic distance measurement in normal and difficult environments.
2. Particularly suitable for environments where optical sensors are unusable such as smoke, dust and similar.
3. Very accurate, stable and can be used over large ranges.

Ultrasonic sensors can measure the following parameters without contacting the medium to be measured:

1. Distance
2. Level
3. Diameter
4. Presence
5. Position

Functioning Of Project:

The ultrasonic sensor emits a high-frequency sound pulse and calculates the distance depending upon the time taken by the echo signal to travel back after reflecting from the desired target. The speed of sound is 341 meters per second in air. After the distance is calculated, it will be displayed on the LED matrix of the micro:bit or an LCD display.

https://maker.pro/arduino/projects/distance-measurement-using-ultrasonic-sensor-and-displaying-on-lcd

 This is the sparkfun HC-SR04 ultrasonic distance sensor. This sensor provides 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can reach up to 3mm. Each HC-SR04 module includes an ultrasonic transmitter, a receiver and a control circuit. There are four pins on the HC-SR04: VCC (Power), Trig (Trigger), Echo (Receive), and GND (Ground). The reason I chose this sensor is that it works on the 3V provided by the BBC micro:bit, therefore it enables us to construct a simpler circuit. We connected the Vcc to the 3V pin of the microbit, the Trig to Pin 0, the Echo to Pin 1 and the GND to the GND of the micro:bit. https://www.sparkfun.com/products/13959

https://www.instructables.com/id/Distance-Sensing-With-the-Microbit-and-Sonar-HC-SR/

We also did the experiment with the 5V Ultrasonic sonar sensor HC-SR04, using batteries for extra power.

This ultrasonic sonar sensor measures distances from 2cm to 400cm with an accuracy up to 3mm. The measurement angle is approximately 15°. The HC-SR04sonar sensor comprises a ultrasonic transmitter, an ultrasonic receiver and a control circuit. The 4 pin connection correspond to:

• Power 5V
• Trigger pulse (input)
• Echo pulse (output)
• 0V (ground)

If you run this code on the micro:bit and move your hand in front of the sensor you will see the distance on the LED display of the micro:bit.
This project could be expanded to work as a prototype for a car parking alarm. Whenever your car comes near any object, the buzzer will ring and the LED will glow so that you don’t get your car damaged.

Connect one speaker or one buzzer on Pin 0 and rearrange the ping and echo pins on pins 1 and 2 of the micro: bit. Then use pin 0 to produce tones more and more often as the distance decreases (how a parking sensor works)

Photos of our application in the lab.

Ultrasound sensors were initially used in vehicles for detecting obstacles when parking but are now evolving into an automatic parking system.

http://www.newelectronics.co.uk/electronics-technology/an-introduction-to-ultrasonic-sensors-for-vehicle-parking/24966/

Another idea is to make a device that will warn the cyclists if they are going too close to people or objects with their bike. The micro:bit can be programmed with the ultrasonic sensor so a grren LED will light when the distance is safe, a yellow LED when the bike is getting too close to an object or human and a red one if the bike is getting too close.

https://www.instructables.com/id/Distance-Sensing-With-the-Microbit-and-Sonar-HC-SR/

The same principle is used to calculate the water depth in the oceans. A transducer sends a sound pulse down into the water and picks up the reflected sound. The time it takes for the sound pulse to reach the bottom and return is measured precisely and the depth of the ocean is calculated by knowing how fast sound travels in the water (approximately 1,500meters per second).

https://www.microsoft.com/en-us/education/oceans/lessons/measuring-ocean-depth

The advantage of this approach is that it enabled me to carry it out with all my students in the classes I teach, (220 students approximately) and it fitted in with the curriculum of the relevant subjects e.g. physics and computer science. It improved the students’ knowledge of the relevant concepts in physics and biology. Morevoer, they applied concepts of programming they had already been taught, such as selection structure, variables and repetition. All the students in my classes actively took part in this project during the lesson in our weekly programme. However, because it is an hourly lesson per week, we did not make any prototype, for example a model of the ship or the ocean. Only the electric circuit and the code were made. Two electric circuits were made by the 12 students that I have in my class every time, because I only have two micro:bits.

The students had hands-on, active experience throughout this instruction. They carried out their own experiment while working in groups, using participatory techniques. The students researched the relevant information, and finally, the students of A class (approximately 78 students) communicated what they had learnt by making a relevant report, practising in that way their word processing skills.

All students from A class worked on this report and enhanced their word processing skills but finally 28 contributed more and finalized the report. Four students from B class and one from C class contributed to this report.

Therefore, apart from the scientific and technical knowledge they got, all the students cultivated soft skills of communication, teamwork and problem solving, which are essential for the 21st century.

Vasiliki Servou

This entry was posted in 2019, Event, Learning, Teaching by vasilikiservou. Bookmark the permalink.