But I would like to have it silence activated, the only thing I want it to do is if a Sound Detection Sensor Module don´t get any input for 1 minute a servo motor will be activated. I would like to be able to change the sensitivity of the sound detector and change the time from 1 minute to 2,3,4 minutes in the future.
Is this a easy build with arduino? I have a little experience in building things, working with tools and computers and I have in school studied (very) little bit of programing (C++, java and matlab).
But I would like to have it silence activated, the only thing I want it to do is if a Sound Detection Sensor Module don´t get any input for 1 minute a servo motor will be activated. I would like to be able to change the sensitivity of the sound detector and change the time from 1 minute to 2,3,4 minutes in the future.
Set a Boolean variable true
Loop for a minute (changable) calling a test that reads the Analog value of microphone
If the analog value exceeds your threshold, see Boolean to false
Continue the looping
The timing loop expires and you test the Boolean
If it is true, there was a minute of quiet
If it is false, there were sounds exceeding the threshold
If true, do servo stuff
Start the whole thing over (that is, } in the void loop() { of Arduino code)
added
You may want to read up on Pavlov's Dog. I am not responsible if your dog figures out your little scheme and the floor is covered in dog food XD
Tnx, that sound quite easy and I think I will try to build me one
I have read about Pavlov and his experiments with dogs (he also did the same type of experiments with kids...) but what I am after is more what is called Operant conditioning with Positive reinforcement for my dog to be calm and quiet. He will be reworded for taking it easy when I am not at home. But Pavlov experiments with dogs and kids was about Classical conditioning where a behavior is not strengthened or weakened. So my idea is more about a Skinner box experiment then what Pavlov did
And if my floor if covered with dog food, then the machine is a success, he has been calm and not stressed. Better for the neighbors but more important better for him