Constant signal from electret microphone

Hello,

I'm following this Instructable about the setup of the audio input for the Arduino Uno. However, despite having followed the schematic and the images very carefully, I still can't get the circuit to work, as the serial monitor keeps printing a constant value around 510.

The only change that I made from the Instructable, in fact, is that I'm not using a jack cable, but directly an electret microphone. I know, however, that this microphone requires power in order to function: therefore I hooked it up as explained here, with the difference that instead of the 5V supply provided by the Arduino I used the 3.3V (as the former was already needed by the circuit) and also, instead of routing the microphone output directly to pin A0, I used it as the input of the op-amp, as requested by the Instructable.

Unfortunately, neither this method, nor wiring the microphone up without even caring about the power work, but I simply can't figure out why, having had only little experience with electronics.

I would appreciate if someone provided me with some useful hints on how to get the microphone to work. If you would like more information, just ask.

Thank you

Basically instructables are crap.

We need to know exactly what you have done, that means a schematic of what YOU have made. What components have you used and what batteries or other voltage source did you use.

the serial monitor keeps printing a constant value around 510.

Yes it will with no signal.

The only change that I made from the Instructable ..........

That sounds like your problem but we still need to know what you have done in schematic form.

As I said, I followed exactly the images of the circuit wired on the breadboard, with the same exact components.

Therefore, my circuit is identical to the Instructable's, except for two cases: I am using a 100nF ceramic capacitor instead of a 47nF (simply because I don't have one handy) and, as I pointed out in the last post, the two wires of the audio input don't come from a jack cable adapter, as in the Instructable, but directly from an electret microphone (perhaps set with a resistor between its positive lead and the power wire, as clearly shown in the link I provided in the last post).

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

How have you got your opamp wired.

Can you please post a copy of your sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Tom… :slight_smile:

If you are not going to cooperate then we are all wasting our time here. What is wrong is what you are doing. You can not just subistute an electret microphone here in place of the jack. And hey physics dosn't cair if you do not have the right component it will adjust it's laws to suite what you have.

I have looked at the instructables schematic and it is crap. Now give us a schematic of what you have.

Not a lot of opamps work on 3.3volt. AFAIK, the TL07x will already be struggling on a 5volt supply.

The output will be DC (fixed digital value) with AC (sound, fast changing digital value) modulated on top of that.

So yes, we need to see your exact schematic diagram AND the code. Leo..

Sorry guys, I’ll try it again:

This is the Instructable’s schematic:

I actually followed also the wiring on the breadboard as pictured in the images of the Instructable, and now my breadboard looks pretty much like the image I posted in the attachment.

As you’ll notice, I wired the microphone up as shown in this video, using a 2.2kOhm resistor and a 100nF capacitor. So basically my schematic and the Instructable’s are almost equal, except that I have to power the microphone up before getting some output signal from it to be routed into the TL082 (or at least this is what I’ve understood…).

I still can’t get the circuit to work, anyway, and even turning the shaft of the potentiometer doesn’t make the serial monitor stop showing the same constant value around 510.

Oh, and since you were asking me also about the program loaded in the Arduino, that’s simply:

void setup() {
  Serial.begin(9600);
}
void loop() {
  int micValue = analogRead(A0);
  Serial.println(micValue);
  delay(1);
}

Note: I actually used 6V (four AA batteries) to power up the microphone, but in the images are only shown 3V (Fritzing didn’t have the 6V option…)

Like we always say, the "XY problem".

Perhaps if you explain what you actually want to do with this arrangement, we can suggest how to do it.

For now I only want the Arduino to read the signal coming from the microphone, as I showed with the program in the last post: if there's noise, the values shown by the serial monitor will get higher, if it's quiet, they will get lower...

Riccardo4444: For now I only want the Arduino to read the signal coming from the microphone, as I showed with the program in the last post: if there's noise, the values shown by the serial monitor will get higher, if it's quiet, they will get lower...

The value that you're reading (~510) is the constant voltage from the 2x100k voltage divider.

Sound waves are superimposed to that. Waves go UP AND DOWN.

Your program has to IGNORE that constant value, and only detect the fast changes (sound). e.g. detect when SOME readings are under 500 or over 520.

Talk in your mic, freeze the serial monitor, and look at the values. You might find that some are a lot off from 510. Leo..

Your program has to IGNORE that constant value, and only detect the fast changes (sound). e.g. detect when SOME readings are under 500 or over 520.

Of course, that's what I want! But didn't you understand? The values will remain fixed even if I put on loud music on the stereo!

Hi, Check the voltage at the output pin of the IC, where the 10uF and 100k joint, VoltsDC, without any sound. The change you DMM to AC and measure the volts as you put sound into the amp. What model make is your meter? I hope it can measure audio above 50/60Hz.

Thanks ..Tom.... :)

Riccardo4444: I know, however, that this microphone requires power in order to function: therefore I hooked it up as explained here, with the difference that instead of the 5V supply provided by the Arduino I used the 3.3V (as the former was already needed by the circuit) and also, instead of routing the microphone output directly to pin A0, I used it as the input of the op-amp, as requested by the Instructable.

The output of that microphone circuit is a small AC signal on a DC voltage. Your op-amp is amplifying that DC voltage at least eleven-fold, so the output of the op-amp is firmly at the positive end of its output swing capability.

EDIT: although not mentioned in the original post, I have now spotted that there is a coupling capacitor between the microphone output and the op-amp input.

Sorry guys, I'll try it again:

That is just the same information again.

Last time:- we need to know the schematic of how you have wired it ALL up.

There are problems in integrating that microphone with that input. As Archibald says the signal you get out of the microphone is not compatible with the amplifier's input as I said in reply #4.

What we need is a schematic, not a fritzing abortion of a physical layout diagram.

Once we have a full schematic we can see if it will work or more precisely what you need to do to make it work.

It’s in the attachment.

Note: The battery at the bottom is 6V, not 3V, as I said before.

Try a biasing resistor, say 4.7k or 10k, from input pin 3 of op-amp to ground.

0221be35a26a7efcc247e145bb227ad8561ce200.png

Wow! That’s one seriously mis-conceived circuit!

OK, the discussion has progressed since I started writing - interspersing with other jobs.

As Mike says, “instructables” are dangerous - whilst some may be skilled, many are cobbling together basic circuits from venerable sources such as Don Lancaster’s op-amp cookbook.

The split power supplies to the op-amp are clearly ridiculous. You just need it to be powered from whatever is your primary supply, whether 5V from USB or 9 or 12V as input to the Vin. Much the same applies to the electret supply. A single supply to a general-purpose op-amp such as a LM324 (somewhat overkill, as it contains four op-amps) with a “virtual ground” set to half the supply voltage can be AC-coupled.

And since you only want to detect level and not the signal itself, the output can be fed into a “charge pump” at the input of the Arduino.

It's in the attachment.

Thank you.

The input to the +ve of the op amp is in effect floating. I would put a 10K resistor between pin 3 of the op-amp and the point where the two 9V batteries join.

You can eliminate the 6V battery and connect what was the positive connection to pin 8 of the op-amp and change R3 to 3K3.

With the output of the op-amp going directly to the Arduino's input, albeit via a capacitor, there is a risk of damage to the Arduiono chip.

You can eliminate the 6V battery and connect what was the positive connection to pin 8 of the op-amp

What exactly does it mean? What is the "positive connection"? Unfortunately, only connecting the 10K resistor from pin 3 of the op-amp to the junction of the batteries and changing R3 to 3.3K doesn't work.

You just need it to be powered from whatever is your primary supply, whether 5V from USB or 9 or 12V as input to the Vin

Here, looking at your circuit in the first image, I don't understand three things: what is Vin, what is V+ and where and how does the microphone need to be wired up (does it still need to be powered up, right?). Moreover, I wonder wheter my TL082 can be used in spite of your LM324.