Back to

Audio sensor

Hi, I’ve installed my SCK (indoor at this moment, #139, first in Valencia zone, yay!) and the audio sensor is giving pretty high values. 64dB on a quiet house sounds reasonable? I’ve seen other values and many of them are 50db that is indeed still high, at least for the table that wikipedia Spanish article about Decibel[1].

Am I wrong? Any Idea?



in you can read: “Los dB estan limitando a 50dB de minimo, y por arriba estan calibrados con una función aproximada. Es complicado calibrar bien el sonido. Es una de las cosas que se han de mejorar. Esto es debido a que durante la carga se genera un poco de ruido en la electronica y el circuito de sonido es tan sensible que nos hace imposible medir dB por debajo de 50.”

Thanks @dscarlat, it’s a pity but apparently that sensor is pretty useless then.

As I am not too familiar with spanish language maybe i did not get the full content. Living on a street with a lot of traffic (where the local council is not interested to measure this) traffic noise was one of the main reasons to get the smartcitizen kit.

I had to realize, its an analogue noise volt converter. Even if it is not going below 50dB and there is maybe a need to calibrate (there is an iPad app for measuring sound levels with a good quality) the main issue seems to be the measurement frequency. It does not help to go down from 1 minute to 20 or 30 seconds (which seems to be the maximum possible).

In general we need to consider having different update frequencies (e.g. if temperature changes are very low once an hour is accurate). Even better a new measurement is only sent when there is a change of maybe 5% or 0,5K in temperature.

Coming to noise. Every few milliseconds a measurement has to be done with the actual hardware. Here is an interesting link from adafruit.

Then it will be aggregated for every minute and sent to the server. For this the existing good infrastucture can be used.

Hi all,

I’ve got the 1.1 version of the SCK and am wondering where in the code I can increase the frequency of measuring the noise. I am also trying to figure out what the smallest interval is with what I can measure noise, as when cars drive by 1 minute readings just don’t capture this properly.

Hi Sander,
I tried and mine (1.1) is at 30 seconds now. But thats not good enough. We cant produce data every few seconds - which nearly for sure - still would not be enough.
We need a subroutine measuring every few milliseconds and aggregate the data according to the dB(A) rules (avg, sum, max, whatever).
Also there could be a need to exchange the actual sensor going below 50dB.
Lets see what can be done and who will do it. The final steps have to be done in Barcelona. Hopefully in the meantime i can play around with a separate arduino and a small setup.

We should also bring up the question if this is necessary for other sensors. Eg there is no need for temperature as this is changing very slow. In general an aggregation is always better.

I am also using the 1.1 version.

I only found the serial commands thus far. It says you can change it via the command:
‘set time update XXX\r’ however it doesn’t mention if this in ms or seconds.

I agree that measuring every 30 seconds isn’t good enough. Aggregation for the sound sensor sounds like a good idea. When a car travels in front of my house it takes aprox 2-4 seconds to pass. So capturing this would definitely require a shorter interval. Probably a minimum of every second.

A custom setup might be required. Do you have any advice on a good sound sensor?

Today I have used, in parallel to the smartcitizen kit, a noise measuring tool. Now I analyzed two hours. 10 m away from the street, in a height of 8m (on the roof of the house) the max was 87,7 dB(A). Smartcitizen delivered a max of 73 dB. My lowest was 53 dB (I had expected to have some values below 50 dB) whilst smartcitizen has 25 x 50dB.
(The calculated average is very similar between the two tools (but the calculation is wrong as I have dB(A) is a logarithmic value).
The setting of the tool was a to measure every second the average value.

I made a screenshot but unfortunately I cannot add a file here in the forum.

Now I configured the noise tool setting to deliver the max value every minute (it makes more sense than the average as every loud value disturbes most on traffic noise etc). This 1 minute max value but measuring nearly every second is what we should consider for the smartcitizen toolkit.

To get the - what I suppose - right values is mainly a software change. I am not sure if the actual sensor can be used but it can be a cheap microphone sensor.

If someone needs my measuring tool (especially the fablab in Barcelona) we will find an arrangement. Also I would like to post the screenshots somewhere, to show that improvements are necessary. When I find some time in the next weeks I will try myself with arduino hardware, too.

Hi Klausz and Sander,
How did you manage to change the interval of the noise meter?
I’m looking at the firmware source code (0.8.6 for kit 1.1) but i can’t find the ‘set time update XXX\r’ line… What file is it in? And, since it has been a while since this post, have you managed to get it to measure every second or something close to that?

Hi ArnoudT,

The command was found in the following github file:

My kit didn’t transmit the data anymore when I changed the timing setting. I had a session yesterday with Alexander from the Barcelona FabLab and he will help me to change the timing for the sound measurement.

Currently the no and co2 sensors require some time (50 seconds was mentioned) before a new measurement can be done. As all measurements are currently being taken serially bringing down the measurements below 1 minute would corrupt this. So work in progress!

I heard yesterday that they are looking into better sensors and to extend the current board via the i2c channel. Let’s see how that works out as well.

Hi Sander, thanks for the information! I wasn’t able to go to the meeting yesterday (at de Waag right?) but it’s good to know that you were there! Regarding the ‘timing’ of the measurements, if understand correctly it is not possible to adjust the ‘sample frequency’ for only 1 sensor (audio in my case)? that is too bad, hope to get info on the i2c thing you are talking about…

As I am actually concentrating on noise I managed to bring the measurement frequency down to every two seconds. For a few hours the data was even uploaded. On the uploaded data, every minute there was a break for around 8-10 seconds.

Without uploading, the arduino IDE/terminal view worked inside a room for more than one day.

Having good sound measurements on streets etc and also to improve the quality we should measure every 1-2 seconds.

But it does not make sense to upload all this data. It seems to be best for now to measure every 2 seconds, aggregate the data (avg or max values on all sensors) and upload just one value for each sensor every 1-3 minutes. We could change the data model and transfer a min, a max and an average record. Two additional fields would make sense. Aggregation type (min, max, avg) and another field with the amount of raw measurements. As we know how these values were built this is most transparent and avoids misunderstadings when comparing values.
In short term more easy, we keep the data model, build aggregates on arduino and upload this data. For each sensor we should decide whats best (min, max or avg).
Raw data is still possible (setting raw, each measured value is uploaded).

There is the comment from sander: ‘Currently the no and co2 sensors require some time (50 seconds was mentioned) before a new measurement can be done.’ I arduino stuck for 50 seconds when getting this values ?

So the question, would it make sense to aggregate the data ? Further, will we have good no and co2 values when we measure every 2 seconds and build aggregates ?

Having a few other noise measuring tools (there is even a relatively accurate iPad app (noise, using pegel graph)) i could do it. But we should have a general agreement from the system architects if this makes sense. If yes, we need an agreement/direction how to change the code. I can make some changes but general rules on calling subroutines, how to aggregate and on the data model should be done before.

+1 for klausz and his idea/request to measure noise more often.

sent a ping to @alexposada to check this thread, he has been deeply involved in the development of our audio sensor and firmware. Also sending now to @mdeheras

Also take in consideration that the current processor might have limitations (from my ignorance) but lets check if this can be done via firmware



Greetings all, I am looking at the 2.1 kit and asking this same question. Can we set the interval time for the sound sensor to less than 60 seconds?

If I do not hear from anyone here, I will post information just the same. Perhaps starting with the link above, but located in the new code branch.

1 Like