how to access AKU340?
응답
17. 2. 6 오후 1:17

Hello,

we received our XDKs last week. According to the spec ist has an Acoustic noise sensor (AKU340) included.

But how to access it? There are no handles provided in XdkSensorHandle.h or anywhere else.

I only found some GPIO port definitions for it. Is there any usable example providing some data?

Thanks in advanve.

0 (0 투표)
RE: how to access AKU340?
응답
17. 2. 6 오후 6:05 as a reply to Alexander Zich.

Hello Alexander,

welcome to the XDK community.
Unfortunately there is no single interface for the acoustic sensor implemented in the SDK of the XDK yet. But this thread offers a detailed description about how the acoustic sensor can be implemented via the ADC.

I hope, this helps you for the moment.

Please do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 투표)
RE: how to access AKU340?
응답
17. 2. 8 오전 8:59 as a reply to Franjo Stjepandic.

Hello Franjo, thanks for the answer.

I tried the source code you pointed me to, and it reads "some" data. However I couldn't get any useful things out of it.

The value is always very low (~3mV).

Our usecase is that we would like to have some sort of "background noise level detection". I tried putting my headset on the XDK with some music on. Nothing changed on the value.

Only if I really scratch on the surface of the XDK I get values of around 200mV.

I will later look into this issue.

0 (0 투표)
RE: how to access AKU340?
응답
17. 2. 8 오후 3:42 as a reply to Alexander Zich.

Hello Alexander,

I analysed the behaviour of the acoustic sensor more detailed and came to a suitable conclusion. I used a setup with a timer task which accesses the data of the ADC every 2 ms. Additionally I implemented an estimation of the root mean spare value over 50 samples and displayed it in the workbench console. Thus I was able to detect all kind of ambient noise with average voltage peaks of 500-700 mV. Therefore I conclude that it highly depends in which time intervals you access the data of the ADC to receive analysable data.

Further I hope this helps you in your analysis.

Please do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 투표)
RE: how to access AKU340?
응답
17. 2. 9 오전 6:30 as a reply to Franjo Stjepandic.

Hello Franjo,

can you share your example code?

0 (0 투표)
RE: how to access AKU340?
응답
17. 2. 10 오전 11:01 as a reply to Alexander Zich.

Hello Alexander,

I guess you have all example code that is needed to reproduce my result. The only thing you have do is to put the second code snippet in the linked thread in a timer task which runs repeatedly after 2 ms. Note that you can feel free to alter this time.
Please take a look at section 2.4 of the freeRTOS guide to get familiar with timer tasks.

Initializing the ADC can be included in an external function or at the beginning of appInitSystem(). Additionally you have to adapt receiving the sensor values of the ADC to store the measured data in an array of 50 elements and and insert a condition which estimates every 50 samples the root mean square value. Furthermore you can use the following code snippet to estimate the root mean square value.

for(unsigned int i = 0; i < 50; i+=1)
{
    averageVoltage += pow(voltageLevels[i],2);
}

averageVoltage /= 50;
averageVoltage = sqrt(averageVoltage);

The variable voltageLevels is used as the particular array of 50 elements to store the measured data from the ADC and averageVoltage stores the estimated root mean square value.

Pleas tell me if this is helpful.

Please do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 투표)
RE: how to access AKU340?
응답
17. 2. 13 오전 8:18 as a reply to Franjo Stjepandic.

Hello Franjo,

I used your idea of the mean square route to get aggregated some data.

We currently try to meassure data in our offices. We can already see that in an empty meeting room the voltage is lower than in our office. So I think this will be enough for our usecase.

Thanks

  Alex

 

0 (0 투표)
RE: how to access AKU340?
응답
17. 2. 13 오후 5:39 as a reply to Alexander Zich.

Hello Alexander,

I am glad to hear that my hints lead to a sufficient solution for you.

Please do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 투표)