Playing with Raspberry Pi Pico #3
Hi, today we will talk about the project I want to carry out and, in particular, about the acoustic sensor that I will use.
What I want to create is a system that, using two microphones, allows me to recognize the direction of origin of a sound.
Such a system could have multiple applications, for example, it could be a valuable aid for hearing impaired users.
For example, a person who has hearing problems in one ear, and who is with a group of other people, for example in a class at school or during a meeting between colleagues, will be able to hear the words of his interlocutors but will not be able to distinguish easily the direction of origin of the voice. Our goal is to create a simple system that "indicates" the direction from which the sound is coming.
The sensor KY-037
For this project I will be using an analog microphone. I will use a very cheap and not high quality sensor but that should be sufficient in this job. In fact, we are not very interested in high fidelity, or in the dynamic behavior of the microphone but only in the measurement of the intensity of the sound wave.
The sensor board has 4 pins, in addition to the two reserved for power supply, there is a digital output, which is by default at 0V and switches to Vcc when the intensity of the sound exceeds a certain threshold that can be adjusted with a small trimmer and which can be used as a threshold detector, the fourth pin instead is an analog output and provides an electrical voltage that represents the acoustic signal detected.
What I want to do is have the Raspberry Pi Pico read this voltage and display its values.
I will apply the analog output of the sensor to the ADC0 of my Raspberry Pi Pico and try to evaluate the detected sound intensity.
The KY-037 sensor schematic diagram is shown below.
We can immediately notice that the analog output is not amplified so we cannot expect electrical signals with a wide range of variation. This sensor is, in fact, mostly used as an audio threshold detector, to recognize the exceeding of a certain sound level. If we use the signal from the analog output of this sensor board with our Raspberry Pi Pico, only a small portion of the ADC possible values will actually be used.
It would therefore be better to change the sensor or make a simple op-amp for the microphone that can drive the ADC better.
Unfortunately, time is running out and I will have to do what I can with these sensors
Bye