Sound Sensor

I need to do a project to inhibit the barking of dogs. I need to put a sound sensor in the kennel. When the sensor detects a loud sound, triggering an alarm. The sound sensor that detects bought only the sound that is very close to him and I needed a sensor that captures ambient sound. Can anyone give me an idea?

If you can invent a sensor which "only detects sounds very close" then you will make a lot of money.

Sound sensors don't care how far away the noise is, they only care about the magnitude of the noise at the location they are measuring it.

A small noise nearby is indistinguishable from a large noise a long way away.

If I understand you, I think what you want is noise cancellation. You want to amplify the dog bark but not any ambient noise. I have link to a noise-cancelling headphone project that cancels the ambient noise and passes the music. The basis of the circuit is a differential op-amp.

Take a look here

Noise cancellation has practical limits on the space it will work in. But it can work in rooms and car interiors though I think it's nothing like easy to do well.

I think you could build a small sensor board that would trigger an alarm based simply upon the volume. The false alarm rate would probably be very low given that the ambient noise level in the kennel probably rarely gets to a volume close to that of the dog barking. I do not think you need a noise canceling system given the relative volumes.

You could set up the sound sensor to light an LED and monitor it to see if you have a false alarm problem so as not to confuse the dogs. Running just the LED with the sensor would also be required so you could set the threshold at a level to ignore ambient but trigger on barking. A filter on the sound sensor based on frequency could further reduce the false alarm rate.