Pages: [1]   Go Down
Author Topic: Microphone Speaker Module  (Read 490 times)
0 Members and 1 Guest are viewing this topic.
Cebu City
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Hi im new to arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

Code:
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. smiley
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17262
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would change

if (val > 540 || val < 490)

to

if (val > 540)

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.

Lefty
Logged

Cebu City
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Hi im new to arduino!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the attachment for the schematics of my Mic Module sir lefty, I tried doing what you said but it is still not consistent smiley-sad


* amp.PNG (40.11 KB, 1237x885 - viewed 15 times.)
Logged

California
Offline Offline
Faraday Member
**
Karma: 88
Posts: 3360
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How about printing the values read from the module to see what you are working with in terms of thresholds?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17262
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Lefty
Logged

Pages: [1]   Go Up
Jump to: