Acoustic sensor (AKU340)
Answer
3/21/16 10:51 AM
Hi my friends,

Somebody could help me to switch on the acoustic noise sensor?
I need AKU340cc.c, and ch.h, and ih.h files.
Unfortunatelly the demo program(Datalogger) is not include this sensor folder...
Thank you for the support.
0 (0 Votes)
Acoustic sensor (AKU340)
Answer
3/21/16 8:22 PM as a reply to Roland Ver.
Hello Roland,

Unfortunately, the acousitc sensor isn't implemented right now.
But our developers are working hard to make it available soon.

Kind regards
Manuel
0 (0 Votes)
Acoustic sensor (AKU340)
Answer
3/29/16 7:36 AM as a reply to Manuel Cerny.
Dear Roland,
there is no SW included in the XDK workbensch yet; however, the sensor is accessible via the ADC. Details can be found in the user guide.

Regards,
Mathias
0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
6/9/16 5:40 AM as a reply to Manuel Cerny.

Hi Manuel,

is there an idea of time (in one, two month or end of year), when the acoustic sensor can be used?

Regards,

Hermann

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
6/9/16 7:05 AM as a reply to Hermann Mehling.

Hi Hermann,

as Mathias already said, the sensor can be used via ADC.
For the XDK-framework implementation we have no release date yet.

But I will keep you posted in this thread, if I know more.

Kind regards,
Manuel

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
7/18/16 6:37 AM as a reply to Manuel Cerny.

Hello,

is there a small tutorial how to read data via ADC from the Acoustic sensor and write the data as a CSV file on the SD-card?

Kind regards

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
10/28/16 3:49 PM as a reply to Oliver Ilnicki.

Hello guys,

I wrote some example code how to access the acoustic sensor via the ADC. You will have to initialize the ADC with the following code lines:

#include "ADC_ih.h"
#include "PTD_portDriver_ih.h"
#include "PTD_portDriver_ph.h"

// Sets the supply voltage for the acoustic sensor
PTD_pinOutSet(PTD_PORT_AKU340_VDD,PTD_PIN_AKU340_VDD);

ADC_node_t data;
ADC_Init_TypeDef init = ADC_INIT_DEFAULT;

data.adcFreq = 7000000;
data.registerBaseAddress = ADC0;
data.cmuClk = cmuClock_ADC0;
data.init = init;

ADC_init(&data);

Including to this an implemention to read the data has to be done. The code below shows how to implement it:

ADC_singleAcq_t result = ADC_SINGLE_ACQ_DEFAULT;

// ADC single sample channel 4
result.adcChannel = adcSingleInpCh4;

result.initSingle.acqTime = adcAcqTime16;

ADC_pollSingleData(&result);

printf("ADC Acoustic Voltage: %lu mV\n\r", (unsigned long) ADC_scaleAdcValue(&result));

In reference to the user guide the input pin for the acoustic sensor should be the pin PD4 and this pin is read by the ADC0 channel 4.

For the implementation of the SDcard, please refer to the SdCardExample and the XdkDataloggerDemo.

Please don't hesitate to ask if you have further questions.

Kind regards,
Franjo

+2 (2 Votes)
RE: Acoustic sensor (AKU340)
Answer
10/28/16 1:13 AM as a reply to Franjo Stjepandic.

Thanks Franjo for the code!

I realised that I also need the following line to turn on the sensor during initialization:

PTD_pinOutSet(PTD_PORT_AKU340_VDD,PTD_PIN_AKU340_VDD);

 

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
10/28/16 3:42 PM as a reply to Danny Lim.

Hello Danny,

welcome to the XDK community.
Yes you are correct to set the supply voltage for the acoustic sensor.
Thanks for sharing your improved implementation. I will add this to the implementation I posted before.

Kind regards,
Franjo

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
11/1/16 10:04 AM as a reply to Franjo Stjepandic.

I wonder if the ADC's sampling rate should follow the Nyquist frequency. For example, if I want to detect all audible sounds I should set the sampling rate to at least 40KHz? (maybe 44.1KHz like CDs?)

I also wonder if increasing the sampling duration (by reducing the ADC clock or increasing adcAcqTime16 to adcAcqTime256) improves the accuracy of the acoustic sensor.

I needed to loop every 10ms or lower to get an accurate reading, otherwise the sensor will be inactive for too long to detect environmental sounds. (It may end up turning on during the gaps between the sounds, for example.)

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
11/2/16 12:28 PM as a reply to Danny Lim.

Hello Danny,

in general you should use a sampling frequency that is two times higher then the highest signal frequency to receive all information from the signal source without any information loss, but sampling frequencies usually are much higher, sometimes even ten to twenty times higher then the signal frequency. 44.1 kHz should be okay to sample all audible sounds. I recommend to use an even higher sampling frequency.

Furthermore an increase of the sampling duration would have the opposite effect, because you are coverting an analog signal into a digital signal. This results in a really low accuracy. To receive a high accuracy you need a very short sampling duration.

Please note that the sampling rate is the inverse of the sampling duration and an other expression for the sampling frequency.

Therefore I suggest to use for your use case a sampling frequency that is much higher then the double signal frequency of the acoustic sensor.

I hope this could help you.

Kind regards,
Franjo

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
2/22/17 9:04 AM as a reply to Franjo Stjepandic.

Hello Franjo,

I've implemented the AKU340 using the code you posted. However I seem to be getting the same readings no matter the conditions eg. construction site, traffic, workshop, office.

How do I make it more sensitive?

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
2/22/17 11:44 PM as a reply to Lee Weiyang.

Hello Lee,

my code example in this thread demonstrates only how to implement a functionality which accesses the acoustic sensor AKU340 via the ADC.

The example code contains no complete implementation for each application.
In other words, I only shows how to access the AKU340 and not how to interpret the data.
A complete implementation would require an additional timer task which measures the ADC data frequently and interprets the single measurements of the AKU340 to usable data like the root mean square value.

Fortunately another user had the same issue some time ago. 
Thus I recommend to take a look at this thread to get familiar with interpreting the AKU340 data.

Please note that this is only one possibility suggested by me.

Please tell me if this is helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
2/23/17 8:45 AM as a reply to Franjo Stjepandic.

Hi Franjo,

 

Thank you for your assistance.

I am now trying to conver the output voltage to db.

Am I correct to assume that input voltage is 2v as per the AKU340 datasheet?

I've also implemented a timer to sample readings every 2ms. However, my readings are still very small, around 3-5mV. And when converted to db, I get around -50 to -60db.

Do you know what is the reference db level?

 

I am using this formula:

db gain = 20 log10(Vout/Vin)

where Vout is the reading from the acoustic sensor.

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
2/23/17 8:22 PM as a reply to Lee Weiyang.

Hello Lee,

I am glad to help.

Furthermore the code I provided works exactly with the kind of timer task you use. Thus it should deliver output voltages as root mean square values in a range up to 700mV.
From my point of view, the input signal is classified as sound pressure and not as an input voltage that you are using to calculate the amplification.

Would you be so kind and tell me why are you referring to 2V as input voltage?

Additionally would you be so kind and tell me the goal of your implementation?

Do you want to calculate the amplification of the sensor itself or the former sound level?

Please tell me if this was helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
2/24/17 1:14 AM as a reply to Franjo Stjepandic.

Hello Franjo,

 

I got the 2V from the AKU340 data sheet which states the input range is 1.8-3.6V.

I am trying to measure the sound level.

Please advise on what is the right way to go about it.

Thanks again for your assistance!

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
2/24/17 8:03 AM as a reply to Lee Weiyang.

Hello Franjo,

 

I did a bit more reading and would like to know if this makes sense.

According to the AKU340 data sheet:

Sensitivity (TYP) = -38dbV/Pa [@ 94db SPL, 1kHz]

That gives a transfer factor of 12.5893mV/Pa.

i.e. 1 Pa or 94db will produce 12.5893mV

Therefore 1mv = 7.705db

Does this make sense?

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
2/24/17 6:35 PM as a reply to Lee Weiyang.

Hello Lee,

I reviewed the data sheet very detailed once again and have to correct myself. I found the corresponding reference value for the sound pressure in the section 12.4. It is 20µPa for 1 kHz.
This reference value for 94 db is equal to a sound pressure level 1 Pa.
I am not quite sure about the results of your mentioned equation to estimate the transfer factor (amplifying factor).
Am I right that you estimated the transfer factor for the sensitivity with 1Pa as reference value? If that is correct, you received the sensitivity between 2 measured values.
Further 1Pa (referring to 94 dB) will not produce 12.5893mV as output, but a much larger value.
To receive results that fits your purpose to estimate the transfer factor for 1mV, I recommend to estimate the correct
output voltage for 1Pa reference sound pressure and then continue with following calculations.

Meanwhile I checked you mentioned voltage range between 1.8-3.6V. This specified ranged describes the variability of the supply voltage of the AKU340. In other words it explains which amount of supply voltage can be used for the acoustic sensor to be fully operational.
Thus you can not use it in any kind to make predictions about the sound pressure level neither the transfer factor of the AKU340.

I hope my explanations are helpful.
Please do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
2/25/17 9:47 AM as a reply to Franjo Stjepandic.

Further 1Pa (referring to 94 dB) will not produce 12.5893mV as output, but a much larger value.

 

How much will 1Pa produce then?

How much dB will produce 1mV?

 

I got my transfer value by calculating and checking it against a couple of online resources.

https://geoffthegreygeek.com/microphone-sensitivity/

Is my trasnfer value wrong?

0 (0 Votes)
RE: Acoustic sensor (AKU340)
Answer
2/27/17 9:01 PM as a reply to Lee Weiyang.

Hello Lee,

I assume we need to clarify the meanings of different parameter since this resulted in a kind of confusion. Following I am going to clarify all of them:

First of all, the sound pressure level (SPL) describes the pressure p of an incoming soundwave in relation to the least hearable soundpressure p0 which is 20 µPa. Further 94dB SPL describe the relation between the sound pressure of 1 Pa and p0.  

The sensitivity of the acoustic sensor is constant and describes the transfer factor measured by 1 Pa input sound pressure. You are correct to assume 12.6 mV output voltage by 1 Pa input sound pressure related to the -38dB V/Pa transfer factor.

Furthermore if you want to estimate environmental sound pressure level, you will have to estimate the input sound pressure first, and then make an estimation of the sound pressure level via p0. Thus the sound pressure level for 12.6 mV is not 7.705 dB, but 71.97 dB.
Keep in mind that the sound pressure level is estimated logarithmic and therefore such an huge value is realistic in relation to your calculation.

Additionally please note that the examinations only rely to the amplitude of the measured sound wave and do not deal with the frequencies within the soundwave.

Please tell me if this was helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 Votes)