I am trying to increase the range of inaudible sound that it can produce. I am using ACTone library by the way. The piezo speaker is attached to pin 10 and pin 9. Yeap. That's all. Its pretty a simple circuit.
#include <toneAC.h>
int frequency = 19000;
void playFrequency() {
toneAC(frequency);
}
void setup() {
}
void loop() {
playFrequency();
}
On my phone, I use this app called, Spectrum Analyzer to see whether i can detect the frequency or not.
So, basically, the phone can detect 19kHZ. But I have to put the phone very close to the standard piezo speaker. Otherwise, if I use PKM34EW speaker, I can detect 19kHz from 1 or 2 tables away. But still the range is short.
So, my question is, how do I increase the range of the high frequency easily?
Second question (Not so relevant to this post), is it possible for your mobile phone to pick up sound frequencies beyond 22kHz? At the moment, the current app that I am using, maximum is 22kHz.
Normal consumer audio does not work at 19kHz, almost certainly your phone will struggle to pick up frequencies that high, its at least twice the maximum frequency they are designed to work at.
Looking at the spec for the PKM34EW there is a graph if the response to 20khz which looks OK, but it doesn't show it beyond that range
It does however show the output for a 30V p-p input.
So I'd suggest you need to amplify the voltage going to the device rather than trying to parallel 2 pins at the same time
In fact I'm not sure how you are managing to run it off 2 pins at the same time, this sounds like a recipe for damaging your Arduino.
But all of my attempts does not give a fruitful results. I would say, perhaps I got it wrong. Its just pretty confusing to me ~
So, from what both of you and Larry had said, I would conclude that the current piezo speaker that I am using is not suitable for inaudible frequencies? (on 15kHz, PKM34EW has a pretty good range as compared to the other one).
I used an amplification module. Something as shown in the URL, but could'nt find the exact model of course. LM386 Amplifier Module
I connected pin 10 and 9 of the UNO to the Audio Input of an the LM386 amplification module. The DC Input is connected to the 9V battery. The Audio Output is connected to the PKM34EW piezo speaker + and -. And.. that's it..
So, previously, 19kHz can cover about 1 metre. Now, it can go about 5 - 10 metre. Although the range is not that far, I think it serves the objectives that I need to achieve. As such, if I were to still use the current PKM34EW speaker, I just have to have a better amplification module?