Sonar is a ship device detecting objects in surrounding water. It analyzes sounds that propagates in the water, an active sonar uses the sounds that it produces, a passive one uses the sounds from other sources (e.g. eruptions or sounds of other ships). A wide range of frequencies can be used, from infra-sounds to ultrasounds. A simple, active sonar can be built from a couple of electronic elements and a PC computer - I will present this idea here.
I used a piece of Styrofoam as a ship and a bowl as a water that surrounds the ship. The bottom of the "reservoir" is modeled by a couple of floors tiles.
The circuit contains only a speaker and a microphone + a bunch of elements needed by the microphone. They're connected to the computer: speaker to headphone output, microphone to the microphone input.
The ship with assembled sonar:
Python script was used to generate samples of different frequencies. The sample was played in an endless loop in mplayer. Input was analyzed by using software spectrum analyzer.
Tests and further ideas
I had placed the boat on the water and moved it in random directions. A spectrum of the signal received from the microphone was changing when the ship was above an obstacle. A short range of frequency was boosting, it's because the signal were reflected from the surface of the observed object.
This leads me to another idea: could only a built-in computer speaker and microphone be used to detect if something moves near the computer? This software could be used for example to protect a computer against steal.
I made a series of tests with my laptop. In this model, a microphone is placed on the lid, above the screen. Speakers are near the keyboard, on the left and right sides, also near the screen. I have placed the lid in about 120 degrees from the bottom part of the computer and made the same experiment, but without mentioned in first part sonar.
The results were similar: the spectrum changed each time when I was moving something near the computer (for example a bottle of juice or a metal box).
The results in both of the experiments could be improved a lot by using more complex software.