This Raspberry Pi-Powered Passive Sonar Turns Two Microphones Into a Speed Monitoring Station

Using low-cost hardware and GNU Radio, this clever project listens to the sound of tires on the road to calculate the speed of a car.

Gareth Halfacree
11 months ago β€’ Sensors

Semi-anonymous electrical engineer Gregory has been working on monitoring passing vehicle speeds without the need for a radar gun β€” turning instead to passive sonar, based on the noise the vehicle makes as it rolls along the road.

"My first approach was to see if I could measure the Doppler shift of the road noise as a vehicle passes by the sensor," Gregory explains of his initial experimentation. "I found out that there is no detectable Doppler shift of the road noise because the primary sources of the noise are not on the vehicle itself, but rather arise from the impact of the tires on the rough surface of the road. Since the noise is coming from the road which is not moving with respect to the listener, there is no Doppler shift."

While active radar and sonar will easily solve the problem, Gregory was hunting for a solution which didn't require the vehicles to be "painted" with a signal β€” and turned to passive sonar, using two microphones spaced at either side of a window and careful calculation of the phase difference between their respectively captured sound waves.

"A basic constraint for this project is to keep the cost of hardware as low as possible, so I chose to leverage a Raspberry Pi [single-board] computer since the Linux operating system supports stereo audio natively and USB sound cards with stereo microphone inputs are low cost," Gregory explains. "Since the speed of sound is about 343m/s at room temperature and sea level, if the microphones are spaced one meter [around 3.28 feet] apart the maximum time delay will be about +/- 3ms. Typical audio sample rates are 44.1 kHz or 48kHz which should be sufficient to capture a time difference of 3 ms."

Using two Adafruit 1063 electric microphone boards with a filtered 5V power supply and shielded cabling, Gregory built two microphones inside foam-lined pipe off-cuts designed to reduce wind noise and protect the electronics from the weather. These were connected to a low-cost USB soundcard driven by a Raspberry Pi 3 Model B with GNU Radio handling the audio sampling, signal processing, and cross-correlation calculations.

Tested on the road outside Gregory's window, the sensor appears to work β€” showing a mean speed of 34.5 miles per hour, somewhat higher than the road's rated 30 miles per hour speed limit. "The measured traffic volume matches well the published traffic volume measurement of the municipal traffic engineers several years ago," Gregory notes β€” while warning of some drawbacks to the low-cost passive sonar approach to speed measurement, including changes in the speed of sound in differing weather conditions, an inability to properly read particularly slow- and fast-moving vehicles, and issues filtering out other environmental noises.

The full write-up is available on Gregory's Hackaday.io page.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles