Hi I made a Microphone Module that when I blow into the mic, it produces a simple tone. Problem is that when I blow into the mic it doesn't consistently makes a proper sound when I blow, it makes spiky or jammed sounds and only makes a proper note when I blow into it hard. How do I avoid getting this output?
Here is my code by the way:
int senseMic = 0;
int speakerPin = 22;
void setup(){
Serial.begin(9600);
}
void loop(){
int val = analogRead(senseMic);
if (val > 540 || val < 490)
tone(speakerPin, freq);
else
noTone(speakerPin);
}
Hope you guys can help me. Thanks. Merry Christmas and a Happy New Year to you guys.
Try that to see if it doesn't work as you would expect. Lower the number if you wish it to be more sensitive to your blowing or raise the number if you wish it to be less sensitive to your blowing.
Without seeing the electrical schematic of your mic circuit and how it wires to the analog input pin it's hard to nail down if your sending the input pin a proper signal or not.
You probably need more gain out of the op-amp circuit. Change the 10k ohm resistor (from pins 1 to 2) to 20K or 30K and see if you don't have to blow less hard to make it work.