Problems with USB Port on Homemade speaker box, why can't I listen to music and charge at the same time?

Okay, so I have a speaker box that I made myself with a kitted 7w audio amp. I put that in a box with a decent 4 inch speaker, and that was working great. Then I decided that I really need to add some sound reactive lights, so I got a TIP31 transistor and hooked that up along with a 7805 5v regulator to a USB port so I can charge my devices with it.

So, the USB port works great, and so does the speakers and lights. But *not* when I plug in my device to charge while it playing music through the 3.5mm audio jack. It gives off this weird fuzzy sound, but still charges.

On my multi meter it shows continuity between the USB port and the audio input and speaker, so I first thought that maybe I didn't have something grounded quite right, but it all appears to be set up right.

Is there some sort of filter I can set up so that I can charge one device and play music at the same time on the same device?

Or would need to set up the two circuits on different power sources? I would really rather not do that for the simple fact of trying to keep it simple...

Here's my schematic of it (sorry about it being sloppy, I did it rather quickly but everything on there should be right).

Here's a better quality picture of the schematic



Picture of Problems with USB Port on Homemade speaker box, why can't I listen to music and charge at the same time?
seandogue6 years ago
Your charger is introducing hum because it produces a noisy power source. What does the AC component of the power supply look like on a scope?

My guess is that were you able to view it, you'd find appreciable AC noise on the charging voltage, which is then introduced to the audio directly thru the power. In other words, your effective gain is fluctuating, since the audio amp's supply is fluctuating. It's a classic problem with "normally" battery operated devices. They don't cost much because they don't introduce the circuitry necessary to properly isolate th4e support system with the audio drive, since they expect that you'll be using the device with a "true" dc source, ie batteries. (I quoted true for obvious reasons, anyone who sees the caveat to that statement)
froggyman (author)  seandogue6 years ago
Well, I don't have a scope to look at it but it works fine on just the "DC" power supply.

My problem was that I wasn't pushing the USB cord into my USB port hard enough for it to make a full connection... whoops.

Thanks for your help though!
I'll guess you've set up a hum loop I'd be inclined to remove the ground in to the audio input and see what happens.
froggyman (author)  steveastrouk6 years ago
I tried that, still got the same hum :/