Detect sound using Mic !!

hi , i want to detect the sound using mic that whenever i speak or clap the led should be on or when i measure the sound intensity its value should change with louder sound. i hv a 2 pin simple mic..
please guide me i dont know where to start..

Voltage level from mic isn't enough to be read by arduino , you need pre-amplifier. Look here for examples:

Hi, you need a microphone with pre-amplifier, ready for use with Arduino is this one: Analog_Sound_Sensor__SKU__DFR0034_-DFRobot

The simplest way to detect sound events like clapping reliable is to add a few hundreds to thousands times the analog value of the mic to a variable. If the result is over a certain threshold, you could trigger something.

void loop() 
  uint32_t value = 0;
  for(uint16_t i=0;i<10000;i++) {
    value += analogRead(0);  // Change 0 to your mic-input
  Serial.print("Sound level = ");
  if(value > 10000UL) {
    Serial.println("Sound detected!");