USB powered speaker circuit doesn't work

Discussion in 'General Electronics Chat' started by tjohnson, May 8, 2015.

  1. tjohnson

    Thread Starter Active Member

    Dec 23, 2014
    614
    121
    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.
    [​IMG]
    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.
     
    Last edited: May 8, 2015
  2. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,438
    368
    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?
     
  3. ScottWang

    Moderator

    Aug 23, 2012
    4,850
    767
    Could you take some clearly photos again, it's unclear?
     
  4. tjohnson

    Thread Starter Active Member

    Dec 23, 2014
    614
    121
    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.
    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.
     
  5. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,790
    827
    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.
     
  6. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,790
    827
    image.jpg
    Here's the minimalist circuit from the datasheet. It still has the capacitor and resistor to ground.
     
  7. tjohnson

    Thread Starter Active Member

    Dec 23, 2014
    614
    121
    @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?
     
  8. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,790
    827
    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.
     
  9. tjohnson

    Thread Starter Active Member

    Dec 23, 2014
    614
    121
    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: May 9, 2015
  10. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,438
    368
    Your speaker is predominantly responsible for the poor sound quality and particularly the low-frequency distortion.
     
    tjohnson likes this.
  11. ian field

    Distinguished Member

    Oct 27, 2012
    4,413
    782
    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.
     
  12. tjohnson

    Thread Starter Active Member

    Dec 23, 2014
    614
    121
    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.
     
  13. tjohnson

    Thread Starter Active Member

    Dec 23, 2014
    614
    121
    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?
     
  14. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,438
    368
    As long as it is built to a good standard it should be perfectly safe.
     
    tjohnson likes this.
  15. ian field

    Distinguished Member

    Oct 27, 2012
    4,413
    782
    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.
     
    tjohnson likes this.
  16. tjohnson

    Thread Starter Active Member

    Dec 23, 2014
    614
    121
    @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?
     
  17. ian field

    Distinguished Member

    Oct 27, 2012
    4,413
    782
    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.
     
  18. tjohnson

    Thread Starter Active Member

    Dec 23, 2014
    614
    121
    Actually, I haven't learned how to solder yet, and the circuit is still on my breadboard.:eek:
     
  19. ian field

    Distinguished Member

    Oct 27, 2012
    4,413
    782
    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.
     
    tjohnson likes this.
  20. tjohnson

    Thread Starter Active Member

    Dec 23, 2014
    614
    121
    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: May 15, 2015
Loading...