beamforming with a DIY acoustic phased array

1,370 views
Skip to first unread message

Dave

unread,
May 7, 2012, 8:19:10 AM5/7/12
to Hive76 Discussion
I recently decided to try and build a really simple acoustic phased
array to experiment with, and some of you that were at Open House last
week may have noticed me and my gear making annoying sounds. For now
the purpose is just my own education, but the idea is that it's a
linear array of 10 piezo transducers all driven by a microcontroller
to produce a tone or a series of clicks. By introducing carefully
calculated delays in the signal going to each transducer, you can
cause all the individual wavefronts to arrive at the same time
(constructive interference) only in a particular direction or even at
a particular point in space. In other words you can use electric
signals to aim the sound, rather than actually rotating the physical
transducer, and it's better than just having a separate transducer
pointing in each direction you're interested in, as is done commonly
on hobby robots for obstacle avoidance. It can be focused more tightly
than an individual transducer, it's more precise with less hardware
(steer to dozens or hundreds of different azimuth angles using only a
few transducers), and you get to use the power of all the transducers
in one direction so it's louder, extending your range.

This concept applies to receiving as well as transmitting, radio as
well as sound, and 3D as well as 2D. This is the basic idea behind
medical and industrial ultrasound, radar on big navy ships, sonar on
submarines and other high-end ships, etc. Why hasn't anybody in the
hobby world done anything with beamforming and phased arrays yet? It
can be computationally taxing but we're at a point now where we have
the hardware and the know-how available to us for cheap.

So far my implementation is super crude, but it does work. I can pick
any arbitrary azimuth angle, and my series of annoying clicks gets
much more annoying in the target direction. ;) Everybody else can
still hear it easily for now, unfortunately, but it is much louder in
the direction I've steered it to. The effect diminishes as you get
past perhaps about 60 degrees or so away from the front of the array,
just due to the inherent directionality of the transducers themselves.

My transducers cost $0.65 a piece for 10, and the only other thing in
my circuit is an Arduino Pro Mini I had laying around. No other amps,
filters, nothing. Using additional hardware could really open up some
possibilities, but this was the absolute minimal implementation I
could think up that would still work. The Arduino could do a little
more, like maybe switch over to ultrasound (with different
transducers), add a mic for some basic direction finding or ranging,
etc. Moving to a DSP or an FPGA, I think you could make some really
awesome stuff without that much difficulty. Hell, I don't imagine it
would be THAT hard to make a very crude ultrasound machine that let
you image stuff inside your body. You wouldn't want to diagnose
anything by it, but still, how kick-ass would that be, even in the
crudest form?

Spencer Russell

unread,
May 7, 2012, 9:20:07 AM5/7/12
to hive76-d...@googlegroups.com
Super cool project! Do you have the code up anywhere?

-s
> --
> To post to this group, send email to hive76-d...@googlegroups.com
> To unsubscribe send email to hive76-discuss...@googlegroups.com
> For more awesome goto http://groups.google.com/group/hive76-discussion?hl=en

Sean McBeth

unread,
May 7, 2012, 9:46:50 AM5/7/12
to hive76-d...@googlegroups.com

DIY ultrasound would be awesome.

Dave

unread,
May 7, 2012, 1:16:19 PM5/7/12
to hive76-d...@googlegroups.com
Thanks! No source released yet, but I assure you there's barely anything in it to begin with. I'm using microsecondDelay() (or whatever it is) which isn't the most reliable timing method especially for 4us and under, and right now it doesn't do continuous tones well because for each element it just energizes it (square wave), waits the proper delay based on the element spacing and azimuth angle, and does all the rest of the transducers before going back and de-energizing them all. Super cheesy code right now, nothing to it. I'll probably at least add a pot so you can change the azimuth angle that way instead of having to change a #define and recompile, but that will require using sine, which right now is handled at compile time. Might just do a lookup table.

Ultrasound (of the type that can image internal organs) would be sweet, it would likely not be practical in any useful way without a beefier processor though (DSP, FPGA, maybe creative use of a BeagleBoard or Gumstix). The speed of sound in water is much faster and in medicine they like resolutions on the order of mm, so you have to be up in the MHz to get those kind of results. The probe (transducer array) might be expensive, not sure if there are cheap transducers you could assemble. Underwater longer-distance ranging would be much easier, but admittedly not as cool in some ways. I'd be thrilled just to see a little ground robot with the ability to use ultrasonic ranging to map a room in 2D or 3D using a phased array, it ought to be much more powerful/flexible than traditional ultrasonic ranging arrays.

David Morfin

unread,
May 7, 2012, 2:36:13 PM5/7/12
to hive76-d...@googlegroups.com
Seems pretty cool to me.  I was pretty interested in these things:  http://en.wikipedia.org/wiki/Sound_from_ultrasound  when they started coming out, but I've never actually seen one so I don't know how good they actually sound.  It is pretty neat to be able to beam sound somewhere and not have it be heard elsewhere. Especially for times when you want play tricks on people. ;)

On Mon, May 7, 2012 at 1:16 PM, Dave <dgs...@gmail.com> wrote:
Thanks! No source released yet, but I assure you there's barely anything in it to begin with. I'm using microsecondDelay() (or whatever it is) which isn't the most reliable timing method especially for 4us and under, and right now it doesn't do continuous tones well because for each element it just energizes it (square wave), waits the proper delay based on the element spacing and azimuth angle, and does all the rest of the transducers before going back and de-energizing them all. Super cheesy code right now, nothing to it. I'll probably at least add a pot so you can change the azimuth angle that way instead of having to change a #define and recompile, but that will require using sine, which right now is handled at compile time. Might just do a lookup table.

Ultrasound (of the type that can image internal organs) would be sweet, it would likely not be practical in any useful way without a beefier processor though (DSP, FPGA, maybe creative use of a BeagleBoard or Gumstix). The speed of sound in water is much faster and in medicine they like resolutions on the order of mm, so you have to be up in the MHz to get those kind of results. The probe (transducer array) might be expensive, not sure if there are cheap transducers you could assemble. Underwater longer-distance ranging would be much easier, but admittedly not as cool in some ways. I'd be thrilled just to see a little ground robot with the ability to use ultrasonic ranging to map a room in 2D or 3D using a phased array, it ought to be much more powerful/flexible than traditional ultrasonic ranging arrays.

Jack Zylkin

unread,
May 7, 2012, 3:24:50 PM5/7/12
to hive76-d...@googlegroups.com
Yes, I have been interested in those sound guns too.  I feel like there are probably some cool applications no one is thinking about (other than crowd control and advertising).
--
Jack Zylkin
usbtypewriter.com
Philadelphia, PA

PJ Santoro

unread,
May 7, 2012, 3:28:23 PM5/7/12
to hive76-d...@googlegroups.com

Whoa! Directional sound in a haunted house would be fantastic! "Did you hear that whisper?" "No...." "I swear I heard something whisper in my ear!" "Well, you must be hearing things because I'm standing next to you, and didn't hear a thing."
:D

sent by telephone

Jack Zylkin

unread,
May 7, 2012, 3:51:50 PM5/7/12
to hive76-d...@googlegroups.com
each whisper could be that persons name. 
 
"jaaaaack....jaaaaaaaaack"
 
ooh I just got goosebumps.

Dave

unread,
May 7, 2012, 3:57:51 PM5/7/12
to hive76-d...@googlegroups.com
Actually one of the ideas that crossed my mind is something like, or even attached to, the creepy clown painting that follows you. OpenCV finds the person, and the directional sound system beams creepy audio at them.

My super cheesy array is still very audible even when you're off the axis of the beam. I think I know some ways to fix that but several of them would require better hardware.

Daniel Provenzano

unread,
May 7, 2012, 4:35:22 PM5/7/12
to hive76-d...@googlegroups.com
Whoa, very cool man. I'm definitely interested in watching the evolution of this project.
 
As far as the "clicks" - are they actually just single burst like a single wavefront or is it a chirp at a certain frequency? I'm not at all familiar with these devices  so I may just be talking out my ass, but I wonder at the use of having different transducers chirp at different frequencies - perhaps ones that are distantly harmonically related so their peaks would all combine constructively at some desired distance away so you could have a point of concentrated acoustic energy.

Now that I think of it I think there's some technology like that used in radiation therapy - whereas instead of acoustic waves it's EM radiation whose energy gets concentrated at one point via constructive interference of multiple beams. That way you can avoid dumping a really powerful single beam through a whole bunch of tissue to get to an embedded tumor. (This is from something I read many years ago and I may be quite rusty on it).
 
tl;dr Neat!

Dave

unread,
May 7, 2012, 7:19:01 PM5/7/12
to hive76-d...@googlegroups.com
> Whoa, very cool man. I'm definitely interested in watching the evolution of this project.

Don't get your hopes up too high, I'm no expert and I was unable to find a half hour to work on this all weekend!

> As far as the "clicks" - are they actually just single burst like a single wavefront or is it a chirp

I haven't yet recorded one to see it, but my transducers have a resonant frequency around 3.3kHz. So if I drive it with a square wave (5v / 0v / 5v...) at that frequency it will emit a whine. When you apply a voltage to it it acts like a capacitor: charging it up causes it to deform, producing a sound much the same way a speaker would if you energized it. The piezo requires no power to hold that deflected position once charged up so there's no risk of blowing the piezo if you just leave it high (don't try this with a speaker!), no current will flow. You can then discharge it to produce the tail end of the wave, completing a full cycle. The transducer will have some amount of ring to it at its resonant frequency after you stop driving it. Think of it like pushing a swing: one push will get it going at its resonant frequency, and you can theoretically push it back and forth at any rate you want, but anything far from the resonant freq will be lots more work.

> at a certain frequency? I'm not at all familiar with these devices so I may just be talking out my ass, but I wonder at the use of having different transducers chirp at different frequencies - perhaps ones that are distantly harmonically related so their peaks would all combine constructively at some desired distance away so you could have a point of concentrated acoustic energy.

With a phased array you can time the element phase delays such that all the signals hit the same point at once, you basically just use a parabolic phase delay map, focusing it like a sound lens. This only works in the near field, I doubt it's possible to do something like this in the far field. Your transducers have to 'surround' the target to some degree so the waves aren't all parallel. My current code just assumes far field with parallel wavefronts: delay = element spacing * sin(azimuth angle) / speed of sound.

Dunno what I'll have time for, but it's sure fun thinking about the possibilities. Here's one for a cheeseball ultrasound system: you have an array of receivers (let's say 4x4, very crude), pressed against the skin. In the center just have a rubberband that you pull back and snap. That sends a single wavefront into the body in all directions, and you capture a couple of ms of signal from each receiving element. Now in software after the fact you can go through, 'listening' in each direction (azimuth and elevation), maybe even sweep through different focus distances. You can do all the heavy (but dead simple) processing on a PC or Gumstix or whatever. Might be cool. Albeit slightly painful. ;)

pezman

unread,
May 9, 2012, 11:12:23 AM5/9/12
to Hive76 Discussion
Pretty cool

For your idea on directional sound, I think that if you amplitude
modulate an ultrasonic carrier, it is audible (and highly
steerable).

Dave

unread,
May 9, 2012, 5:46:53 PM5/9/12
to hive76-d...@googlegroups.com
Holy hellpants. A fire extinguisher just blew up in my basement and the whole place looks like a sandstorm just went through. I wasn't around for the "BANG" but I'm told it was pretty spectacular. Looks like I won't be bringing the phased array to Hive tonight. :( Maybe I can catch MMMM on Monday.

I've partially implemented a couple of things but haven't had time to tie them together yet: a new lookup table will make quick work of converting an ADC reading from a pot into an element delay. I wired it differently so I can use all 10 elements. Minor tweaks but they'll help improve it. I have some ideas about how to make it quieter in the off-beam directions, we'll see how they go. I also have an SPL meter so I can try and quantify the effect at least a bit.

The directional sound thing is fun but for me the interest is more in phased arrays. After all there are other ways to do directional sound (parabolic reflectors etc), but it's the phased array that brings the flexibility of electrically steering the beam on the receive or the transmit side, etc. I'm interested in learning more about the practical side of beamforming, and maybe eventually trying to do something cool with it like make a 3D ultrasonic ranging sensor (either for air or water) or demonstrate some level of seeing inside solid objects. Somebody in the hobbyist world needs to get on it, there's no reason we can't. If anybody is interested in lending any type of hand, feel free to email me directly.

-Dave

pezman

unread,
May 10, 2012, 12:20:14 AM5/10/12
to Hive76 Discussion
A 3d underwater sonar detector would be popular with fishermen
Reply all
Reply to author
Forward
0 new messages