Clap controlled relay

Okay so what i built was a nice small relay system it blinks a standard lightbulb. but what i want to do is make this relay sound activated like the clapper.. clap your hand's and the relay turns on. i have the circuit built for the relay i don't have the microphone added yet but i need some help developing the code for this. The relay is on pin 3. If anyone could help me id greatly appreciate it.

i don't have the microphone added yet but i need some help developing the code for this

The code is realtively simple - harder will be adding an amplifier to the microphone.

Have a search around the forum - there are plenty of posts about adding microphones and amplifiers.

For adding a microphone look at this circuit:-
http://interface.khm.de/index.php/labor/experimente/arduino-realtime-audio-processing/