What does IIR and FIR filter are used for in embedded

I would compare the input value to a threshold.

const int Threshold = 200; // Maybe use a knob to adjust this in the field
const byte InputPin = A0;
const byte BuzzerPin = 4;

void setup()
{
  digitlWrite(BuzzerPin, LOW);
  pinMode(BuzerPin, OUTPUT);
}

void loop()
{
  if (analogRead(InputPin) > Threshold)
    digitalWrite(BuzzerPin, HIGH);
  else
    digitalWrite(BuzzerPin, LOW);
}

If the Threshold has to change over time you could use a moving average in place of the fixed Threshold.