Sound sensor

Is there any documentation regarding expected range of values? I am planning a series of exercises for a Raspberry Pi workshop. I am planning on using the GrovePi+ and sensors and output devices to teach some programming topics. One of the activities I am planning is to use the sound sensor and LEDs to create lights that flash to music. I am having difficulty getting usable values out of the sound sensor. Sampling the sensor in a fairly quiet room shows values around 240. When I turn on music on my iPhone a place the speaker next to the sound sensor, the values barely change at all.

Any advice on what values I should be seeing and if the sensor is not working?

Hi Rsmith,

The sound sensor for the GrovePi+ is an analog noise sensor. You can find some more technical details on it here: http://www.seeedstudio.com/wiki/Grove_-_Sound_Sensor

In general, you should see results between 1024 and 0. You may find that high pitch sounds aren’t picked up by the mic as much as lower sounds or low frequency vibrations.

I have been tinkering with the sound sensor for the past two days. The values are as John mentioned, between 0 and 1024. However I do find some anomalies or maybe I am missing something but range of values on continuous monitoring sometimes change from two digits to three digits - like a sudden jump from say 89 to 221 and then the values continue to generate in the 200-300 range. Again, when I remove the sensor and replace, they move back to the 0-100 range. Sometimes the starting range is in 200-300 and later slips to the double digits.

As a part of testing, I made a curio toy for my three year old daughter to scream from time to time so that a greater than a threshold of 400 will trigger a beeping buzzer. I noted that when she screamed, the values were in steady 200-300 range and suddenly went to 800. Thereafter, the values kept in the 700-800 range for a few minutes before counting down back to ambient (200-300) levels.

I am not sure how to interpret these different ranges and the gradual countdown of values.

Hi reunny, the values you’re seeing may all have to do with the microphone and the design of it. Since it’s such a crude mic, it may not be detecting certain frequencies, and it may hold itself high for a bit of time. If you look at how the sensor is designed, it’s simply an analog sensor reading some values off the microphone. We’ll try to look a little closer at the code we have running on the GrovePi firmware.

A quick question for you: do you have a gain dial on your sensor? Some of the older ones I think had this on it. Or is there no adjustment for your mic sensor?

I get what you meant by gain dial. No this one does not.

Is there another sensor that you can recommend for the project I mention in the original post?

Hey rsmith, since you’re using the Pi B+ or 2 (I assume) have you considered using the microphone jack?

One of the activities I am planning is to use the sound sensor and LEDs to create lights that flash to music. I am having difficulty getting usable values out of the sound sensor. Sampling the sensor in a fairly quiet room shows values around 240. When I turn on music on my iPhone a place the speaker next to the sound sensor, the values barely change at all.

Since it has a full blown audio recorder on it (as opposed to a single channel a/d on the GrovePi) you might be able to do a more interesting project with it, possibly even using voice.

Can you tell us more about your project? Are you developing it for a school or in conjunction with something else? What programming language are you working with?

I am developing a curriculum for a 1/2 day workshop for elementary school children, probably 8 or 9 years old. I plan to use Scratch and start with general programming concepts and finish with some projects involving controlling physical devices (hence the GrovePi and sensors). I want to have a few choices of projects that can be completed by the students. One idea was flashing LEDs to music.

Cost is an issue, since I will be acquiring 10 sets of everything.

I will look into using the microphone.

This is really cool! Can I put you in touch with Taryn about this? We’re really interested in curriculum development around the GrovePi, she might want to talk to you more about it.

John

Taryn reached out to me today via email. I contacted her a few weeks ago. She has been out on leave.

thanks!

Great to hear. I thought she might be really interested in this since she’s really interested in any curriculums being worked on with the GrovePi. Thanks!