0
\$\begingroup\$

I am trying to build an audio amplifier circuit based on this design using an LM386 opamp. On the output side (pin5) an Arduino is connected constantly reading out the pin

#include <Arduino.h>

const int analogPin = A0;

void setup() {
  Serial.begin(9600);
  pinMode(analogPin, INPUT);
  Serial.println("Setup");
}

int i=0;

void loop() {
  int val = analogRead(analogPin);
  Serial.print(val); Serial.print(" :"); Serial.println(i++); 
  delay(1);
}

The result is constantly reads ~30 (out of 1023 range of the analog pin). I have redrawn the circuit looking only on the breadboard (soldered PCB) and added the measured voltages across key points (using oscilloscope, time scale 5ns to recognize fast changes).

lm386

After inducing sound (knocking, clapping,...) no change on the output side of the opamp is detected.

A similar article states

Pin 5 is the output. It is biased to 1/2 of the supply voltage Vs

The opamp is supplied with Vdd (4.64V). For the power supply I used the Arduinos internal 5V and an external power source, connected via the same Vss.

Is the detection too slow? Do I have an error in my schematic?

\$\endgroup\$
  • \$\begingroup\$ Check Vdc on each pin for cause of unusual Vdc on output=0.14 V volume of pot is reversed . RV4-2 wiper goes to 3 on CW, so use CCW for full input. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 16 at 11:14
  • \$\begingroup\$ Is the amplifier working at all? What happens if you connect earphones to the mic output? (Start with the volume turned down.) The LM386 isn't an op-amp, it's an audio amplifier. \$\endgroup\$ – Transistor Feb 16 at 11:16
  • \$\begingroup\$ @TonyStewartSunnyskyguyEE75: I do not fully understand your comment. What is CW and CCW? \$\endgroup\$ – v3xX Feb 16 at 11:22
  • \$\begingroup\$ @Transistor: How do I check if the amplifier is working? \$\endgroup\$ – v3xX Feb 16 at 11:23
  • \$\begingroup\$ CW = ClockWise. Convention for Pot numbers is CW= wiper goes from 1 to 3. Check DC voltages on each pin and list \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 16 at 11:24
0
\$\begingroup\$

Is the detection too slow? Do I have an error in my schematic?

Using Arduino as a DC voltmeter here should work since all the DC voltages are within the range of 0V to +5V. Ensure that the path to the Arduino input is DC-coupled (no intervening series capacitors).

Since Arduino's analog-to-digital converter is a sampling type, it could be too fast. When troubleshooting the LM386 circuit, no audio input signal should be applied, so that all the voltages measured are DC voltages. No-signal-input should ensure that Arduino's voltage measurements don't fluctuate.
Arduino's analog-to-digital converter may result in false voltage measurements if the LM386 circuit is oscillating - always a possibility when probing a new build.

OP's schematic seems correct.

I also tried to replace the MIC with a DC-source and tried producing up to +5V.

Data sheet absolute maximum specification says that no input below -0.4V nor above +0.4V should be applied to pin 2 or 3. You may have exceeded this spec.

Before attempting to listen for audio, DC bias voltages should be checked with no MIC input signal. Using Arduino ADC as a voltmeter is a novel way to check voltages. If you have an oscilloscope - that's even better, because not only DC voltages can be measured, but any possible oscillations can be seen as well.

LM386 DC voltages, with +5V applied to pin 6:

  • pin 1 (internal) about +1.2V above gnd
  • pin 2 (input) +0.0125V or less
  • pin 3 (input ) +0.0125V or less
  • pin 4 (ground) 0.0V
  • pin 5 (output) close to +2.5V
  • pin 6 (Vcc) +5.0V
  • pin 7 (bias, internal) about +3.1V
  • pin 8 (internal) about +1.2V above gnd.
\$\endgroup\$
  • \$\begingroup\$ even with the minimal parts (p.9 9.2.2 in the datasheet) the output voltage of pin 5 stays about 0-0.09V on the multimeter and ~ 30mV on the osci. This may also be just the error of the measurement and not a real output \$\endgroup\$ – v3xX Feb 16 at 16:19
  • \$\begingroup\$ Could be a blown internal bonding wire on pin 6. Does a voltmeter measurement on pin 6 (on the actual chip metal pin) give a +5V result? Does a voltmeter measurement on pin 7 give about +3.1V or near zero? If near zero, consider a blown chip, or a wiring connection fault. \$\endgroup\$ – glen_geek Feb 16 at 16:26
  • \$\begingroup\$ On all three chips (one in the real circuit, one with the minimal parts as per datasheet and one with only pin 6 and some load connected) the same result Pin6-GND=4.74V Pin7-GND=0V \$\endgroup\$ – v3xX Feb 16 at 16:47
  • \$\begingroup\$ You have bypass capacitor on pin 7? Could it be shorted? An ohmmeter measurement between pin 7 to pin 6 should be about 15k ohm. Between pin 7 and pin 8 about 15 kohm as well. These measurements out-of-circuit (a naked chip). \$\endgroup\$ – glen_geek Feb 16 at 16:54
  • \$\begingroup\$ On the second setup is no bypass capacitor. Out of circuit with open pins. 7-8: 28.6Ohm; 7-6: 141.7Ohm. This are the same results for the 3 chips in use and 3 new ones. \$\endgroup\$ – v3xX Feb 16 at 17:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.