Author Options:

How to make a randomly generated sound trigger with motion detection? Answered

I have a project that i want to do that involves a Motion sensor that when it detects motion it plays 1 of {X} sound files. I have no idea what supplies i need so if someone could help that would be great.  Basically im wanting to hide the speaker behind a prop i want to build {possibly made of wood} and have the sensor facing the front so when someone walks by. 




4 years ago

For motion detection look for a simple PIR sensor. They are the same sensors used in many outdoor lamps that have detection.

For playing the sound you have multiple options. the most simple solution is to find a "MP3-Trigger". These triggers are simple a self-contained MP3 player and a Micro-SD slot that can be controlled without much knowledge. I personally liked the MP3-Trigger at sparkfun. You can also use a MP3-player "Shield", but you would have to learn a little bit to work with it code-wise.

Lastly to controll the trigger you would need a microcontroller of sorts. Best one is to use a arduino which one can learn to program pretty quickly and easilly and is the heart of MANY projects such as Halloween Props.

Theory of working is that whenever the PIR sensor gets triggered it sends a signal to the microcontroller. The microcontroller then picks a random number and sends a signal to the Trigger which should then play the appropriate sound

If planning to operate a speaker you may need a "Speaker-amplifier"...or you can just hookup a standard cheap Speaker-set.

So in short:

-Controller of sorts

-PIR sensor

-MP3-Trigger / Shield


4 years ago

PIR sensor + arduino + wave shield are the basic bits you need. Try Adafruit or Cool Components.


4 years ago

1. You need a sound recorder which allows you to find a sound sample by address - Usually this means some king of MP3 player

2. You need a microprocessor - Picaxe, Arduino, Raspberry pi etc to detect the motion detector output, sort out a random address and send that to the MP3 player to play the sound.

3. An audio amplifier, a PIR motion detector.