USB powered speaker circuit doesn't work

ian field

Joined Oct 27, 2012
6,536
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?
For a simple audio project - stripboard will work just fine.

You can mount the components flat to minimise adjacent parallel component leads, but stripboard isn't cheap and the end results take up more space.

As I'm a skinflint, I always mount components vertically to get away with the smallest amount of stripboard possible. AFAIK: noise isn't the problem, you can run into stability issues at high frequency, but you should be able to get some considerable way past the AM broadcast band before that happens.

In actual fact:- laying the components flat can end up as a nice little antenna array - you could end up having to mount it in a die cast box to eliminate unintended RF reception!
 

ian field

Joined Oct 27, 2012
6,536
How important is the value of the capacitor? I'm asking because the schematic shows 0.05μF, but the smallest capacitor I have right now is 0.47μF. Would that work?
The nearest preferred value is 0.047uF.

As a reference, you can download the table of values for E12 series resistors - the values go; 1.0, 1.2, 1.5 1.8, 2.2, 2.7 3.3, 4.7. 5.6, 6.8, 8.2 and 9.1.

The value can be a multiple or sub-multiple of one of those base values, some capacitors used to be marked with colour bands that were interpreted in the same way as the ones on resistors - a few special types are still colour coded.

The 0.47uF you suggest is 10x too big.
 

irobot

Joined May 16, 2015
24
@djsfantasi: Thanks for the input.

I'm going to try what Hack A Week recommends:



How would adding this RC affect the circuit? Would it improve the sound quality?
The .05uf/.047 cap and 10 ohm resistor are used for stability, such as preventing oscillation, etc. It really wont affect frequency response.

Experiment! Try the Hack Week circuit variation . . . that's what breadboards are for! I would recommend using a shielded audio input cable for lengths over about 6" . . . .

The LM386 is extremely popular because it is so easy to work with, and produces good quality sound.
 
Last edited:

irobot

Joined May 16, 2015
24
Also - You have to keep in mind: Component values when doing this type of work are not at all critical. General purpose capacitors such as ceramic disc typically have a tolerance of +/- 20%. A .047uf will work just fine in lieu of a .05uf.

Don't have a 560 ohm resistor? Use a 470 or 680. Don't have a 47uf electrolytic? Use a 50uf or a 33uf . . . etc. etc.

Experiment!

The most important thing you can do is be careful with battery polarity when working with these small amp/op-amp/timer etc. chips. Small signal transistors generally are robust (as used with low-voltage/currents) but IC's are a little less forgiving. Always buy double or triple of these "active" components so if something doesn't work, you can easily swap in a new one.

When I was a kid I used to believe I couldn't even think about beginning a much desired project because I didn't have the exact values called out for in a schematic. This held me back on quite of few projects.

If a component is really critical, meaning a circuit won't work without an exact value, the project author will usually spell it out in his/her instructions.

Component values (and quality/type) are much more critical when you start playing with RF stuff (transmitters, receivers, mixers, downconverters, etc.) and especially VHF/UHF/microwave stuff.

This post may have been better suited in the Hints and Tips thread . . . . maybe I'll copy it there also!

-Mike, W9MAS, Extra Class/FCC GROL/C.E.T.
 
Last edited:

Thread Starter

tjohnson

Joined Dec 23, 2014
611
Currently I need to plug the speaker into a headphone jack to receive audio input. Since USB cables are also capable of transmitting audio signals through their data wires, would it be possible to use the USB cable as a source of both power and audio input?

I know there are speakers that operate completely off USB available on the market, but I don't know if I could make such a speaker myself that would work on a Windows PC without requiring a special driver.
 

ian field

Joined Oct 27, 2012
6,536
Currently I need to plug the speaker into a headphone jack to receive audio input. Since USB cables are also capable of transmitting audio signals through their data wires, would it be possible to use the USB cable as a source of both power and audio input?

I know there are speakers that operate completely off USB available on the market, but I don't know if I could make such a speaker myself that would work on a Windows PC without requiring a special driver.
You won't get audio from the D+ & D- lines, but you can get a USB external soundcard.
 

Thread Starter

tjohnson

Joined Dec 23, 2014
611
Is it safe to solder the LM386 to a perfboard without using an IC socket? I'm a little nervous about doing this, but from this answer on Stack Exchange it sounds like it might be OK:
For soldering the IC directly it's easy to be paranoid but DIP packages are often wave soldered which involves dipping in solder and making every connection at once and the pins themselves will dissipate a lot of heat before reaching the die of the chip. Just to be a bit extra cautious as you improve your soldering technique maybe just wait 15 seconds or so between each pin to give it a while to cool down. You should find the top of the chip will barely become warm, it if is just wait a while until it cools down.
 

ian field

Joined Oct 27, 2012
6,536
Is it safe to solder the LM386 to a perfboard without using an IC socket? I'm a little nervous about doing this, but from this answer on Stack Exchange it sounds like it might be OK:
Make sure the pins & tracks are clean, apply the iron tip to both pin and track so they heat up simultaneously and equally. Apply the solder immediately so it melts and releases the flux cores into the joint.

The quicker you complete the operation the less you cook the parts, but you have to practice at not being hasty.

Getting hold of some scrap boards to harvest any useful components is a good introduction to how solder handles.
 

Thread Starter

tjohnson

Joined Dec 23, 2014
611
Make sure the pins & tracks are clean, apply the iron tip to both pin and track so they heat up simultaneously and equally. Apply the solder immediately so it melts and releases the flux cores into the joint.

The quicker you complete the operation the less you cook the parts, but you have to practice at not being hasty.

Getting hold of some scrap boards to harvest any useful components is a good introduction to how solder handles.
Actually, the perfboard that I got at RadioShack doesn't have tracks or copper pads. But judging by this thread, I suppose it will still work.
 

Thread Starter

tjohnson

Joined Dec 23, 2014
611
Perfboard without copper strips is more versatile but harder work.

You can make projects more compact if you have to wire it up, the strips on stripboard impose a certain amount of constraint, and most people end up using a few wire links anyway.
Not only does this perfboard not have copper strips, the holes aren't copper clad. It's really nothing but a sheet of plastic with holes in it.
 

ian field

Joined Oct 27, 2012
6,536
Not only does this perfboard not have copper strips, the holes aren't copper clad. It's really nothing but a sheet of plastic with holes in it.
I've never seen one with clad holes - you can get board with a little square of copper around each hole (usually single sided) they have the advantage you can solder all the components in place before you start wiring up.

IME: they're much more prone to the copper un-bonding when you apply heat.

There used to be double sided stripboard that was lengthwise one side and width wise the other - haven't seen any in a long time, there may have been reliability problems with people not bothering to countersink to undercut the copper where they pass component leads through a track that isn't part of that circuit,
 

Thread Starter

tjohnson

Joined Dec 23, 2014
611
So which would you prefer using: perfboard with no copper, perfboard with copper around the holes, or stripboard with tracks?
 

ian field

Joined Oct 27, 2012
6,536
I've never seen one with clad holes - you can get board with a little square of copper around each hole (usually single sided) they have the advantage you can solder all the components in place before you start wiring up.

IME: they're much more prone to the copper un-bonding when you apply heat.

There used to be double sided stripboard that was lengthwise one side and width wise the other - haven't seen any in a long time, there may have been reliability problems with people not bothering to countersink to undercut the copper where they pass component leads through a track that isn't part of that circuit,
Usually I use stripboard - but its a whole 'nother process designing the layout to fit in with the tracks.

Single pads or no pads have advantages at higher frequencies, point to point wiring gives shorter leads between components.
 

Thread Starter

tjohnson

Joined Dec 23, 2014
611
Well, last night I finally finished soldering the circuit.:) The first time I tried it, I unwisely soldered the LM386 directly to the board, which caused it to burn out, so I decided to use an IC socket. I need to improve my soldering technique though, because I haven't been able to melt the solder well without touching it to the iron tip, and I know that's not how I should be doing it.

@ian field: Thanks for mentioning the soldering tutorial. I found it here, and it looks like I should have read it sooner. I've also looked at the How to Solder Instructable, which is nice because it has some close-up videos.
 
Last edited:

Thread Starter

tjohnson

Joined Dec 23, 2014
611
I forgot to mention that I also learned how dangerous shorts can be. Once when I was testing my circuit, the USB wires got shorted, creating a flame and some smoke! Thankfully, I was quickly able to disconnect and fix it, and no damage resulted to either the circuit or my computer's USB port.

To prevent this from happening again, I wrapped some electrical tape around one of the USB wires. I suppose if I had used perfboard with copper-clad holes this would have been less likely to happen. Any other ideas for how to prevent this?
 

djsfantasi

Joined Apr 11, 2010
9,155
Heat shrink tubing! If you don't have an electronics store nearby, Harbor Freight carries a selection as does marine supply stores.
 
Top