A Sound Sensor:
This is a circuit for a Sound Sensor. A crystal microphone provides the sound input to an amplifier, peak detector, and buffer that drives the RCX input. The RCX is configured to think it has a Light sensor on its input. When no sound is present the Light value is around 96, but when loud noises are present, the Light value will drop momentarily to a value proportional the sound. A loud clap near the microphone is usually read as a value below 75. Everything but the microphone is available from Radio Shack, but there is a way around that described below.
If you really want to build it right away, the earphone from a crystal (sometimes spelled Xtal) radio kit works almost as good as a microphone. Radio Shack sells a crystal radio kit for about $7. NOTE: This is NOT the same as the earphone that comes with pocket radios. The photo below shows a typical crystal earphone. They are usually a color that, in less politically correct times, was called flesh. They also usually have a long ear tube that you might want to cut off.
Here are some photos of my finished Sound Sensor. It was made by cutting away all but the sides of two 2x4 blocks and hollowing out the insides of a third. The stack was glued together with liquid plastic cement. A bottom was made with a 2X4 plate but the sensor is shown without the bottom in the lower right. It also uses a new microphone I found in theMouser catalog (25LM025). It seems to be very sensitive and I was able to simplify the circuit design. The mic is held to the front of the stack with double face foam tape.
Here is a Clapper type controller example using only RCX code. The algorithm was taken from a MindStorms member upload called "der Uber-Tank." His member name is OROBORUS and he used flashes of light not sound to control a vehicle. Depending on how many times you clap within 2 seconds it does three different things. The RCX watches the Sound sensor (Light) and whenever the value drops below 91 it counts up. The exact threshold value will depend on how sensitive your circuit is. As soon at the counter hits 1 the other 4 stacks are started. The first will reset the counter in 2.1 seconds. The other three only wait 2 seconds and check the counter value for 2, 3 or 4. Two claps makes the 2-Beep, three is the 3-Beep and four is the 4-Beep. A slightly more complex .PRG version is available for downloadCLAPPER2.PRG. Mobile robots will probably need to listen, move a while, stop and listen again. The motors make a lot of vibration that can be picked up and misinterpreted as clapping.
Just in case you don't know what a Clapper is:
Click Here to Return to the Main Page