5
\$\begingroup\$

I'm trying to build a stereo speaker system for use on a laptop. I want to keep it as simple as possible, so I'm thinking of using laptop's audio output to for the audio signal and a USB port for power.

As far as I know, each port should be able to provide 100 mA for devices. Is there any need to signal to the computer that I'm going to try to draw 100 mA, or is it acceptable to just connect the device?

Also, how stabilized and filtered is USB power? I'm thinking of using TDA7053A to drive the speakers and its minimum voltage is 4.5 V. If that doesn't work, I'd use two TDA7052 amplifiers, but I'd like to keep number of parts as low as possible.

As for power consumption, I already have a small radio which uses one 50 Ω speaker and a TDA7052 and it uses at most 25 mA, so even with two of those speakers, I should have lots of power to spare with a maximum supply current of 100 mA.

\$\endgroup\$
6
  • \$\begingroup\$ Laptop USB ports can not always support the 100mA, I have had one laptop that could only source 50mA before giving out. \$\endgroup\$
    – jsolarski
    Commented Dec 29, 2010 at 14:09
  • \$\begingroup\$ @jsolarski That's a good thing to know. Hopefully, my project won't take more than 50 mA. \$\endgroup\$
    – AndrejaKo
    Commented Dec 29, 2010 at 14:48
  • 2
    \$\begingroup\$ i wonder if you'd break anything if you were to wire the power lines of two USB ports in parallel? \$\endgroup\$
    – Isaac
    Commented Dec 29, 2010 at 14:54
  • \$\begingroup\$ @Isaac I don't think so. I've seen special USB cables for external ODDs and HDDs which connect two ports in parallel. \$\endgroup\$
    – AndrejaKo
    Commented Dec 29, 2010 at 14:59
  • 3
    \$\begingroup\$ @jsolarski you must be buying cheap laptops. Everyone I have used can supply 100mA if not 500mA \$\endgroup\$
    – Kellenjb
    Commented Dec 29, 2010 at 17:50

3 Answers 3

4
\$\begingroup\$

I haven't experimented with USB power, but this analysis seems to point to it working just fine. At 100ma all tested devices remain above 4.5v. I believe you can just connect to the port... you can test this simply by plugging in a USB cable and checking the pins on the other end with a multimeter.

Here's the full USB spec and here's all other docs from usb.org

\$\endgroup\$
2
  • \$\begingroup\$ Well, with no load I do get around 5 V, so it should work. \$\endgroup\$
    – AndrejaKo
    Commented Dec 29, 2010 at 14:07
  • 1
    \$\begingroup\$ @Andrejako, you get 100mA automatically. electronics.stackexchange.com/questions/5498/… Has some more information about the spec. \$\endgroup\$
    – Kortuk
    Commented Dec 29, 2010 at 16:53
6
\$\begingroup\$

The USB specification requires that a host port be able to source 100mA at a nominal 5V on the VBUS pin. That much power is barely enough to allow some devices to enumerate on the bus. (Early versions of the popular Cypress EZ-USB FX2 required a waiver because they drew slightly more than 100mA during enumeration.)

Of course, there is also an elaborate power management scheme that permits the host to shed loads by turning off ports individually. (I've never personally seen power management implemented on individual ports: on systems I've examined carefully either all host ports are powered, or none are. Your mileage will certainly vary.)

In particular, whether your ports are powered when the laptop is sleeping is more than a little OS, platform, and configuration specific.

A device is permitted to draw up to 100mA without asking permission if VBUS is present. For a device to consume more than 100mA, it is supposed to have permission, and to be able to gracefully handle being denied.

Similar rules apply to hubs, with complications for bus-powered hubs which are permitted to restrict downstream devices to only 100mA, while never consuming more than 500mA from the upstream port.

One reason for an external device to include a second USB cable for power is that effectively allows it to double its power budget.

Edit: I weakened the implication that PCs don't manage power per port. Just because I haven't actually seen it happen has little bearing on whether it is found in the wild. The white-box PC with an MSI MB that I was last actively developing a USB device driver on had fairly limited power management capabilities. The brand new Dell on my desk seems to turn off individual PCIe cards under some conditions, so the world of power management in PCs has been advancing (or at least getting more complicated) steadily while I wasn't looking.

\$\endgroup\$
5
  • \$\begingroup\$ I have used multiple computers that managed per port. Acer and Dell were the two manufacturers I am sure of. \$\endgroup\$
    – Kortuk
    Commented Dec 30, 2010 at 2:54
  • \$\begingroup\$ @Kortuk, I should probably edit to weaken the implication of my observation that I've never met a PC shedding load per port. It is certainly allowed (and encouraged) by the spec, and is probably the correct answer so that a limited energy budget is allocate to things that must be powered for the PC to remain useful. \$\endgroup\$
    – RBerteig
    Commented Jan 18, 2011 at 9:27
  • \$\begingroup\$ I would agree. I know some computers do not enforce power limits, but designing a product for that is bad. \$\endgroup\$
    – Kortuk
    Commented Jan 18, 2011 at 12:47
  • \$\begingroup\$ @Kortuk - Certainly, but modding your own laptop with no intentions of going to production (or even transferring the design to a different computer) is not bad. \$\endgroup\$ Commented Jan 18, 2011 at 15:53
  • \$\begingroup\$ @reemrevnivek, your warranty and your time, that is your decision. I design with intent to follow standards and layout with intent of FCC validation (CE Mark), I have never sent a personal project to FCC validation, but I would feel comfortable sending one. Just like to old adage, "To write beautiful code you must have already written beautiful code for 20 years," always following good design methodology is good practice. \$\endgroup\$
    – Kortuk
    Commented Jan 18, 2011 at 16:02
3
\$\begingroup\$

The USB spec allows any device to draw 100mA from a port. No communication with the host is required.

However, 500mA is available by communicating with the host unless you're plugged into an unpowered hub. Many computers allow you to draw this 500mA without properly requesting it.

If this is a personal project, put a 10 ohm power resistor across the terminals of your USB port and see how much the voltage drops. If it works, you're golden. Just remember that it might not work if you plug it into a different computer.

If this is something you want to distribute, you'll have to tell the host that you want 500mA. If you don't have a micro on the project that can handle this task, the easiest way to do this is to put the cheapest USB hub controller IC you can find on the board, and configure it to do the communication. The TI TUSB2036 is about $3, and just requires you to pull a pin high (Or low, I can't remember) to get the 500mA.

I think you'll want the 500mA to get a decent audio volume. I don't know about the 50 ohm speaker you have, but in general, your power is limited to Vrms^2/R. A pair of 50 ohm speakers operating from 0V to 5V will draw .125W (assuming 100% efficiency). That's hardly better than the stock speakers. Four 8-ohm speakers will bring you up to a more respectable 1.5W of power, which is well under your 2.5W allowable power from the USB port.

If you're operating on a device which has a FireWire (IEEE 1394) port, you might consider using that as it has much more power available (Up to tens of amps, but possibly less. Apple products guarantee that there's a minimum of 7W available, but the spec allows for as much as 45W of power to be delivered.

\$\endgroup\$
2
  • \$\begingroup\$ Actually, I compared those 50 Ω speakers and they do sound much better than stock speakers. Also, I'm not planning to use 500 mA, because I don't want to go into microcontroller land at this time. I don't think I'm going to make more that 2-3 devices and I want to use components which I can easily obtain. \$\endgroup\$
    – AndrejaKo
    Commented Dec 30, 2010 at 21:21
  • \$\begingroup\$ You don't have to go into microcontroller land - As I said, a USB hub IC can do this for you just by soldering it down with the !BUSPWR pin pulled to ground. \$\endgroup\$ Commented Dec 30, 2010 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.