Produces highly directional sound from 40kHz ultrasonic transducers. I'm building a device to be used in a musical performance, able to project sound to small portions of the audience, without other people hearing.
This project is dead because I'm not sure that it's safe.
If you recall - I don't blame you if you don't - this speaker works by pumping out a 40kHz square wave, then varying the duty cycle. The human ear would respond to the varying duty cycle. This means that the ultrasonic transducers are continuously emitting full power.
Unfortunately, there have been very few studies on how loud ultrasonic sounds affect people. I'm just not sure about connecting up a 400W power supply and pumping out a continuous, full power 40kHz sound. Because of the directivity of the wave, the volume might even exceed 140dB.
I don't even know how to measure the output.
Finally, we now have a cat. Cats' hearing ranges up to 64kHz, and I woudn't want to frighten or deafen her.
Thanks to everyone who gave me ideas and encouragement while this project was alive!
I chose to use the Arduino Due at a very early stage of this project. Partly I fell into it from curiosity after previously using an Arduino Uno, but there were a few concrete reasons too:
Cheap. Through injudicious application of 12 volts, I've killed two boards already. Blowing up $100 equipment would be stressful, but since the Due can be had for 20AUD (ebay, aliexpress), it's more nuisance than disaster.
Five Dues. Two dead. One in use. Two more ready to go.
Range of peripherals. The Due's SAM3X8E (link to 1459 page pdf datasheet) has peripherals I need and a bunch more that are just convenient.
ADC: To digitize the incoming signal.
PWM: For output of the 40kHz, variable duty cycle signal.
USB: For programming and debugging.
SPI: Desirable for running all kinds of peripherals.
DAC: outputting an audio signal is a useful debug tool.
Timers: useful for generating audio tones.
GPIO: The Due has loads of GPIO pins for reading user input and flashing the odd LED.
And more I won't use for this project: CAN bus, Ethernet, IIC, external RAM, external Flash, SDCard reader/writer.
ARM Architecture. I've been wanting to work with ARM for a while.
Fast enough. The 84MHz system clock allows the duty cycle of the 40kHz PWM signal to be varied in increments of 1/84,000,000's of a second. This allows for 2100 settings of the duty cycle, approximately 11 bits of precision.
Ease of use. The community (arduino.org) is great and vendor tool support (Atmel Studio IDE, Atmel Software Framework) is more than adequate. There's lots of example code, and the ability to program via USB makes it simple to get get started.
Maybe the Due wasn't the best choice for this project, but it's working out pretty well none-the-less.
I'm constantly torn by how "finished" a product I ought to be aiming for. It's very tempting to over polish, but I'm not looking to produce a mass-market device. Instead I should focus on the requirements, then plan how to get there.
Requirements for V1
For March, I want to build a device that
has two, independent channels (not really stereo, as mostly people will only hear one channel at a time).
Each channel ought to have its own volume control
Each channel ought to be output to its own speaker
is reliable enough to support Mitchell's practice and performance sessions without needing tinkering.
is easy to operate so changes can be made on-stage if required
On-off switch on front panel
Easy to twiddle volume knobs controls
Some kind visual indication of current performance, such as a VU meter.two or maybe three devices that work reasonably reliably.
Safely packaged to avoid electrical and physical hazards.
Future Versions
Things I don't need to do
MIDI, Internal Synthesizer.
SDCard for sound files.
Touch screen.
The Plan
Here's the outline of how I want to get from where I am to V1
Prototype single channel on a breadboard
Use bench power supply and power over USB
Build input circuitry, with amplification and voltage protection for the Arduino.
Build single channel output circuitry
incorporate opto isolators
test a 4x4 transducer array, see if an inductor would help
build 5x10 or 7x7 array
Figure out mains power supply
Carefully consider safety aspects
Build it, for real. It should supply 48v, 12v and 5v power.
I made a little amp to help debug the audio input / processing side, based on the application notes section of the LM386 datasheet. It consists of an LM386, a 9v battery, an old 8Ω speaker and a handful of capacitors and resistors. I added a 50kΩ pot for gain control.
This log is a summary of what I've found about directional speakers.
Joe Pompei and The Audio Spotlight®
The modern directional speaker began with Joe Pompei at the MIT Media Lab. Large parts of his 2002 PhD thesis go straight over my head, however there is a lot of good information in there, including a summary of previous research into directional speakers (spoiler: the military did a lot of work with sonar), and a human-readable summary of the math.
Pompei combines two ideas to produce a directional speaker.
First,sound waves are directional if the width of the wavefront is much larger than the wavelength. Middle-C (262-ish Hz) has a wavelength of 1.32m, so if a speaker were, say 10m wide, you might be able to get a directional wavefront from it. Ultrasonics however have much smaller wavelength - about 8mm at 40kHz - so reasonably sized speakers will produce a directional wave front.
Second, ultrasonic sound waves will demodulate in air. The resulting audible sound is much quieter than the ultrasound that generates it.
In March 2011, Elektor Magazine published an article by Kazunori Miura describing a directional speaker built from ultrasonic transducers. It was the inspiration for this project.
Briefly, Miura discovered that using pulse width modulation over a 40kHz square wave carrier produced a better result than several other schemes. He also seems to have pioneered using those 16mm transducers from ultrasonic range finders. The article has lots of useful hints about construction too, including the need to determine the polarity of the transducers (more on this later).
Miura's resulting device looks a lot like a class D amplifier (explanatory video here). The incoming signal modulates a 40kHz wave, which is then pumped through a MOSFET H-bridge to drive an array of ultrasonic transducers. If one were to replace the array of transducers with a low-pass filter and an audio speaker, it would look a lot like the the circuit used in the class D amplifier Wikipedia article.
As far as I can tell the differences between Pompei's and Miura's devices are:
Pompei uses amplitude modulation (AM) while Miura uses pulse width modulation (PWM). AM can use power more efficiently since the power required to produce the ultrasonic wave is (approximately) proportional to the power of the audible signal, while the PWM scheme uses full power all the time. AM also requires more sophisticated processing.
Pompei uses an array of circles of piezo-electric film, about 40mm across (as far as I can tell) while Miura uses 16mm piezo electric transducers. The 16mm transducers are relatively common and simple to mount on a PCB interface with (ie. solder to the terminals). I suspect that using the film is fiddly.
Pompei's device runs at 65kHz, while Miura's runs at 40kHz. 40kHz is audible to dogs, while 65kHz is not. Cats, however, can hear both. Neither frequency seems to have any effect on humans, even at quite high levels, but there hasn't been conclusive research either.
Kazunori Miura is selling kits from his website. They're quite good value considering that they include the transducers, which are a little difficult to get hold of.
A Sidebar about Elektor
If you're into hobbyist electronics you should probably subscribe to Elektor. Every issue has two or three neat ideas that get me thinking. Look in the Jaycar Catalog, page 63 for a discount code.
And Others
SoundLazer is likely a device that Hackaday readers have heard of. The first SoundLazer device was a successfully funded Kickstarter project, with all backers receiving access to schematics and parts lists, however these are not available to non-backers and the company is now focused...
This all came about as a result of conversations with my son.
Mitchell is doing his Bachelor's degree in Music at the University of Western Sydney and this year will be putting on a performance as part of a course named "Sound and Performance: Expanded Practice". The university describes it in this way (bolding added by me):
This unit offers students the opportunity to plan, prepare and perform a substantial artistically and technically challenging performance project as featured artist. Students are required to expand their performance practice by utilising electroacoustic and/or multimedia and/or theatrical elements...
When he is assessed, Mitchell gets credit for his performance and any novel "elements" that he uses, but doesn't get credit for building these elements. In other words, it's not cheating if Dad builds it for him. It would even be fine for Mitchell to just go buy something off-the-shelf.
Mitchell had been interested in highly directional speakers for some time. I'm fascinated by them too: usually an audience has a shared experience of a performance, but directional speakers can give different parts of the audience different experiences.
After a bit of Googling though, I was hooked. I had a lot to learn, it wasn't going to be cheap, but it does seem to be something that I can accomplish.
That was October 2015.
Mitchell's performance is May 2016, but he should have a solid prototype before March in order to allow him to develop his performance.
My name is Aiden, I'm currently a junior in Highschool. I really love this project, and I plan to replicate it, then improve upon the design in any way I can. I do have a few questions though, and I'm not sure if I should ask them here or in a PM. Thank you for documenting this project though, I find the tech fascinating.
I'm the founder of Neverone. I'm very interested by your project and I want to know if I can have your email to purpose you a agreement to make a revolutionary clothes which an ultrasonic speaker technology in.
I'm writing to you asking for help. I'm a member of the physics-show from Aarhus, Denmark, and I have actually build your project myself for educational purposes. The thing is, that I'm not that familiar with programming, and I've never used Atmel Studio before, so when your project won't build in Atmel Studio, the brakes on my project is pretty much pulled. I get the following error when running your scr-code:
------ Build started: Project: GccBoardProject1, Configuration: Debug ARM ------ Build started. Project "GccBoardProject1.cproj" (default targets): Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!=''). Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\VOLSOMMERE VOLSOM\Desktop\DirSpk1-master\DirSpk1-master\GccBoardProject1\GccBoardProject1.cproj" (target "Build" depends on it): Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll". Task "RunCompilerTask" Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all make: *** No rule to make target `src/ASF/common/services/clock/sam3x/sysclk.o', needed by `GccBoardProject1.elf'. Stop. Done executing task "RunCompilerTask" -- FAILED. Done building target "CoreBuild" in project "GccBoardProject1.cproj" -- FAILED. Done building project "GccBoardProject1.cproj" -- FAILED.
Hello Alan,
My name is Aiden, I'm currently a junior in Highschool. I really love this project, and I plan to replicate it, then improve upon the design in any way I can. I do have a few questions though, and I'm not sure if I should ask them here or in a PM. Thank you for documenting this project though, I find the tech fascinating.
Thanks
-Aiden