Go Down

Topic: Cant read the microphone  (Read 264 times) previous topic - next topic

dsm311

I'm trying to take sound frequencies using a microphone that has to be plugged in using an aux port. I'm pretty much using this as a model

https://www.arduino.cc/en/Tutorial/SimpleAudioFrequencyMeter

but, for some reason i cant receive any input using the mic. The circuit works because it was tested with an oscilloscope and a function generator and it works. The readings can be off at certain frequencies but its mostly good. I'm thinking that the mic might need either a preamp before connecting to the circuit but I'm not entirely sure.

DVDdoug

#1
Apr 11, 2019, 09:51 pm Last Edit: Apr 11, 2019, 10:13 pm by DVDdoug
Quote
that the mic might need either a preamp before connecting to the circuit but I'm not entirely sure.
Yes, microphones only  put-out a few millivolts so you need a preamp.   The Arduino's ADC has 5V default reference so it can read 5V peak-to-peak, which is about 1.75VRMS which is very-close to audio line level.  (A "regular" preamp or audio mixer puts-out line level.)

What kind of microphone are you using?

Condenser mics need power
(usually supplied by the preamp or soundcard).

And, you need to bias the output since the Arduino can't read the negative-half of the AC audio signal.  ("Regular" mic preamps are not biased.)

The easiest solution is to get a microphone board that has a microphone, plus a preamp that powers the electret condenser and a biased output.   (That particular one does not have adjustable gain which can be an issue depending on sound levels.)


P.S.
For testing, just run the Analog Read Serial Example.   Take out the delay, and of course read whatever analog pin you are connected to.

With the input biased at the half-way point, silence should read about 512.   Quiet sounds should give you "random" readings jumping around near 512.    With very-loud sounds you'll get random-looking readings up-to (or near) 1023, and down-to (or near) zero.

Even with a constant-tone, your "raw" readings will look random because you are sampling a waveform that's positive half the time and negative half the time and it passes-through zero twice per cycle (if you ignore or subtract-out the "artificial" bias).   Occasionally, you'll "catch" a positive or negative peak but most of the time you'll be reading in-between the positive & negative peaks.

dsm311

The microphone I'm using connects via an aux port. I'm not entirely sure what type of mic it is since not even the company that sells them knows anything about them. Because of the nature of my project i cant use those microphones that come with the built in preamp. I tried making some modifications to a few of those to see if i can make them work by replacing the built in microphone and attaching the one im trying to use but that was a no-go. Is it possible to build this circuit for the aux input?
This is the microphone im using but with the circuit I put in the previous comment.

Go Up