need some assistant on the op-amp circuit attached in the thread.

Hello, people. Regarding the attached circuit, can someone answer to some questions about it?

  • I would like to know why a non-inverting input op-amp is used and why not an inverting op-amp?
  • Why do we need a feedback loop?
  • Also why is that the gain is determined by the ratio of the two resistors forming the divider bridge at the output of the OpAmp?
  • Also what are the specific uses of the capacitors and resistors used?

The link for the circuit (http://didier.longueville.free.fr/arduinoos/?p=1057) and big thanks to Grumpy_Mike

Amplifier Circuit.jpg

yaantey: I would like to know why a non-inverting input op-amp is used and why not an inverting op-amp?

I think what you mean is, why is the op amp configured as a non-inverting amplifier rather than an inverting amplifier. In this instance, I think either configuration could have been used. However, the non-inverting configuration allows a higher input impedance to be achieved, so it is preferred when the input source has a high input impedance.

yaantey: Why do we need a feedback loop?

To set the gain to the required value. Op amps have a high (and somewhat variable) gain that drops off with increasing frequency, and are intended to be used with negative feedback so as to reduce the gain to the value that you need.

yaantey: Also why is that the gain is determined by the ratio of the two resistors forming the divider bridge at the output of the OpAmp?

That's a bit complicated to explain here. I suggest you search for articles on op amp theory and/or negative feedback. You could try http://en.wikipedia.org/wiki/Operational_amplifier_applications but it is not exactly for beginners.

yaantey: Also what are the specific uses of the capacitors and resistors used?

C1 is a decoupling capacitor, to keep the op amp stable. R5/R6/C5 provide a filtered bias voltage to the microphone (I don't know what type of microphone it is, but presumably it is a type that requires a DC bias). C2 stops this bias voltage feeding through to the op amp. R3/R4 bias the op amp input to half the supply voltage which will be about the middle of its common mode input range. R1/R2 define the gain of the op amp to be 11 and C3 is a DC blocking capacitor to reduce the gain to 1 for DC, thereby ensuring that on average the op amp output is at half the supply voltage as defined by R3/R4.

I find the feedback loop to be confusing. Wouldn't C3 somehow affect AC gain?

Thanks alot. Can I use the above circiut to drive a small speaker? Which is 0.5 W and 8ohms?

Nixt: I find the feedback loop to be confusing. Wouldn't C3 somehow affect AC gain?

C3 will reduce the AC gain at frequencies for which its reactance is not insignificant compared to R2. The reactance of a capacitor with value C at frequency f is 1/*2*pi*f*C). So it's just a matter of choosing C3 to be large enough to preserve the gain down to the lowest frequency of interest.

yaantey: Thanks alot. Can I use the above circiut to drive a small speaker? Which is 0.5 W and 8ohms?

You mean use the circuit to amplify the signal from the microphone and drive a speaker? You can try it, but it won't be very loud. The LM358 is a low-power op amp so it is only designed to source or sink a few milliamps.

You mean use the circuit to amplify the signal from the microphone and drive a speaker? You can try it, but it won't be very loud. The LM358 is a low-power op amp so it is only designed to source or sink a few milliamps.

What other chip can be implemented with the same circuit? Also, from my understanding if I want to drive a speaker using a microphone then I need a amplification circuit in between (but is it voltage or current amplification circuit).

Something like http://docs-europe.electrocomponents.com/webdocs/0ed0/0900766b80ed073d.pdf or http://docs-europe.electrocomponents.com/webdocs/0027/0900766b8002711e.pdf. These data sheets include schematics showing how to use them, but you'll need to add R5/R6/C5 from your original circuit to provide power to the microphone.

What I want to achieve is that, I want to connect the output from microphone to arduino and from arduino to speaker. So when I scream or whisper the microprocessor will detect the voltage and print out for me on the computer using serial monitor. And if the voltage is higher than a certain value it will on the speaker and output the voice. So, to achieve this I am using an electret microphone, a speaker with 8ohms and 0.5W and arduino Uno. I would like to know how and what I I should do to achieve this?

I have come up with a circuit as shown in the attachment. (If i am getting good enough voice i will not be using a filter, because right now I just want to know to use these things and learn and do filter later).

yaantey: What I want to achieve is that, I want to connect the output from microphone to arduino and from arduino to speaker. So when I scream or whisper the microprocessor will detect the voltage and print out for me on the computer using serial monitor. And if the voltage is higher than a certain value it will on the speaker and output the voice. So, to achieve this I am using an electret microphone, a speaker with 8ohms and 0.5W and arduino Uno. I would like to know how and what I I should do to achieve this?

You could use the op amp circuit to amplify the signal for the Arduino. You could use the second of the two chips I linked to, to amplify the output of the op amp and feed the speaker. That chip has a DC volume control input with a mute mode, which you can drive from an Arduino pin via a pot (for volume control). A low on the pin will mute the output, a high will enable the output with volume controlled by the pot.

Thanks alot dc42. I hope I didn't bug u too much. Im just new in this stuff and learning. The the circuit attached by me in the previous topic, do you think i can use it for amplification? One last request if i may, can you give me a simple block diagram for your statement so that I could clearly visualise what I am going to do.

Can I have a block diagram for this statement: You could use the op amp circuit to amplify the signal for the Arduino. You could use the second of the two chips I linked to, to amplify the output of the op amp and feed the speaker. That chip has a DC volume control input with a mute mode, which you can drive from an Arduino pin via a pot (for volume control). A low on the pin will mute the output, a high will enable the output with volume controlled by the pot.

Thanks alot.

Attached. Don’t forget the extra 0.1uF decoupling capacitor near the TDA7052 if the 220uF cap isn’t very close to it (see datasheet).

About the diagram. I want the voice from microphone to go arduino and check the frequency or voltage range and if its between a certain range to on the speaker and output from the voice from the speaker. Is it possible with the block diagram you mentioned.

yaantey: About the diagram. I want the voice from microphone to go arduino and check the frequency or voltage range and if its between a certain range to on the speaker and output from the voice from the speaker. Is it possible with the block diagram you mentioned.

That doesn't make sense to me. What I think you mean is that the speaker should normally be silent, but when the sound picked up by the microphone is loud enough, the signal from the microphone is amplified and fed to then speaker. In which case, this circuit can do that of the Arduino is suitably programmed. The Arduino will take a small amount of time to decide that the signal is loud enough, so the speaker won't cut in until a few milliseconds after the loud sound started. This may make it hard to understand what the first word spoken was.

I came across (Arduino crib rocker). It fascinates me how the person did it. I would like to try and implement something similar to it accept that I want the microphone to pickup the sound and send to arduino to detect if its baby’s cries. If it is then I want arduino to ON the speaker and output cries from the speaker. It’s ok if there is some noise for the time being. He has used a transistor, but in my case I want to go with an op-amp since, I have spent quite abit of time learning it in the last 3 days. So, how do you propose I go about it. Attached is the idea if the wording seems confusing to follow.

Thanks

Idea.png

OK then, the diagram I posted can do that. You don't want to feed the audio signal through the Arduino because it can barely digitise audio fast enough and it doesn't have a DAC for generating an audio output that follows the input. The diagram I gave feeds the audio from the op amp straight to the audio amplifier, and uses the Arduino to control the volume control pin of the amplifier.

That is a 1K potentiometer in series with a 2K resistor (2.2K in my original). A potentiometer doesn’t have Vcc and ground pins, it has two end pins and a slider pin.

If you don’t want to pass the sound to the speaker, then you don’t need the audio amp. Either connect a piezo buzzer between a digital output pin and ground and drive it high to make the buzzer sound, or connect the speaker to an Arduino output pin in one of the two ways shown in the diagram (the right hand one provides more volume) and use the Tone library to drive the pin.

Thank you. Will try and post the what happens :D

I have few questions which I need answers. 1) Voltage from electret microphone is AC, right? 2) I have a speaker with 8 ohms, 0.5 W and using P=(V^2)/R, I found that the voltage is 2V's. Is it the output voltage from the speaker or the voltage needed for the speaker to function? 3) Op-amp produce DC voltage, right? 4) If the electret microphone produce AC and this is the input to the Op-Amp, how do I calculate the output from Op-Amp (can I use Vout = [1+rf/r1]]Vin) considering a non-inverting amplifier where rf is the feedback resistor and r1 connected to it in voltage divider circuit) 5) Since arduino Uno has an ADC range of 0 - 5V do I need to amplify the voltage from microphone to exactly to 5V to get the best resolution?

  1. Yes, although the mic needs a DC bias to power the preamplifier in the mic.

  2. 2v is the maximum RMS voltage you should feed the speaker, so as not to exceed its rated power. You will get some sound out of the speaker at a much lower voltage than this.

  3. The output of that op amp circuit is the amplified AC signal superimposed on a DC voltage of half the supply voltage.

  4. That calculation will give you the AC component of the op-amp output

  5. The resolution of the Arduino analog input (using the default 5v analog reference) is around 5mV. I suggest you amplify the signal enough so that the AC component is at least 100mV peak to peak at the level you wish to detect, preferably more.