Can sound sensors have a time-dependant output?

Can a sound sensor be programmed to give an output only if a threshold is met for a specific period of time?

Thanks for any leads!

What type of sound sensor ?
What type of output does it give ?
Can you provide a link ?

The standard Arduino sound sensors available everywhere have a digital output that is high when a (manually set) threshold is exceeded but I don't think I've seen one with built-in timing as well. But it's pretty easy for your program to check how long the output was high for and do whatever you need.

Steve

bdipier:
Can a sound sensor be programmed to give an output only if a threshold is met for a specific period of time?

Yes.

With the caveat that you aren't actually programming the sensor itself, you are programming an arduino.

Let's pretend you had a goldfish in a bowl. Every microsecond, it forgets everything it was doing before unless that thing is specifically written down. There's a clock on the wall. There's a door. You want the goldfish to jump if the door is open for more than a second.

What do you tell the goldfish?

Here's the instructions:

You start by being idle.

Every time you circle the bowl, do the following:

If you are idle, and the door. is open, then make a note of the time on the clock. You are now waiting for the door to remain open. Otherwise, stay idle.

If you are waiting for the door to remain open, and you look over at the door and it's shut, then forget everything - you are idle again.

It you are waiting for the door to remain open, and the door is still open, and five seconds hasn't elapsed from the time you put on your note, then do nothing: you are still waiting for the door to remain open.

It you are waiting for the door to remain open, and the door is still open, and five seconds has elapsed from the time you put on your note, then jump! You are now waiting for the door to close again.

If you are waiting for the door to close again, and you see that the door is open, then do nothing: you are still waiting for the door to close.

If you are waiting for the door to close again, and you see that the door is closed, then you are now idle once more.