Several inventors and companies have designed sonar-enabled canes for visually impaired people. The general idea of these devices is to use a sonar sensor (or multiple sensors) to detect obstacles in the user's path. The distance picked up by the sensors is then conveyed to the user by employing non-visual cues.

<aside> 💡 Show students the YouTube video below describing such a device. Using the robot, students will build a device that does something similar: use one or two sensors to detect obstacles and the robot's speaker to convey this information to a (blindfolded) user. The student guide for this part can be found here.

</aside>

https://www.youtube.com/watch?v=cnW1_XMUIzM

In this activity, the student builds a device that does something similar: use one or two sonar sensors to detect obstacles and use the speaker on the robot to convey this information to a (blindfolded) user. The sonar device should detect obstacles missed by the cane (the user employs their cane to probe for obstacles on the floor while the sonar device looks horizontally for overhanging obstacles).

Untitled

Mounting the robot on the PVC pipe

Students will mount the robot on a 1/2-inch PVC pipe for this activity. They can mount 1 or more sonar sensors anywhere on the PVC pipe. For this, they can use 3D-printed brackets, Lego-compatible blocks, or other materials. Here, we explain how to mount the robot on the PVC pipe using a mounting plate.

Mounting instructions

Example Program

We provide an example program. The program is linked and displayed below.

<aside> ℹ️

The example program below assumes one sonar sensor is being used. However, students can use more than one sensor.

</aside>

sonar_cane - mBlock Community

<aside> 💡

Clicking the link to the program will open the mBlock website. To see the actual program, click Source at the bottom left of the page that opened.

You can use the program in the online version of mBlock or download it to your computer by selecting File and Save to your computer. The downloaded program can then be edited using mBlock if installed on your computer.

See Step 1: Open the example program for an example and more instructions.

</aside>

The program continuously measures the distance recorded by a sonar sensor, applies the correction, and converts the measurement in cm to meters.

Untitled

The distance (variable distance) is then used to set the duration of a beep. Smaller distances result in longer beeps, while higher distances result in shorter beeps. In equation form, the value is b (in seconds) is determined as follows,

$$ \begin{align} b &= 0.49 - 0.4 \times \text{distance} \\ b &= \begin{cases} 0, & \text{if } b < 0 \\ 0.25, & \text{if } b > 0.25 \\ b, & \text{otherwise} \end{cases} \end{align} $$

The relationship between the distance d and the duration of the beep b is visualized in the following plot. The values 0.49 and 0.4 determine the slope of the line for intermediate distances. When the distance is over about 1.2 meters, the duration of the beep is zero, and the robot will not beep at all. For distances below 0.6 meters, the duration of the beep is maximal (0.25 seconds). At these short distances, the motors are also turned on for 0.25 seconds to give the user some vibrational feedback.

image.png

Testing the program