Using Sonar To Measure Traffic Speeds

One of the most common ways of measuring the speed of a vehicle is by using radar, which typically involves generating radio waves, directing them at a moving vehicle, and measuring the various ways that they return to the device. This is a tried-and-true method, but can be expensive and technically complex. [GeeDub] wanted an easier way of measuring vehicles passing by his home, so he switched to using sonar instead to measure speeds based on the sounds the cars generate themselves.

The method he is using is similar to passive sonar in submarines, which can locate objects underwater based on the sounds they produce. After a false start attempting to measure Doppler shift, he switched to time correlation using two microphones, essentially using stereo audio input to detect subtle differences in arrival times of various sounds to detect the positions of passing vehicles. Doing this fast enough and extrapolating the data gathered, speed information can be calculated. For the data gathering and calculation, [GeeDub] is using a Raspberry Pi to help keep costs down, and some further configuration of the microphones and their power supplies were also needed to ensure quality audio was gathered.

With the system in place in a window, it detected around 9,000 vehicles over a three-day period. The software generates a normal distribution of vehicle speeds for this time, with the distribution centered on around 35 MPH, slightly above the posted speed limit of 30. As long as there’s a clear line of sight to the road using this system it’s just as effective as some other passive systems we’ve seen to measure vehicle speed. Of course, active speed measurement systems are not out of the realm of possibility if you’re willing to spend a little more.

Bend It Like (Sonar) Beacon With A Phased Array

Ultrasonic transducers are incredible, with them you can detect distances, as well as levitate and peer through objects. They can emit and receive ultrasonic soundwaves (typically above 18khz) and just like all waves, they can be steered via a phased array. [Bitluni] was trying to accurately measure distances but found the large field of view of the sensor was just too imprecise, so he made a phased array of transducers.

The inspiration came from a Hackaday Supercon talk from 2019 about phased arrays. [Bitluni] walks through an excellent explanation of how the array works with a bucket of water and his finger, as well as a separate simulation. By changing the phase offset of the different array members, the beam can effectively be steered as interference muffs the undesired waves. Using a set of solenoids, he created a test bench to validate his idea in a medium he could see; water. The solenoids fire a single pulse into the water creating a wave. You can see the wave move in the correct direction in the water, which validates the concept. A simple PCB sent off to a fab house with a stencil offers a surface to solder the transducers and drivers onto. An ESP32 drives the 8 PWM signals that go to the transmitters and reads in the single receiver via a small amplifier. Still not content to let the idea be unproven, he sets up the receiver on his CNC gantry and plots the signal strength at different points, yielding beautiful “heat maps.”
bitluni's heatmap for his sonar array

It sweeps a 60-degree field in front of it at around 1-3 frames per second. As you might imagine, turning sound wave reflections into distance fields is a somewhat noisy affair. He projects the sonar display on top of what we can see in the camera and it is fun to see the blobs line up in the correct spot.

We noticed he built quite a few boards, perhaps in the future, he will scale it up like this 100 transducer array? Video after the break.

Continue reading “Bend It Like (Sonar) Beacon With A Phased Array”

Ultrasonic Sonar Detects Hidden Objects

While early scientists and inventors famously underestimated the value of radar, through the lens of history we can see how useful it became. Even though radar uses electromagnetic waves to detect objects, the same principle has been used with other propagating waves, most often sound waves. While a well-known use of this is sonar, ultrasonic sensors can also be put to use to make a radar-like system.

This ultrasonic radar project is from [mircemk] who uses a small ultrasonic distance sensor attached to a rotating platform. A motor rotates it around a 180-degree field-of-view and an Arduino takes and records measurements during its trip. It interfaces with an application running on a computer which shows the data in real-time and maps out the location of all of the objects around the sensor. With some upgrades to the code, [mircemk] is also able to extrapolate objects hidden behind other objects as well.

While the ultrasonic sensor used in this project has a range of about a meter, there’s no reason that this principle couldn’t be used for other range-finding devices to extend its working distance. The project is similar to others we’ve seen occasionally before, but the upgrade to the software to allow it to “see” around solid objects is an equally solid upgrade.

Sonar In Your Hand

Sonar measures distance by emitting a sound and clocking how long it takes the sound to travel. This works in any medium capable of transmitting sound such as water, air, or in the case of FingerPing, flesh and bone. FingerPing is a project at Georgia Tech headed by [Cheng Zhang] which measures hand position by sending soundwaves through the thumb and measuring the time on four different receivers. These readings tell which bones the sound travels through and allow the device to figure out where the thumb is touching. Hand positions like this include American Sign Language one through ten.

From the perspective of discreetly one through ten on a mobile device, this opens up a lot of possibilities for computer input while remaining pretty unobtrusive. We see prototypes which are more capable of reading gestures but also draw attention if you wear them on a bus. It is a classic trade-off between convenience and function but this type of reading is unique and could combine with other bio signals for finer results.

Continue reading “Sonar In Your Hand”

Octosonar Is 8X Better Than Monosonar

The HC-SR04 sonar modules are available for a mere pittance and, with some coaxing, can do a pretty decent job of helping your robot measure the distance to the nearest wall. But when sellers on eBay are shipping these things in ten-packs, why would you stop at mounting just one or two on your ‘bot? Octosonar is a hardware and Arduino software library that’ll get you up and running with up to eight sonar sensors in short order.

Octosonar uses an I2C multiplexer to send the “start” trigger pulses, and an eight-way OR gate to return the “echo” signal back to the host microcontroller. The software library then sends the I2C command to select and trigger a sonar module, and a couple of interrupt routines watch the “echo” line to figure out the time of flight, and thus the distance.

Having two sonars on each side of a rectangular robot allows it move parallel to a wall in a straightforward fashion: steer toward or away from the wall until they match. Watch the video below for a demo of this very simple setup. (But also note where the robot’s 45-degree blind spot is: bump-bump-bump!)

Continue reading “Octosonar Is 8X Better Than Monosonar”

This Bike Sonar Is Off The Chain

On paper, bicycling is an excellent form of transportation. Not only are there some obvious health benefits, the impact on the environment is much less than anything not directly powered by a human. But let’s face it: riding a bike can be quite scary in practice, especially along the same roads as cars and trucks. It’s hard to analyze the possible threats looming behind you without a pair of eyes in the back of your head.

radar-sweep-display[Claire Chen] and [Mark Zhao] have come up with the next best thing—bike sonar. It’s a two-part system that takes information from an ultrasonic rangefinder and uses it to create sound-localized pings in a rider’s ears. The rangefinder is attached to a servo mounted on the seat post. It sweeps back and forth to detect objects within 4 meters, and this information is displayed radar-sweep-style graphic on a TFT screen via a PIC32.

Though the graphic display looks awesome, it’s slow feedback and a bit dangerous to have to look down all the time — the audio feedback is by far the most useful. The bike-side circuits sends angle and distance data over 2.4GHz to another PIC mounted on a helmet. This PIC uses sound localization to create a ping noise that matches the distance and location of whatever is on your tail. The ping volume is relative to the distance of the object, and you just plug headphones into the audio jack to hear them. Bunny-hop your way past the break to check it out.

Continue reading “This Bike Sonar Is Off The Chain”

El Cheapo Phased-Array Sonar

Sonar is a great sensor to add to any small-scale robot project. And for a couple bucks, the ubiquitous HC-SR04 modules make it easy to do. If you’ve ever used these simple sonar units, though, you’ve doubtless noticed that you get back one piece of information only — the range to the closest object that the speaker is pointing at. It doesn’t have to be that way. [Graham Chow] built a simple phased-array using two SR04 modules, and it looks like he’s getting decent results.

PB211200The hack starts out by pulling off the microcontroller and driving the board directly, a hack inspired by [Emil]’s work on reverse engineering the SR04s. Once [Graham] can control the sonar pings and read the results back, the fun begins.

[Graham] uses TI’s Cortex M4F LaunchPad eval kit to generate a ping and receive the reflections. With normal sonar, the time between the ping being sent and its reception is determined by the range to the target. In a phased array, in this case just the two modules, the difference in the times it takes for the ping to return to each module is used to determine the angle to the target.

phased_array_sonar_tableau

If you’re DSP-savvy, [Graham] is using a phase-shifted square wave signal so that the correlations of the sent and returned signals have better peaks. This also helps the peaks in correlation across the two SR04s in the array. We think it’s pretty awesome that [Graham] is resolving a couple of degrees in angular separation when he moved his wine bottle. With a couple more SR04 units, [Graham] could start to get height information back as well.

For not much scratch, [Graham] has himself an experimental setup that lets him play with some pretty heavy signal processing. We’re impressed, and can’t wait to see what’s next. Special thanks to [Graham] for posting up the code.

And thanks [João] for the tip!