Hi all, this is another mad project. Aim of the project is to transmit laptop audio via ultrasound to few meters and then receive it and demodulate it and playback the audio on a speaker.
Checkout the below video
The interesting part over here is that a low frequency sound wave (Say 1 to 4KHz) is modulated on another high frequency (40KHz) sound wave and the end result cannot be heard by a human and it is still a longitudinal wave. Now this amplitude modulated ultrasonic signal can be transmitted to a few meters and can be received by an ultrasonic receiver device and can be demodulated using a simple diode based envelope detector, the same way we do on an AM receiver.
I thoroughly enjoyed the build, even though I know this is not going to be a useful project as it is, that is why at the top I mentioned "mad project".
Generally these 40KHz transducers are mostly commonly used in distance meter modules and the typical application is that only. I took these transducers from a distance-meter module. So I thought of trying something different from the common application, and that is the reason I did this. Just a weekend time pass. :)
Generally these 40KHz transducers are mostly commonly used in distance meter modules and the typical application is that only. I took these transducers from a distance-meter module. So I thought of trying something different from the common application, and that is the reason I did this. Just a weekend time pass. :)
Transmitter:
I am using arduino pro micro board for the transmitter. It is made over an atmega32U4 MCU which is having hardware USB in it. So I though of using it as a USB sound card kind of device, and I got a very good example code and library build on top of LuFA library. Tweaked the audio out demo a bit and adapted it for my purpose. LuFA is based on avr-gcc and Makefile setup. The board after physical reset will enter into usb bootloader mode for few seconds, immediately need to flash the build binary using avrdude.
When I plug the device, it acts as a usb sound card and throws the 8 bit audio via a PWM pin. I am filtering it using an RC circuit. ALso I am generating a constant 40KHz signal using timer1 output compare. This is the carrier signal for the transmitter. We need to mix the carrier with audio signal from the filtered PWM signal. For this I am using a simple one transistor modulator. After few trial and error, it started working as expected. The emitter is connected to the square wave (40KHz) and the base is coupled to the filtered audio signal. The ultrasonic transmitter is connected at the collector where the amplitude modulated signal is generated.
The modulation needs to be verified by using an oscilloscope to ensure it is happening properly and not there should not be any over-modulation and clipping, for this we need to ensure the input audio is with in the limit, if not then need to adjust the resistors accordingly.
Receiver:
In receiver section, I am using two transistor amplifiers, first stage for modulated carrier amplification and second stage for demodulated audible audio amplification. After first stage of amplification the signal is demodulated using a single diode envelop detector. Of course, the receiver front-end is connected to an ultrasonic receiver of 40KHz. To match the tolerance of the receiver and calibrate the transmitter based on this, we need to connect to an oscilloscope and do a sweep of frequency from 38KHz to 42KHz and find the frequency corresponding to peak amplitude, this will give good range as the receiver is having relatively higher Q-factor, so need to be tuned accurately for best results.
The amplified audio after second stage is connected to a small 5W class D audio amplifier which is connected to the speaker. 5v power bank is used to power the receiver system for this demo.
The audio quality cannot be compared with real audio or not even comparable as well, this is obvious, the carrier is only 40KHz which is too less, apart from that the high q-factor of the receiver makes it heavily tuned and resonate only at tuned frequency (40KHz +- tolerance). In other words, the receiver module is having a very small bandwidth. So effectively we will get a very low frequency audio and will miss all the higher components and apparently it will sound like an old AM medium wave receiver, or even worst than that coz medium wave receiver is at-least having a good/better bandwidth compared to this receiver.
But what ever the sound is, it is clear and audible, this is due to proper modulation, if we do over-modulation or if the transmitter input amplitude is more than expected level, definitely it will ruin the quality and creates a lot of clipping and noise, so the transmitter need to be carefully designed and tested using oscilloscope the see the proper modulation.
Observation:
I am able to transmit the audio from laptop to the wireless-ultrasonic receiver and the quality of audio is not that great as expected, but good enough to hear like an AM radio, by the way there is no noise/clipping which is taken care from the transmitter side.
Further improvements can be done on receiver side, like automatic gain control etc which will maintain sensitivity in different signal strength.
Source code:
Pics:
Source code: (again)
hi! Good your project! Can I get source code by arduino sketch?
ReplyDeleteA great article you have written. I have included some of your work in Why Should You Do Content Writing Courses to Rank Your Blog 1st
ReplyDeleteHave a look at this.
great job! I want to learn transmit and receive part circuit design principle. How to modulate sound to ultrasonic? Where should I start.
ReplyDelete