Go Down

Topic: Using a microphone with an Arduino (Read 2098 times) previous topic - next topic

bubu1

I am entirely new to the Arduino (but I'm familiar with programming). In order to built a VU meter, I want to put a microphone to the analog 0 pin of the Arduino and display the value via the serial connection.

I googled and found this circuit:

... and I tried to build it with this result:

The values on the serial monitor don't change depending on the music volume.

What is the easiest way to measure the volume on the analog input of the Arduino?

Also, I have a TDA2822M, but I don't know if it is helpful for this project. The caption on the microphone reads XF-18D.
My arduino code:
Code: [Select]
void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println(analogRead(0));
  delay(300);
}

The serial output: 1023 1022 1022 1022 1022 1023 1022 and so on

How can I check if the microphone works at all? Is it directional?

Grumpy_Mike

#1
Nov 04, 2016, 09:21 am Last Edit: Nov 04, 2016, 09:22 am by Grumpy_Mike
You need to put two 10K resistors on the analogue input and put the other end of one to ground and the other to 5V. This will bias the input so your audio can pull the reading each side of 512.

That will allow you to read the audio signal. If you want to read the volume you need to preceded this with an envelope follower circuit.

Go Up