I am new to arduino and circut making in general. I want to filter out everything above 100 hrz using a mic then use this sound to trigger an LED. The Idea is to trigger LEDs with only very loud bass. I know I have to go from an mic to a opamp then the the arduino but how can I filter the sound before it get to the PIC?
Also how small can I get these components? Could everything potentially fit into a 1inch by .5 inch container?
If you use the active filter with the op-amp then you can amplify the signal if you need to.
Possibly make it so that the absolute maximum output from the op-amp is 5V then you can use it with the analog-in of the arduino.
Depending on the amplitude of the signal received from the mic you could do something like this:
int micPin = 0; // select the input pin for the mic input
int ledPin = 13; // select the pin for the LED
int micValue = 0; // variable to store the value coming from the mic
void setup()
{
pinMode(ledPin, OUTPUT);
}
void loop()
{
micValue = analogRead(micPin);
// use what ever threshold between 0-1023 you wish to switch the led
if (micValue > 200)
{
digitalWrite(ledPin, HIGH);
}
else
{
digitalWrite(ledPin, LOW);
}
}
I am not sure if the output from your mic will swing around 0 volts.
I think a single supply on the op-amp should work, otherwise you may need to shift voltages or something.