USB powered speaker circuit doesn't work

Thread Starter

tjohnson

Joined Dec 23, 2014
611
Over the past week I tried to make this Instructable: USB Powered Speaker. I thought it would be nice to have a speaker with an IC and adjustable volume, and was interested in the idea of powering it from a USB port rather than a battery.

I tried assembling this circuit on a breadboard, but it's not working for some reason. I've tried various things, including powering the circuit with a 9V battery rather than a USB port, but with no success. Perhaps the LM386 chip I'm using is blown, but it wasn't when I checked it a few days ago.

Attached are two pictures of my setup. Sorry for the poor image quality, but I'm hoping they can be of some help in diagnosing the problem.
 

Attachments

Last edited:

blocco a spirale

Joined Jun 18, 2008
1,546
The most likely possibility is that you have built it wrong so check every single connection goes where it should and nowhere else, with a meter if you have one. Was it foggy when you took the pictures?
 

Thread Starter

tjohnson

Joined Dec 23, 2014
611
The most likely possibility is that you have built it wrong so check every single connection goes where it should and nowhere else, with a meter if you have one.
You were right. I checked all of the connections last night, and found that I had a jumper wire missing and a resistor wired to ground rather than positive voltage. After fixing both those issues, my speaker worked.
Was it foggy when you took the pictures?
No, they were taken indoors, in a room with a light on, but either the camera was set at a poor photo quality or the pictures got blurry when I resized them.

Now, I need to figure out how to improve the sound quality of my speaker, because it generates a lot of static at lower frequencies.
 

djsfantasi

Joined Apr 11, 2010
9,155
image.jpg As to the noise, I've never seen an LM386 amp schematic like that. At first, I noticed it was missing a capacitor and resistor to ground from the output. Where did you get your schematic? Even the datasheet is different.

This schematic is similar to the one I use. I got it from electroschematic.com, but Googling for "LM386 amp circuit" will show you many examples.
 

Thread Starter

tjohnson

Joined Dec 23, 2014
611
View attachment 85464 Where did you get your schematic?
@djsfantasi: Thanks for the input.

I'm going to try what Hack A Week recommends:
An increase in bass frequency can be facilitated by adding a 10K resistor and .033 uf capacitor in series between pins 1 and 5.
View attachment 85466
Here's the minimalist circuit from the datasheet. It still has the capacitor and resistor to ground.
How would adding this RC affect the circuit? Would it improve the sound quality?
 

djsfantasi

Joined Apr 11, 2010
9,155
That information is also in the datasheet. It's also recommended to place a bypass capacitor on the power pins. That's known to reduce noise and improve sound quality. It looks like you do have one, but that raises another question. Why is the resistor in series with your power line? Where are you getting your USB power from? If you have an LM386N-4, you may be operating below the minimum required voltage.
Honestly, all I can say about the RC network between pin 5 and ground, is that I've always done it that way.
 

Thread Starter

tjohnson

Joined Dec 23, 2014
611
That information is also in the datasheet. It's also recommended to place a bypass capacitor on the power pins. That's known to reduce noise and improve sound quality. It looks like you do have one, but that raises another question. Why is the resistor in series with your power line? Where are you getting your USB power from? If you have an LM386N-4, you may be operating below the minimum required voltage.
Honestly, all I can say about the RC network between pin 5 and ground, is that I've always done it that way.
I'm using an LM386N-1, and my power source is a USB port on my computer. I don't have any idea what components to use, but was just following the Instructable that I linked to. In the video on the Instructable page, the sound quality of the speaker seems really good, but mine isn't working like that for some reason.

I tried adding a 0.47μF capacitor and 10Ω resistor between pin 5 and ground, but the sound quality is still horrible (lots of static) if I turn the volume up on the potentiometer. How can I fix this? Maybe the problem is the speaker that I'm using in my circuit? I'm using a 1-inch one that I ripped out of an old toy, rather than a 3-inch one like the Instructable author used.
 
Last edited:

ian field

Joined Oct 27, 2012
6,536
Over the past week I tried to make this Instructable: USB Powered Speaker. I thought it would be nice to have a speaker with an IC and adjustable volume, and was interested in the idea of powering it from a USB port rather than a battery.

I tried assembling this circuit on a breadboard, but it's not working for some reason. I've tried various things, including powering the circuit with a 9V battery rather than a USB port, but with no success. Perhaps the LM386 chip I'm using is blown, but it wasn't when I checked it a few days ago.

Attached are two pictures of my setup. Sorry for the poor image quality, but I'm hoping they can be of some help in diagnosing the problem.
You could try the TDA7052 BTL amplifier - which will definately work on 5V, and give pretty good Po for such a low Vcc, but you'll need to add a nought to the value of the supply decoupler for the peak current draw.

The TDA7052A has DC controlled volume - I've used one as the compressor for a guitar sustain unit.
 

Thread Starter

tjohnson

Joined Dec 23, 2014
611
Your speaker is predominantly responsible for the poor sound quality and particularly the low-frequency distortion.
I finally decided to take the time to disassemble a dead laptop in order to get a speaker out of it. I'm glad I did, because it made the sound quality infinitely better. Now I think my speaker sounds almost professional.:cool:

Thanks to everyone for their helpful advice in this thread, as well as my previous ones on this topic! I really appreciate it.
 

Thread Starter

tjohnson

Joined Dec 23, 2014
611
Now that I've gotten this circuit to work, I have a question about it.
Is it safe to leave it plugged in (to both the USB port and headphone jack of a computer) for several hours or days, as would be done with regular speakers? Even when no sound is being played, would current still flow through the resistor and generate too much heat?
 

ian field

Joined Oct 27, 2012
6,536
Now that I've gotten this circuit to work, I have a question about it.

Is it safe to leave it plugged in (to both the USB port and headphone jack of a computer) for several hours or days, as would be done with regular speakers? Even when no sound is being played, would current still flow through the resistor and generate too much heat?
A fuse is rarely a bad idea, come to that - since you have a resistor feeding the supply decoupling capacitor, you can get special fusible resistors.

Rare as it is, audio amplifiers sometimes do pop while not doing much, if there's low enough source impedance the chip will usually split or crack and that's the end of it. In this case I believe, if any; the resistor in the supply feed might be the danger - a fusible resistor would sort that out.

But that's just me being paranoid - the power from a USB port is pretty safe, the thing to watch is wall-wart USB chargers, some are rated 2A or more.
 

ian field

Joined Oct 27, 2012
6,536
@blocco a spirale: What do you mean by "built to a good standard"? Just that the circuit doesn't have a short in it or anything like that?
That can be pretty much the same as a matter of personal taste.

Sometimes when I complete the soldering (especially on stripboard) I wire brush the solder side, it gets rid of the flux without solvents that may be banned and/or damage components. It shifts the tiny solder flecks that are hard to see and exposes the ones that were hidden under flux.

The bloke who designed the WW2 Spitfire fighter plane was famously quoted as saying of aeronautical design; "if it looks right - it'll probably fly".

Probably the first thing to do is secure the board to some kind of base, then tidy the wires and possibly use zip-ties to limit their movement - if they get wiggled about, they'll fray and snap from fatigue.
 

Thread Starter

tjohnson

Joined Dec 23, 2014
611
That can be pretty much the same as a matter of personal taste.

Sometimes when I complete the soldering (especially on stripboard) I wire brush the solder side, it gets rid of the flux without solvents that may be banned and/or damage components. It shifts the tiny solder flecks that are hard to see and exposes the ones that were hidden under flux.

The bloke who designed the WW2 Spitfire fighter plane was famously quoted as saying of aeronautical design; "if it looks right - it'll probably fly".

Probably the first thing to do is secure the board to some kind of base, then tidy the wires and possibly use zip-ties to limit their movement - if they get wiggled about, they'll fray and snap from fatigue.
Actually, I haven't learned how to solder yet, and the circuit is still on my breadboard.:eek:
 

Thread Starter

tjohnson

Joined Dec 23, 2014
611
There is a widely acclaimed soldering tutorial on the Everyday Practical Electronics website - if you have trouble finding it, sign up to their Chatzone forum asn ask there.
I'd like to get the circuit off my breadboard and be able to build other circuits, so I thought about trying a perforated board, but read that they can experience a lot of noise because the component leads tend to act as antennas. I'm aware of wire-wrap boards as well, but they seem like a real pain to use. I guess there aren't really any good alternatives to soldering for what I'm doing?
 
Last edited:
Top