Sound sensor reading increase over time

Hello,

I’ve tried to use the sound sensor on a GrovePi+ but I fear it is faulty, as you can see by those readings over 24 hours:

The test protocol was to read every minute from the sound sensor and log the value (actually an average over 8 values) and draw the graph. The graph represents 24 hours, starting at 9:00 AM.

As you can see, there is probably an issue with the sensor. What can I do to fix the issue?

The source code is available here, for inspection:
logger.py (537 Bytes)

Thanks!
Ben

I’m not exactly sure but something tells me its in your code.
Specifically in the for loop that takes the readings.
Perhaps simplify it and remove the sampling? I can’t try your code because I don’t have a grovepi.

Hope its the code, if not its most likely the firmware or grovepi.py. I highly doubt the hardware broke; not that it is not a possibility. Just highly doubt it.

Hi,

I remove the sampling loop and I get similar results:

The updated script is here:
logger.py (401 Bytes)

Any idea?

@bben.pub,
Can you follow the tutorial here to generate a log and upload the log here. This would help us to find if there is any problem with the firmware or the software.

Also, which image are you using. Is it a Dexter Industries Raspbian for Robots or something else.

Hi @karan,
Thanks for the reply. It’s a base raspbian (not a raspbian for robots). How do I get the tool to generate debugging information?

Thanks,
Ben

@bben.pub,
Can you go to this folder on the Raspbian image. Make complete_test.sh executable and run it:

sudo chmod +x complete_test.sh
sudo ./complete_test.sh

Choose option 5 in there and there should be a log on the desktop by the end of it.

Thanks @karan!

Here is the log:
log.txt (5.8 KB)

I hope this helps. Did you have the chance to reproduce the issue on another GrovePi + sound sensor?

Thanks,
Ben

Hello,
Do you think the sensor could be faulty?

Maybe let it run a little longer. It seemed to level out. Perhaps it just gets a little static when it starts.

@bben.pub: the log looks Ok. Nothing bad in there. Does the sensor respond to loud noises, like does the average increase. Can you post a picture of your setup.

It seems that I am having the same problem as you. Did you ever find a solution?

I had my students make a noise sensor and buzzer program in scratch. When a certain noise level is reached the buzzer goes off then after a few seconds it starts detecting noise again. However we have to keep asjustIng the noise level higher and higher otherwise the buzzer keeps going off. Then if the pi is restarted or the sensor is unplugged and then reinserted the noise level has to be lowered again.

Hi @karan,

Yes, the sensor responds to loud noise (the spikes on the graph above correspond to trucks passing by).
Here is a picture of my setup:

Could it be an issue during the A-D conversion? Is there another analog sensor I should try with? FYI, I’m using the potentiometer and it doesn’t drift.

Best regards,
Ben

@bben.pub,
I think it might just be the sound sensor’s behavior. If the potentiometer doesn;t drift at all, then the AD channels and the GrovePi firmware are fine. I have seen a couple of sensors which require some conditioning time for their readings to stabilize. Do you have another sound sensor by any chance just to check if it has the same behaviour.

I found one to borrow. I’ll post the results in a few days.

Hi,
I did a 24-hour test with another sound sensor.

It’s much better, but still, there is a gradual increase of the base value.

@bben.pub,
It does look like these sensors have a conditioning time after which the values normalize. What project are you using the sensors for and would this work for you.

I’m trying to monitor ambiant sound in an office space. My sensor has a conditioning of 6-12 hours, which is too much for such a project.

@bben.pub,
Can you make a filter to remove the extra values in there. Can you post a log with values for 12-24 hours. I can try to make the filter for it.