Pages: [1]   Go Down
Author Topic: Small problem with LM358N and microphone  (Read 1327 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I'm having some problems with an amplifier circuit made with an LM358N and a condenser mic. I don't have the data sheet for the mic but i am pretty sure it has a 2.2kohm impedance and an operating voltage from 1.5V to 10V.

I made this setup http://circuitdiagram.net/simple-mic-pre-amp-based-lm358.html and it works great for about 20-30 seconds. After that it stops working. Pressing the reset button on the Arduino does not work. If I turn it off and then immediately  turn it on it does not work. I have to wait for about 3-5 minutes for it to work for 20-30 seconds before it stops working again.

I thought this was (maybe still is) a capacitor problem so I switched the C2 with a 220uF @16V and the C1 with a 10uF @25V without success. It does the same thing powered at both 9V and 5V.

I am using an Atmega8A-PU with the Arduino S3V3 single sided board if this matters.

Is there another circuit/suggestion that works with an Arduino that someone could recommend?
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 29
Posts: 2590
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Problem could be with negative half wave after cap, injection current (not limited , except output driving capability).
Solution: power it up with +5V, remove C2, connect analog input directly to OPA output.  To play safe, you can put resistor instead C2 ( 1 - 10 k), than connect it to arduino.
If you want power to be +9V, than use two resistor voltage divider at the output (10 and 10 k should be fine), again - no cap !.
The would be offset in analog reading, approximately V/2 or whatever voltage you have at pin 3 (OPA). Just subtract this value in your code.
You can easily find out what offset is, printing analogRead in absolute silence.
Logged

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12048
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't connect the opamp output directly to an Arduino pin, definitely use the resistive divider (10k and 10k is what is meant, BTW).
Logged

[ I won't respond to messages, use the forum please ]

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for the replies!

After many frustrating hours checking the amplifier circuit, my Arduino and my code I found the problem.

The battery was dying and that is what caused the problem. When I would turn it on, the battery would have enough voltage to power up the hardware and start the sketch. After about 30 seconds the voltage would drop under the minimum required level for the Arduino to operate. Obviously things stopped working. When I would try to power it immediately the battery would still be drained. After sitting for 5-10 minutes the voltage in the battery would rise a little above the minimum required voltage and the Arduino would power for another 20-30 seconds.

I don't know what this battery effect is called but I remember playing with small DC motors when I was a kid. I would let the motor run until the battery was gone, wait for a few minutes and start it again. The motor would spin again for a few seconds.   
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 29
Posts: 2590
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Glad to hear you solved a problem. But you still putting arduino in danger, driving negative voltage to its input. Even its not failed yet this time, it doesn't mean it would be reliable for long. Basically, you can't just interface any circuitry you find on-line to arduino,
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

The negative voltage to the input problem is above my electronics knowledge and I would appreciate a few more details. Would a 1N4004 diode between the amplifier and the analog pin solve the problem?   
Logged

Offline Offline
Edison Member
*
Karma: 33
Posts: 1307
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Would a 1N4004 diode between the amplifier and the analog pin solve the problem?
Maybe...   but, the diode won't start to conduct (in the "positive" direction) until it has about 1/2 Volt across it.   That might be OK If you are only trying to capture loud sounds, and your signal is strong enough.   But, quiet sounds below 1/2 volt will be cut-off.

A better solution is to wire the diode "backwards" to ground, so that negative voltage turns the diode on, and the diode 'shorts out" the current.  (You'll still get about -1/2 volt into the Arduino, but that's OK.)  You will need a current limiting resistor, so that your op-amp doesn't get damaged with the negative current "shorted" to ground  But, since you should already be using a voltage divider, those resistors will do the job.
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 29
Posts: 2590
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Better to get rid off C2, than install additional diode.
Quote
Solution: power it up with +5V, remove C2, connect analog input directly to OPA output.  To play safe, you can put resistor instead C2 ( 1 - 10 k), than connect it to arduino.
Logged

Pages: [1]   Go Up
Jump to: