Sound sensor help?[SOLVED]

Hello I tried both these program with my gopigo sound sensor

and tinkered with the threshold value among other things but the sound sensor only spews out random number or only 0s to music,beeps, long beeps, talking…

Hi @ikhouider,

Can you send us a screenshot of the output that you get with a music on near the sensor. Also to confirm, when you play a music, sound sensor might show values based on the variations in the music which is playing.


First program:

Second program with basically silence although my computer’s fan does make some noise

Second program with music:

Hi @ikhouider,

It looks like you are using port A0 of GoPiGo to read the sound sensor value. In GoPiGo, there in no physical A0 port and it isn’t accessible. If you have connected the sound sensor to Analog port of GoPiGo then you should use sound_sensor=gopigo.analogPort instead of sound_sensor=0 in your program.

If you have tried this and yet not working, send us a picture of your setup with the sensor, along with the output that you get after making above mentioned change.


This program is with music but I dont see a difference with no sound either. Also I just jumped in to sound sensor programming, do I have to ping it or something first

I’m just trying to have the sound sensor listen to a beep and when it gets louder/shriller it says so. Can I do this? Am I on the right track?

Many thanks!

Here’s something weird as well: I had 2 sensors connected the sound sensor and the GPS sensor. when I unplugged the GPS sensor the sound sensor started having 600 as its values and went down to 500 and then 419-423. No music or beeps or shouting could coax it out of this range

Can you please answer quickly I am in a rush :open_mouth: thanks again for everything you do :slight_smile: :smiley:


@Shoban is this post closed? Does everything I write show or is this closed? I’m sorry to bother you if this post is not closed… I’m just in a rush to finish if I can… sorry again…

Hi @ikhouider,

Sorry for the delay,I was away from the forums. It looks like the sensor is connected to serial port. Can you double check the connections and make sure the sensor is connected to Port A1 and then run your code.

Let us know how it goes,


It works now

so sorry to bother you so much @Shoban

Just one final question: will I be able to plug another sensor in the other port by changing the code to adress that port? If yes what could I do.

Thanks so much again

Hi @ikhouider,

Glad that it works for you, thanks a lot for your feedback.
Sound sensor is an analog sensor and it can be used only with the analog port. And there is only one analog port on GoPiGo. Hence it would not be possible to use this sensor on a different port.


This topic was automatically closed after 24 hours. New replies are no longer allowed.