LM386 no output, with signal smaller than 2V

Thread Starter

w0ndercat

Joined Jun 16, 2016
6
I'm trying to implement volume control using a digital potentiometer (LM386) and audio amplifier (MCP4131). The way I have it setup, I'm outputting square wave audio signals out of a PWM pin on the Particle P1 board.

The amplitude of the square wave is adjusted using a digital potentiometer (acts as a moving voltage divider) before it enters a LM386 audio amplifier.

Where I'm having trouble is, when the amplitude of the square wave is adjusted below 2V (feeding this into pin 3), the LM386 audio amplifier stops outputting a signal (pin 5). Everything works fine above 2V and I get a good amplified square wave out of pin 5. This is a problem because it limits the desired range of volume control. I'd like to get softer audio as well.

I've read the LM386 datasheet back and forth and can't see to find a specification that would explain this. I think I may be missing something pretty basic... The schematic here: http://i64.tinypic.com/k2llcm.jpg

Any help would be appreciated. If there are any questions about the set-up, let me know!

Datasheets: LM386- http://ww1.microchip.com/downloads/en/DeviceDoc/22060b.pdf MCP4131-http://ww1.microchip.com/downloads/en/DeviceDoc/22060b.pdf
 

AnalogKid

Joined Aug 1, 2013
11,056
Some points...

1. You are mixing up the chip part numbers and functions. I understand what you are trying to do, but it will be easier if you are more careful with your descriptions.

2. The LM386 has a minimum gain of 20. Your gain is greater than that because of C1 and R1, but how much greater is a secret. So with 2 V in it is trying to make at least 40 V output with only a 5 V power source.

3. #2 means the part is way overdriven. Different amplifiers react to this in different ways.

To start, what is the input frequency range or pulse width ranges?
What are the input signal positive and negative peak voltages with respect to Ground?
What is the speaker impedance?
What is the power source for the digital pot?
What is the input signal voltage range for the pot?

ak
 

Thread Starter

w0ndercat

Joined Jun 16, 2016
6
Ah, I was typing everything out in a hurry. Sorry about that!

2. Currently R1 is 470 Ohms, giving a gain of about 50.

To start, what is the input frequency range or pulse width ranges?
-- I'm playing a melody, so the notes range from ~100-500Hz
What are the input signal positive and negative peak voltages with respect to Ground?
--It input signal from the Particle P1 is 0 to 3.3V, but it's adjustable with the digital pot. I'm seeing the cutoff at 2.5V.
What is the speaker impedance?
--I'm using a 8Ohm, 1W piezoelectric speaker.
What is the power source for the digital pot?
--The power source for the pot is coming from the Particle P1 3.3V output (which is in the operating range).
What is the input signal voltage range for the pot?
--The input signal prior to the pot is 3.3V.
 

AnalogKid

Joined Aug 1, 2013
11,056
An LM386 is a DC amplifier, granted a strange one. There are no internal coupling capacitors. The amplifier internal circuit uses a feedback trick to keep the DC bias point of the output at 50% of the rail voltages. Since the negative rail is at the system and input signal ground potential, that means that the input signal must be symmetrical about ground if you want the output to be symmetrical about 2.5 V (Vcc/2). Your input is not.

Besides the fact that the schematic representation of R2 (the digital pot) is incorrect, there needs to be a coupling capacitor between the pot wiper and the 386 input. Also, I would eliminate C1 and R1 for minimum 386 gain.

ak
 

Thread Starter

w0ndercat

Joined Jun 16, 2016
6
Ah, yes, I hooked it up wrong in the schematic. Here's the updated version with the correct components:http://i68.tinypic.com/15grneo.jpg

That makes sense. So, I put in the 1uF cap l(see schematic), however, I'm getting a really small signal. The peaks don't even reach the original amplitude of the square wave. My square waves are in the 100-500 Hz range, so I don't understand why it's not coming all the way through.

I'm a mechanical engineering by training, so not as savvy with circuits. I appreciate the help!
 

EM Fields

Joined Jun 8, 2016
583
Ah, yes, I hooked it up wrong in the schematic. Here's the updated version with the correct components:http://i68.tinypic.com/15grneo.jpg

That makes sense. So, I put in the 1uF cap l(see schematic), however, I'm getting a really small signal. The peaks don't even reach the original amplitude of the square wave. My square waves are in the 100-500 Hz range, so I don't understand why it's not coming all the way through.

I'm a mechanical engineering by training, so not as savvy with circuits. I appreciate the help!
The capacitor you've labeled "R17" should be placed between pin 6 on the pot and pin 3 on the LM386.
 

BobTPH

Joined Jun 5, 2013
9,003
To amplify a square wave coming out of a micro, just use a transistor. The LM386 is designed to take low level (<0.1V) signals and amplify them to the level for the speaker (2V or so). You already have a signal of 3.3V. You just need a transistor to up the current to drive the speaker.

Bob
 

Thread Starter

w0ndercat

Joined Jun 16, 2016
6
So, I replaced the capacitor and have it now between the pot wiper and pin 3 of the LM386. AK, I think you're right, the MCP4131 doesn't seen to like signals below ground.

This shifted my signal down, closer to ground, but there's still about 500mV is DC bias. My duty cycle is 50%.. not sure why this is.
 

Thread Starter

w0ndercat

Joined Jun 16, 2016
6
Ah Bob, I see. Thanks!!! That helps a lot. I guess the LM386 wasn't the best amplifier to use for my situation.

What if I wanted to amplify an AC signal of the same 3.3V peak to peak amplitude? Would a regular op-amp be fine for audio?
 
Top